4 Replies - 404 Views - Last Post: 02 October 2012 - 05:53 AM Rate Topic: -----

#1 jtech  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 01-October 12

Entering data to indiviual cells in a Jtable

Posted 02 October 2012 - 05:08 AM

Hi,
I hava a JTable in wish i would like to enter data to each cell individualy.
all that I have seen is how to Add data to the complete Row, but what Iam
Looking for is to enter data the each cell as one by one as if it was a spreadsheet.
Is This A Good Question/Topic? 0
  • +

Replies To: Entering data to indiviual cells in a Jtable

#2 nick2price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 562
  • View blog
  • Posts: 2,826
  • Joined: 23-November 07

Re: Entering data to indiviual cells in a Jtable

Posted 02 October 2012 - 05:34 AM

Is this something you want to enter manually or through code? Eitherway, both answers can be found within
How to use Tables
Was This Post Helpful? 0
  • +
  • -

#3 jtech  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 01-October 12

Re: Entering data to indiviual cells in a Jtable

Posted 02 October 2012 - 05:37 AM

Thanks for the reply,
I would like to enter this Manualy.
Was This Post Helpful? 0
  • +
  • -

#4 nick2price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 562
  • View blog
  • Posts: 2,826
  • Joined: 23-November 07

Re: Entering data to indiviual cells in a Jtable

Posted 02 October 2012 - 05:52 AM

Well the cells should be editable by default (as far as I remember). If you then want to do something with the inputs, you can fire off some sort of event. If you just want to get the inputted values, just loop your table and use getValueAt() Once again, that link I provided should show you everything. If you want to get really brave, you could even look into creating your own TableModel as this will give you more overall control.
Was This Post Helpful? 0
  • +
  • -

#5 pbl  Icon User is offline

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

Reputation: 8332
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Entering data to indiviual cells in a Jtable

Posted 02 October 2012 - 05:53 AM

Use a Table Model than you can:
- hadcode them
- enter them manually
- read them from a file
- read the value from a Database
- .... what ever you want

http://www.dreaminco...h-a-tablemodel/
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1