Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem Displaying JTable  RSS feed

 
Rohan Pujari
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


when i implement the above code i can see the data but the column names or heading are not displayed.Why is this?? please help
 
Terry Ong
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#show


Adding a Table to a Container

It's easy to put a table in a scroll pane. You need just one or two lines of code:

JScrollPane scrollPane = new JScrollPane(table);
table.setPreferredScrollableViewportSize(new Dimension(500, 70));

The scroll pane automatically gets the table's header, which displays the column names, and puts it on top of the table. ...
 
Rohan Pujari
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oops forgot to implement this method in my table implementation and so i did not get the column names .

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!