Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 29th, 2007, 4:15 AM   #1
Kezzer
Newbie
 
Join Date: Mar 2007
Location: England
Posts: 15
Rep Power: 0 Kezzer is on a distinguished road
Send a message via Skype™ to Kezzer
GUI Building

I've rarely, if ever, worked with building GUI's before. I understand fundamental concepts for this but that's not the problem or point here.

I'm trying to build the front-end to an application I've written, but I'm unsure of how to do it. The layout goes like this; there's three columns, but on the middle and right column there's a footer which spans across both of them. So, we have a left-column which spans the entire height, then a middle and right-hand column which are of equal height, but they both share a footer.

For this, should I use multiple layout managers? Or should there be two JPanel's? I'd assume that one would simply have a left and right column, and in the right column I would nest the center and right-hand column along with the footer?

Hopefully that's understandable, if not, try and guess
Kezzer is offline   Reply With Quote
Old Jun 29th, 2007, 4:50 AM   #2
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,038
Rep Power: 5 lectricpharaoh will become famous soon enough
You might want to consider using GridBagLayout. It's a little hard to use compared to the other layout managers, but gives you a fair amount of control. If you need more precise positioning, you can use absolute positioning. However, I don't know how to get the dimensions of the non-client areas of the window (title bar, border, etc), or if it's even possible (though I'm sure it is). This means when you set the size of your frame, the client area will vary depending on such factors as the user's platform and chosen 'theme', making it risky to use absolute positioning.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote
Old Jun 29th, 2007, 6:21 AM   #3
Kezzer
Newbie
 
Join Date: Mar 2007
Location: England
Posts: 15
Rep Power: 0 Kezzer is on a distinguished road
Send a message via Skype™ to Kezzer
Yup, I'm using GridBagLayout already, however the footer will span across all and any columns that exist. I need a footer which spans over only two of the three columns. This means that perhaps I could nest the layouts i.e. have two GridBagLayouts, a left and a right one, and in the right one have two columns and one footer, and the left one would just be one column with no footer. This way I would achieve three columns with a footer spanning across the right and middle column. Does that sound about right?
Kezzer is offline   Reply With Quote
Old Jun 30th, 2007, 11:46 PM   #4
Harakim
Hobbyist Programmer
 
Join Date: May 2006
Location: West Jordan, Utah, United States
Posts: 176
Rep Power: 3 Harakim is on a distinguished road
You could set the layout manager to null and size/position the components yourself. You would have to capture component resize events... Another option is to put the middle and right columns and the footer into one container with one layout manager and then put that component and the left column into another container with its own layout manager.

I'm a null layout manager kind of guy, but the second solution is probably better and more Java-like.

<container A>
	<left column>
	<container B>
		<middle column>
		<right column>
		<footer>

I now realize that second one was one of your ideas.

Last edited by Harakim; Jun 30th, 2007 at 11:47 PM. Reason: I apparently wasn't reading too closely.
Harakim is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
doubts about building a messenger.... programmingnoob Coder's Corner Lounge 9 Jun 26th, 2007 4:58 PM
building a browser toolbar va1damar Java 2 Mar 20th, 2006 9:29 AM
Building the Executable in Eclipse ReggaetonKing Java 5 Jan 13th, 2006 1:42 PM
Question about building a community Vaines Other Web Development Languages 9 Aug 11th, 2005 10:59 AM
a pc building c program latro C 22 May 16th, 2005 8:23 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:47 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC