Thursday, 10 May 2007

Use Borders
Every JComponent can have one or more borders.
To put a border around a JComponent, you use its setBorder method. You can use the BorderFactory class to create most of the borders that Swing provides.
Here is an example of code that creates a bordered container:
JPanel pane = new JPanel();
pane.setBorder(BorderFactory.createLineBorder(Color.black));
titled borders. Using a titled border, you can convert any border into one that displays a text description.

Border blackline;
blackline = BorderFactory.createLineBorder(Color.black);
jComp1.setBorder(blackline);
TitledBorder title;
title = BorderFactory.createTitledBorder("title");
jComp8.setBorder(title);



Use Combo Boxes

No comments: