Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes How to take the data out from JTable? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "How to take the data out from JTable?" Watch "How to take the data out from JTable?" New topic
Author

How to take the data out from JTable?

Richard Phen
Ranch Hand

Joined: Apr 27, 2002
Posts: 52
Which method of JTable is used for taking data from JTable? For example, I select one row from JTable and want to take this row data out and specified column[9] to compare some number which is the amount I want to book.
I hope I express clearly what I want to ask. Please help. Thanks a lot!


SCJP<br />SCJD
Chiji Nwankwo
Ranch Hand

Joined: Jun 21, 2002
Posts: 56
I have not tried this, but you can give it a go,

Im not sure how you creating your table.
I think the jtable might have its own default TableModel.
Chiji


SCJP, SCJD, SCWCD<br />"Meekness is not weakness, but power under control"
Richard Phen
Ranch Hand

Joined: Apr 27, 2002
Posts: 52
Should I add a mouseListener to this JTable?
Thanx!
Chiji Nwankwo
Ranch Hand

Joined: Jun 21, 2002
Posts: 56
Hi,
Try and give a bit more information or code samples even, so that we can help out. I am giving you answers based on assumptions that I am making about you scenario and code.
Chiji.
Richard Phen
Ranch Hand

Joined: Apr 27, 2002
Posts: 52
Here is my GUI:
Select data from 1st row of JTable and compare to the seat#.
Help!
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Richard, if you use .trim() method of the String class, then you can get rid of those boxes in your JTable. in the readRecord method of the Data class. probably the same line you changed to fix the deprecated method in that method.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Richard Phen
Ranch Hand

Joined: Apr 27, 2002
Posts: 52
I got it done! Thank you all!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to take the data out from JTable?
 
Similar Threads
JTable(!!!)
JTable
JTable
JTable
JTable ........