Hello Everyone,
I'm studying the Lesson on Performing Custom Painting in the
Java Tutorials. The lesson is in three steps.
In step 2, a JFrame named f is created. A JPanel object called MyPanel is also created and then added to the frame f.
A method named getPreferredSize is defined to set MyPanel's size but the problem I have with understanding why this method is never invoked anywhere in the code. So how does MyPanel and ultimately the JFrame to which it is attached get their sizes.
I am always impressed by the insights offered in this forum, thank you for you help.
The code listed below: