I’m a bit hazy as to the true meaning of JFrame and Jpanel.
I can add a JFrame to an application, and it draws nicely directly on to the frame.
But am I supposed to make a Panel that is drawn on to, and pass the Panel to the frame?
And what about when I try to make this into an applet - I can’t add a JFrame to the Applet,
getting ‘java.lang.IllegalArgumentException: adding a window to a container’
So I can make the Jpanel and add that, but what is the function of the JFrame then?
should I make a blank JFrame receptacle in the Application to receive the JPanel,
and put all my code in JPanel?
once more with feeling to clear up the structure:
I’m trying to separate all the real code from the Applet and Application Initialization and Running.
so at the moment:
Applet -> makes JPanel -> adds JPanel
Application -> makes JFrame -> adds JFrame
this is BAD because I have cloned class, JPanel and JFrame are nearly identical ( I am testing this to figure it out as I go also )
should this be
Applet -> makes JPanel -> adds JPanel
Application -> makes JFrame -> makes -> JPanel -> addPanelToFrame -> addFrameToApplication?