This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes JTable with hashmap--please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "JTable with hashmap--please help" Watch "JTable with hashmap--please help" New topic
Author

JTable with hashmap--please help

uzma ali
Ranch Hand

Joined: Jun 22, 2007
Posts: 56
I am listing the code below

My questions are

1) if my hashmap(contractorRecords) gets 14 records there are more calls to getRowCount. Why is that happening. when I move up and down the scroll bar then values change in the console.

2)I am using hashmap in which the key are the record Numbers. I have no idea how to pass the keys to the main file so that it can be selected my the client but at the same time should not be displayed in the table.

Xabier Martija
Ranch Hand

Joined: Jul 18, 2007
Posts: 40
I don't understand your problem, but it would be easyer if you used an arraylist instead of a hashtable.
uzma ali
Ranch Hand

Joined: Jun 22, 2007
Posts: 56
if I use arrayList how can I take the rec No to the next step in the GUI where we need the rec No for the book.

Please help as I am really stuck and no way to find help

uzma
David Winters Junior
Ranch Hand

Joined: Oct 30, 2007
Posts: 47
Uzma,

How did ypu finally work around this issue of displaying the hashmap in a JTable. I am facing a similar issue currently and i came across your post here.

Your help would be much appreciated.

Thanks,
david
Thomas Hubschman
Ranch Hand

Joined: Sep 25, 2002
Posts: 88
Hi Uzma,

(First Question)

Could you explain further I do not understand your question. It sounds like a Swing rendering issue but I am not sure.

(Second Question)

You can have the TableModel store, but not display, the column numbers as part of the data model.

Tom


SCJP '02, SCWCD '02, SCJD '08, SCSNB '09, SCEA '10
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable with hashmap--please help
 
Similar Threads
getValueAt(int row, int col)
AbstractTableModel how to read in header and row
Why my table's columName invisiable?
jtable
Checkbox editor for JTable column