How to add an EmptyBorder to a JPanel?

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

How to add an EmptyBorder to a JPanel?

In the editor, select your panel and in the properties panel, clic on the "..." button of border field. Select "Empty border" and change "insets" by clicking again on the "...".
I used often "Compound border" for making insets in a component with border. It's like the previous method but with two borders to define and select empty border for the outside border.

But if you making a game with complex animation, maybe using Swing's component is not a good idea.