Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Need help laying out my display window

Posted on 2004-10-01
5
Medium Priority
?
260 Views
Last Modified: 2010-03-31
I'm having trouble making my application display correctly. It is supposed to look something like:

title bar
menu bar

titled label for display

XXXXXXXXXXXXXXXXXXXXXXXXXX      button                    
large textarea                                      button






XXXXXXXXXXXXXXXXXXXXXXXXXX
                                           button   button          

I'm using a GridLayout manager and a JPanel with BorderLayout.

When I run this I get a very tiny box in the center of the top panel where the label is supposed to be.

My text area is there, but it's not as deep as I want it to be. I changed the number for the depth, but it won't change it.

The two buttons on the right side don't show at all and the two bottom buttons are ok.

Can anybody suggest what I can do? Should I use GridBagLayout? How would I use it if I should?                            
0
Comment
Question by:HelpWithJava
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 24

Expert Comment

by:sciuriware
ID: 12203560
Either set sizes on those components or make the frame a bit more complex:
don't put everything in ONE panel, but layer things a bit,
by 1st level : gross divide over the screen, 2nd level: major components and panels
3rd level: lowest components.
;JOOP!
0
 

Author Comment

by:HelpWithJava
ID: 12203862
As previously stated, I'm using a GridLayout manager and JPanels. I DID do everything you mentioned, but nothing works right. It seems like if I get one or two things to display right, the other components don't display right. That's the whole problem.
0
 
LVL 4

Accepted Solution

by:
funnyveryfunny earned 320 total points
ID: 12204426
From your layout description, I would approach the layout this way:

A main frame F, using borderlayout.

Then on F.North you add a JPanel Menu. This Menu will have BorderLayout where it contains NORTH.menuBAR and SOUTH.Label

Then on F.Center add JtextArea.

Then on F.South add JPanel horizontalButtons and use GridBagLayout or GridLayout for this panel.

Then on F.East add JPanel verticalButtons do the same.

You might need some padding (space fillers like empty labels etc) to get layout that you wanted.
0
 

Author Comment

by:HelpWithJava
ID: 12204712
Thanks, but I have it figured out now. I will give you the points anyway since you offered a response very close to what I have done.   :)
0
 
LVL 4

Expert Comment

by:funnyveryfunny
ID: 12204948
:) thanks.
0

Featured Post

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question