View unanswered posts | View active topics It is currently Sun May 28, 2017 9:32 pm

Reply to topic  [ 1 post ] 
 grow portion in y axis with scrollable component 
Author Message

Joined: Mon Aug 01, 2011 2:12 pm
Posts: 1
Post grow portion in y axis with scrollable component
I have two compound components.
one is upper JTree and lower JPanel with Jbutton. The other also is upper JTable and lower JPanel with Jbutton.
JTree and JTable is held with JScrollPane.

I want the portion of first : second is 7:3. (to y axis)

JPanel p = new JPanel(new MigLayout("", "" ,"[gp 110, grow 70, fill][grow 30]"));

JPanel p1 = new JPanel(new BorderLayout());
JPanel p11 = new JPanel(new FlowLayout(FlowLayout.RIGHT));
p11.add(new JButton("btn1"));
p11.add(new JButton("btn2"));
p1.add(new JScrollPane(new JTree()), BorderLayout.CENTER);
p1.add(p11, BorderLayout.SOUTH);

JPanel p2 = new JPanel(new BorderLayout());
JPanel p22 = new JPanel(new FlowLayout(FlowLayout.RIGHT));
p22.add(new JButton("btn3"));
JTable table = new JTable(5, 6);
JScrollPane jp = new JScrollPane(table);
p2.add(jp, BorderLayout.CENTER);
p2.add(p22, BorderLayout.SOUTH);

p.add(p1, "wrap, growx");
p.add(p2, "wrap, growx");

I hope p1 and p2 are located keeping 7:3 but it looks 5:5 I think.
How can I get 7:3?

Thank you in advance.

Mon Aug 01, 2011 2:18 pm
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.