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