Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable Spread Sheet

 
ghazanfar khan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am developed an application finally, i have to show the result into a form of spread sheet, i used JTable(in this i used component like Check box and combo box) but i stuck here if i want to add JList into JTable. I want to show the result in this form using JTable can any one please help me out ..

ID NO Vendor Group Users
1 abc 1 a
b
3 e
g
h

2 xyz 2 b
c
d

3 def 3 a


what i would like i want to add Jlist for column name Group and User. Can anyone please give me some good suggestion. Or any thing that maintain that state of showing data without using Jlist...

Thanks in advance
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I understand correctly, a JComboBox might be a better bet for this data. Either way, you will want to use a custom CellEditor. There is a nice section on this in the Java Tutorial under the heading "Using a Combo Box as an Editor":

http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
 
ghazanfar khan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply, actually whta i want to place JList into JTable cell. for Group and Users cell

ID NO Vendor Group Users
1 abc 1 a
b
3 e
g
h

2 xyz 2 b
c
d

3 def 3 a
 
Ashik Uzzaman
Ranch Hand
Posts: 2373
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What IDE do you use for developing JTable codes? Although my general purpose IDE is Eclipse, I use NetBeans for Swing components development.

-- Ashik
Atlanta, USA
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well even if you don't want to use a combo box, you still need to create your own CellEditor because you will be using a JList to edit the values of the cells (instead of one of the standard editors). You might also need to create your own CellRenderer...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic