提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.common; |
H |
2 |
|
|
3 |
import javax.swing.BorderFactory; |
|
4 |
import javax.swing.JComponent; |
|
5 |
import javax.swing.border.Border; |
|
6 |
|
|
7 |
/* |
|
8 |
* 边框设置 |
|
9 |
*/ |
|
10 |
public class BorderEx { |
|
11 |
public static void set(JComponent object, String title, int width) { |
|
12 |
Border innerBorder = BorderFactory.createTitledBorder(title); |
|
13 |
Border outerBorder = BorderFactory.createEmptyBorder(width, width, width, width); |
|
14 |
object.setBorder(BorderFactory.createCompoundBorder(outerBorder, innerBorder)); |
|
15 |
} |
|
16 |
|
|
17 |
} |