wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes How to get this attached design using Layout Managers - sans GroupLayout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to get this attached design using Layout Managers - sans GroupLayout" Watch "How to get this attached design using Layout Managers - sans GroupLayout" New topic
Author

How to get this attached design using Layout Managers - sans GroupLayout

John Eipe
Ranch Hand

Joined: May 23, 2008
Posts: 215
Hi

I would like to get the attached swing layout but I'm unable to. I was trying the below code.



Note: I don't want to use any GUI builders or GroupLayout. Please let me know if there is anyother way to get the desired output (see attached jpg file)using other Layouts. It need not be exactly the same as in the image but at least near to it.


[Thumbnail for Capture.JPG]


www.cs-repository.info
Rok Štelcer
Ranch Hand

Joined: Nov 03, 2009
Posts: 101
Hi,

Javas layouts are very very powerful ... there is nothing you can't do.
Usually the BorderLayout will do its job.
However when starting to build some complex applications, you will have to use GridBagLayout.

I didn't check your code, so according to the picture you will need the following:
1. BorderLayout
http://java.sun.com/docs/books/tutorial/uiswing/layout/border.html
2. JSplitPane (perhaps)
http://java.sun.com/docs/books/tutorial/uiswing/components/splitpane.html
If there is no need for a splitted pane, then just skip this.
3. GridBagLayout + GridBagConstraints
http://java.sun.com/docs/books/tutorial/uiswing/layout/gridbag.html

Hope this helps.


Regards,
Rok


SCJP, SCWCD
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2157
    
    7
You attempt only uses a single panel with a single layout manager. The trick is to use multiple panels with each panel using the apppriate layout manager.

I can't tell from the image what your exace goal is so I can't give further advice.
 
Consider Paul's rocket mass heater.
 
subject: How to get this attached design using Layout Managers - sans GroupLayout
 
Similar Threads
ScrollBar Problem
ImageIcon not working
Creating a login screen
How to check if a component exists in Swing?
JTextArea Problems