Download NetBeans!

20070110 Wednesday January 10, 2007

Better Borders, Quicker Coding, Faster Finish

In the Tools menu, choose Palette Manager > Swing/AWT Components. You now see this:

Notice that the "Borders" category is not selected. All the other ones are selected. So select "Borders" too. Click Close. If your palette is open, close it and then open it again. Notice that you now have all your borders in the palette:

And... now you can drag and drop borders onto, for example, a JPanel, such as the one above. Then the border property changes immediately and shows the change at once. It's maybe a small thing, but this way you can very quickly see what the default borders look like on the container. To tweak a border (such as, adding a title to a TitledBorder and setting the thickness of a border), you'd still need to click the elipsis next to the property. However, at least this lets you quickly try out different borders without going through bunches of dialog boxes and clicks and so on.

By the way, I doubt that borders are meant to be in the palette, which is why the category is not selected by default. However, it seems a bit odd to me that it is there at all, if it isn't supposed to be in the palette. However, custom looks and feels (needing the update pack, which I'm not using above) are in the same boat. Well, with borders it can be quite useful to have them in the palette, as shown above.

Jan 10 2007, 11:06:08 AM PST Permalink