2

I have a problem with GridBagLayout. My components doesnt want to look like i want ;) I want to make a layout like this:

enter image description here

I wrote a code:

 JTextField first = new JTextField(); ... add(third, c); 

Results look like this, which is "almost" good ;]

enter image description here

Do you know maybe, how to customize it?

Thanks in advance, Marcin

// Edit

Hey, i solved a problem with MigLayout (thanks to mKorbel). Code looks like this (to remove tracking lines, remove debug from constructor):

setLayout(new MigLayout("debug")); add(new JPanel(), "height 200:75%:10000, width 200:75%:10000"); add(new JPanel(), "height 200:75%:10000, width 50:25%:10000, wrap"); add(new JPanel(), "height 50:25%:10000, width 100%, span"); 

(ps if u dont want to make upper bound (10000), you can write hmin x, hmax y ... I dont need it ;) )

1 Answer 1

3

This Image talking about BorderLayout, you have to read BorderLayout tutorial, then maybe there no reason thinking and implementing GridBagLayout

Sign up to request clarification or add additional context in comments.

3 Comments

Good choice; a nested Box Layout works well for components in the upper, right pane.
Thanks, i will take a look. But its possible to set percentage size there? Or row/col span?
no directly isn't possible, then you have look back to GridBagLayout or use todays MigLaoyut, this code could be help you with GridBagLayout

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.