meow00
asked on
getContentPane() ...
Hi Experts,
I am reading the JFrame in the Sun java tutorial. I saw JFrame has the following function :
getContentPane() : Returns the contentPane object for this frame.
I don't know what "contentPane" is ... and I can not find the "contentPane" class or container it in the tutorial ....... could anyone please give me some directions ? Thanks a lot !
meow.
I am reading the JFrame in the Sun java tutorial. I saw JFrame has the following function :
getContentPane() : Returns the contentPane object for this frame.
I don't know what "contentPane" is ... and I can not find the "contentPane" class or container it in the tutorial ....... could anyone please give me some directions ? Thanks a lot !
meow.
ie. you don't add components to the frame, you instead add them to the content pane.
eg.
Container pane = frame.getContentPane();
pane.setLayout(new FlowLayout());
pane.add(new JLabel("X"));
eg.
Container pane = frame.getContentPane();
pane.setLayout(new FlowLayout());
pane.add(new JLabel("X"));
ASKER
Thanks .... so is it true that : in the
"pane.setLayout(new FlowLayout());
pane.add(new JLabel("X")); "
we still use JFrame method setLayout() and add(), even though they are invoked by a pane rather than a frame ?
thanks !
"pane.setLayout(new FlowLayout());
pane.add(new JLabel("X")); "
we still use JFrame method setLayout() and add(), even though they are invoked by a pane rather than a frame ?
thanks !
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thank you
it is a Container.