潘志宝
2025-03-23 45ccb96b7a3a9929e8beb6a2c5793eff6170b56d
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));     
    }
 
}