The Artima Developer Community
Sponsored Link

Java Answers Forum
jtable and object data [][]

1 reply on 1 page. Most recent reply: Jun 26, 2003 12:07 AM by gaurav kumar

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
jennifer

Posts: 6
Nickname: chil
Registered: Jun, 2003

jtable and object data [][] Posted: Jun 25, 2003 8:00 AM
Reply to this message Reply
Advertisement
hi
Im trying to create a table with 2 colums and several rows.The tables data will come from 2 arrays.
I am having problems creating a object [][] data to create a table using a table model.
Object [][]data=new Object [][]data(that somehow contains the values of the 2 other arrays)
ie jtable table=jtable(data,colnames_array)
How can I feed 2 separate arrays into a multidimensional object array?
thanks


gaurav kumar

Posts: 9
Nickname: tomar
Registered: Jun, 2003

Re: jtable and object data [][] Posted: Jun 26, 2003 12:07 AM
Reply to this message Reply
TableModel myData = new MyTableModel();
JTable table = new JTable(myData);

and define the table model so as to read from the two arrays.

Flat View: This topic has 1 reply on 1 page
Topic: Calling javac and jar Previous Topic   Next Topic Topic: Java Applet

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use