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 usage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable usage" Watch "JTable usage" New topic
Author

JTable usage

Chinmay Bajikar
Ranch Hand

Joined: Dec 08, 2001
Posts: 159
Hi,
I am trying to build a quick and dirty kind of JTable UI, which will allow you to define relations between columns of 2 tables.
So the table has 4 columns.1st one being names of the source tables in a ComboBox,2nd one should have the columns of the table selected in the 1st col (in a combobox).Same goes for the 3rd and 4th columns which will hold the table names and col names for the target tables.

I am having problems updating the 2nd col based on the selection done in the 1st.
Any ideas from anybody who has done something similar??

Thanks,
Chinmay


The strength of the Wolf is the pack & the strength of the pack is the wolf....Rudyard Kipling
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
What is your approach?


There is no emoticon for what I am feeling!
prasanna kanth
Greenhorn

Joined: May 14, 2006
Posts: 28
Hi, can you explain clearly,
prasanna kanth
Greenhorn

Joined: May 14, 2006
Posts: 28
Hi, can you explain clearly,

Prasanna
Chinmay Bajikar
Ranch Hand

Joined: Dec 08, 2001
Posts: 159
Hi,
I have extended the AbstractCellEditor to have my own CellEditor.
In the
public Component getTableCellEditorComponent(JTable table,Object value,boolean isSelected,int row,int col)
Every time the col tht is clicked is the one which represents the table-columns, I get the table name from the adjoining column and populate the combo with all the columns for tht table.

I am pasting the code here,
Even numbered cols are the ones for Table-Columns and odd numbered are the Table Names.
Hope it makes things clearer.


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable usage
 
Similar Threads
JTable help
JTable switching
jtable
Columns on JTable
JTable