wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes Question about layout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Question about layout" Watch "Question about layout" New topic
Author

Question about layout

david arnold
Ranch Hand

Joined: Apr 10, 2009
Posts: 133
Hi,

I want to create a GUI like the attachment. Well, I am thinking of using BorderLayout (which I am only familiar with) to do it. But I found it kind of troublesome. I created many pane to draw the GUI, any good idea about how to achieve this?

Thanks.


[Thumbnail for layout.JPG]

Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> Well, I am thinking of using BorderLayout (which I am only familiar with) to do it. But I found it kind of troublesome.

only 2 borderLayout panels are required, so it has to be a lot easier (less troublesome) than a GridBagLayout.

simple demo (titledBorder code only to show where they are)



[edit]
and holdingPanel1 could be the contentPane instead
david arnold
Ranch Hand

Joined: Apr 10, 2009
Posts: 133
Wow, that is cool, much better than what I did. Thank you Michael very much for the help. I really appreciate it.

Actually I was thinking to use GridBagLayout, which only needs one layer to create this UI, but it looks complicated for me. The reason I want to use it is that I am not sure if I want to update panel 3 which will show a scanned image, do I also need to update holdingPanel 2 which hold panel 3? Thanks.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> The reason I want to use it is that I am not sure if I want to update panel 3 which will show a scanned image,
> do I also need to update holdingPanel 2 which hold panel 3?

if I'm reading this correctly, all you'd probably need to do is make panel3 a BorderLayout or a Gridlayout(1,1),
then add to panel3 a JLabel to display your image, using label.setIcon(..) to change/update the image.
david arnold
Ranch Hand

Joined: Apr 10, 2009
Posts: 133
I see. Thanks again for your help, Michael!

Regards.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question about layout
 
Similar Threads
swings
Java Question
GWT to access Serial or USB port using Java Communications API (javax.comm) or RXTX
populating an array via the user
Thanks to everyone for the help