Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-31-2008, 03:56 AM
Member
 
Join Date: Dec 2007
Posts: 30
Leprechaun is on a distinguished road
Two content panes in one GUI?
I have made a simple tic tac toe game... I used a grid which worked nicely for the board. However, I tried to add a label at the bottom to tell the user who won and to "Click to restart" but the text is confined to the space of one of the tic tac toe buttons...

As of now, all the objects are in one content pane. I think I might need to use two content panes but I can't figure out how.

There may be an easier solution that I haven't though of...
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-31-2008, 05:02 AM
Senior Member
 
Join Date: Jul 2007
Posts: 1,189
hardwired is on a distinguished road
Code:
JPanel gridPanel = new JPanel(); // configure gridPanel... JLabel statusLabel = new JLabel(); // configure statusLabel... JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container cp = f.getContentPane(); // Default layout of contentPane is BorderLayout // Add gridPanel to center of BorderLayout cp.add(gridPanel); // Add statusLabel to south section of BorderLayout cp.add(statusLabel, BorderLayout.SOUTH);
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Asbru Web Content Management 6.7.2 Java Tip Java Announcements 0 04-15-2008 07:49 PM
Asbru Web Content Management 6.7.1 Java Tip Java Announcements 0 04-01-2008 05:14 PM
Getting content type from a website Java Tip Java Tips 0 11-26-2007 02:06 PM
Updating Local Content ibanez270dx Java Applets 1 11-02-2007 02:55 AM
Asbru Web Content Management 6.6 JavaBean Java Announcements 0 09-26-2007 01:25 PM


All times are GMT +3. The time now is 02:39 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org