Swing Table

How can i get data from JTable

Page 1 of 1

2 Replies - 1568 Views - Last Post: 28 November 2010 - 07:30 PM Rate Topic: -----

#1 raja.chaya25   User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 22
  • Joined: 28-November 10

Swing Table

Posted 28 November 2010 - 07:27 PM

how can i get data from JTable. I want store in String array.
Thank you.
Is This A Good Question/Topic? 0
  • +

Replies To: Swing Table

#2 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12316
  • View blog
  • Posts: 45,416
  • Joined: 27-December 08

Re: Swing Table

Posted 28 November 2010 - 07:29 PM

See the JTable getValueAt() method. You can loop through the JTable and get individual elements almost as if you were working with a 2D array.
Was This Post Helpful? 0
  • +
  • -

#3 pbl   User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8378
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: Swing Table

Posted 28 November 2010 - 07:30 PM

View Postraja.chaya25, on 28 November 2010 - 08:27 PM, said:

how can i get data from JTable. I want store in String array.
Thank you.

You DON'T get data from JTable
JTable is just a fancy GUI thing to display data from it's TableModel

So you can fetch the data from the Table Model

getValueAt() proposed by macosxnerd101 would work but it is really misunderstanding how JTable works and is taking a short cut THAT works

This post has been edited by pbl: 28 November 2010 - 07:35 PM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1