Results 1 to 2 of 2
Thread: Content pane vs. JPanel?
- 04-22-2012, 07:03 AM #1
Member
- Join Date
- Jan 2012
- Location
- The Coffee Pot
- Posts
- 36
- Rep Power
- 0
Content pane vs. JPanel?
I'll be honest I have limited knowledge of swing, but when I was looking at code snippets online to get me on the right track for my hangman game I saw a lot of 'frame.getContentPane()'. I never understood the point of it because I completed my game successfully by just making a JFrame and putting a bunch of JPanels in it. So out of curiosity, what is the point of it?
- 04-22-2012, 07:26 AM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,608
- Rep Power
- 5
Re: Content pane vs. JPanel?
See Using Top-Level Containers (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
Also note the API for JFrame...
As a conveniance add and its variants, remove and setLayout have been overridden to forward to the contentPane as necessary.
Similar Threads
-
Can't change the background of my content pane
By jiffi in forum AWT / SwingReplies: 29Last Post: 12-11-2011, 05:04 PM -
Centering things a content pane
By RKhadder in forum New To JavaReplies: 1Last Post: 09-28-2010, 01:43 AM -
Update the JFrame after change the Content Pane
By alisonchan30 in forum AWT / SwingReplies: 1Last Post: 04-26-2010, 06:22 AM -
Changing content pane of a JFrame?
By dunafrothint in forum AWT / SwingReplies: 1Last Post: 03-11-2010, 10:21 PM -
Selecting a JMenu paints over the JPanel on the content pane
By Swingset in forum AWT / SwingReplies: 3Last Post: 01-05-2008, 11:13 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks