Hi,
i need one small clarification in swing layouts.
I done coding as..
JPanel panel = new JPanel(new new GridLayout(5,0) );
for(int i=0;i<5;i++)
{
panel.add(new JLabel("Label"+ i));
panel.add(new JButton("button "+i))
}
(frame.getConte ntPane()).add(p anel);
its working fine output is viewed in screen as
Label1 Button1
Label2 Button2
Label3 Button3
But what i need is
Label1 Button1
Label1 Button1
Label1 Button1
Button4 Button5 Button6
is it possible to add button4,button5 ,button6 in another panel and add to the frame?if not how it can be done. Thanks in Advance.
-Thanks &Regards,
Hamsa
i need one small clarification in swing layouts.
I done coding as..
JPanel panel = new JPanel(new new GridLayout(5,0) );
for(int i=0;i<5;i++)
{
panel.add(new JLabel("Label"+ i));
panel.add(new JButton("button "+i))
}
(frame.getConte ntPane()).add(p anel);
its working fine output is viewed in screen as
Label1 Button1
Label2 Button2
Label3 Button3
But what i need is
Label1 Button1
Label1 Button1
Label1 Button1
Button4 Button5 Button6
is it possible to add button4,button5 ,button6 in another panel and add to the frame?if not how it can be done. Thanks in Advance.
-Thanks &Regards,
Hamsa
Comment