File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JTable Spread Sheet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable Spread Sheet " Watch "JTable Spread Sheet " New topic
Author

JTable Spread Sheet

ghazanfar khan
Ranch Hand

Joined: Apr 18, 2005
Posts: 81
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

Joined: Apr 21, 2005
Posts: 410
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

Joined: Apr 18, 2005
Posts: 81
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

Joined: Jul 05, 2001
Posts: 2370

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

Joined: Apr 21, 2005
Posts: 410
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...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable Spread Sheet