JPanel Layout
i have JFrame where i have numbers of JPanel in borderlayout...is it possible to setLayout(null) to each JPanel?? if yes can u give me short example...
thanks in advance..
Ashish
Web Development
i have JFrame where i have numbers of JPanel in borderlayout...is it possible to setLayout(null) to each JPanel?? if yes can u give me short example...
thanks in advance..
Ashish
by shanghai sam
http://java.sun.com/docs/books/tutorial/uiswing/layout/none.html
i don't think use the absoutPositioning will be
useful though.
by diva_cen2000
hi,
As u know every Container is having a method
setLayout(instance of a Layout).with this method
u can override the default layout of a container
so using the refreneces created for JPanel call
this method set the Layout to null.
eg:
JPanel p=new JPanel();
p.setLayout(null);
then add the panel to the JFrame.
this is it
with regards
divas...
by araichura
by sps19742001
Hi,
It is possible to set theie own Layout to each panel.
Example,
public class ExampleFrame extends JFrame
{
JPanel Npanel = new JPanel();
JPanel Spanel = new JPanel();
JPanel Wpanel = new JPanel();
JPanel Epanel = new JPanel();
JPanel panel1 = new JPanel();
public ExampleFrame()
{
NPanel.setLayout(null);
SPanel.setLauout(null);
WPanel.setLayout(null);
EPanel.setLayout(null);
this.getContentPane().add(NPanel,BorderLayout.NORTH);
this.getContentPane().add(SPanel,BorderLayout.SOUTH);
this.getContentPane().add(WPanel,BorderLayout.CENTER);
this.getContentPane().add(EPanel,BorderLayout.EAST);
}
}
by araichura
by araichura
This discussion is closed to new replies.
Sort by Trending