| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
package docrobot; |
| 20 |
|
| 21 |
import java.awt.BorderLayout; |
| 22 |
import java.awt.GridLayout; |
| 23 |
|
| 24 |
import javax.swing.*; |
| 25 |
|
| 26 |
import org.jdesktop.swingx.JXTitledPanel; |
| 27 |
import org.pushingpixels.substance.api.skin.SubstanceBusinessBlackSteelLookAndFeel; |
| 28 |
|
| 29 |
public class TitledPanelFrame extends JFrame { |
| 30 |
public TitledPanelFrame() { |
| 31 |
super("JXTitledPanel example"); |
| 32 |
|
| 33 |
this.setLayout(new BorderLayout()); |
| 34 |
|
| 35 |
this.add(new JXTitledPanel("Left panel"), BorderLayout.WEST); |
| 36 |
JPanel center = new JPanel(new GridLayout(2, 1, 0, 0)); |
| 37 |
center.add(new JXTitledPanel("Top panel")); |
| 38 |
center.add(new JXTitledPanel("Bottom panel")); |
| 39 |
this.add(center, BorderLayout.CENTER); |
| 40 |
|
| 41 |
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
| 42 |
this.setSize(500, 350); |
| 43 |
this.setLocationRelativeTo(null); |
| 44 |
} |
| 45 |
|
| 46 |
public static void main(String[] args) throws Exception { |
| 47 |
JFrame.setDefaultLookAndFeelDecorated(true); |
| 48 |
UIManager.setLookAndFeel(new SubstanceBusinessBlackSteelLookAndFeel()); |
| 49 |
|
| 50 |
SwingUtilities.invokeLater(new Runnable() { |
| 51 |
public void run() { |
| 52 |
new TitledPanelFrame().setVisible(true); |
| 53 |
} |
| 54 |
}); |
| 55 |
} |
| 56 |
} |