aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable" Watch "JTable" New topic
Author

JTable

Ransika deSilva
Ranch Hand

Joined: Feb 18, 2003
Posts: 524
hello,
could you kindly tell me how to do this. i have created a JTable with 100 rows and 5 columnc. what i want to do is i want to name the five columns. A,B,C....... appears now. i know i can use another constructor but the thing is i want to specify the number of rows in the same time. i would appriciate if you write down the code if you can.
thank you very much


SCJP 1.4, SCMAD 1.0<br />SCWCD, SCBCD (in progress)
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2864
    
  11

JTable is a very flexible class, but that flexibility makes it a bit hard to use. The easiest way to get column names is to use the JTable(Object[][] rowData, Object[] columnNames) constructor. There are many other ways. In some cases, you will create your own TableColumnModel and add each column manually.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable