Java 实现groupBox

Java 实现groupBox

用panel来做,对其边框设置。

JPanel   buttonPanel   =   new   JPanel(new   FlowLayout());
buttonPanel.setBorder(BorderFactory.createTitledBorder( "Edit "));   //设置边框
buttonPanel.add(new   JButton( "button1 "));

你可能感兴趣的:(Java 实现groupBox)