aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes jtables[] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "jtables[]" Watch "jtables[]" New topic
Author

jtables[]

marko stone
Greenhorn

Joined: Oct 16, 2002
Posts: 23
hi
trying to do array of jtables and put them on JPanel
why my jtable showing at part of screen center ? and why it's not resizing to full horizotal size of screen ? label l2 cover column headers at table
thanks
My declarations
TableC tablec[];
JScrollPane jsp;
JLabel label;
JPanel jp;
GridBagLayout gbl;
GridBagConstraints gbc;
in constructor i have

jsp=new JScrollPane(jp);
tablec=new TableC[100];
GridBagLayout gbl=new GridBagLayout();
GridBagConstraints gbc=new GridBagConstraints();
gbc.fill=GridBagConstraints.BOTH;
getContentPane().add(jsp);
setMainInfo(1);
public void setMainInfo(int num)
{
int i;
JLabel l2,l3;
l2=new JLabel("l2");
l3=new JLabel("l3");
for (i=0;i<num;i++)
{
gbc.gridwidth=GridBagConstraints.REMAINDER;gbl.setConstraints(l2,gbc);
jp.add(l2,gbc);
tablec[i]=new TableC(this);
gbc.gridwidth=GridBagConstraints.REMAINDER;
gbl.setConstraints(tablec[i],gbc);
jp.add(tablec[i],gbc);
gbc.gridwidth=GridBagConstraints.REMAINDER;gbl.setConstraints(l3,gbc);
jp.add(l3,gbc);
}
repaint();
 
 
subject: jtables[]