I decided to write a small Java program to experiment around with BorderLayout, because I\'m developing a Java game and I need to have 2 objects placed in a single JFrame at the
You need to override the getPreferredSize()
method so the layout manager can determine the proper size for the component.
How do I do that?
Read the section from the Swing tutorial on Custom Painting for more information on custom painting, including a working example that shows how to override the getPreferredSize()
method.