Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable

 
Manuel Paco
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help.
I would like to get a table with columnHeads, rows and scrollbars.
The following code does not show scrollbars.
table = new JTable( rows, columnHeads );
JScrollPane scrollpane = new JScrollPane( table );
getContentPane().add( scrollpane, BorderLayout.CENTER );
The following code does show scrollbars but does not show "columnHeads".
table = new JTable( rows, columnHeads );
JPanel panelTable = new JPanel();
panelTable.add(table);
JScrollPane scrollpane = new JScrollPane( panelTable );
getContentPane().add( scrollpane, BorderLayout.CENTER );
What am I doing wrong?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic