File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable

 
Ransika deSilva
Ranch Hand
Posts: 524
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Greg Charles
Sheriff
Posts: 2984
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic