![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
|
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 ![]() |
|
|
|
|
|
#2 |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,038
Rep Power: 5
![]() |
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 |
|
|
|
|
|
#3 |
|
Newbie
|
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?
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: May 2006
Location: West Jordan, Utah, United States
Posts: 176
Rep Power: 3
![]() |
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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |