• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTable usage

 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is your approach?
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, can you explain clearly,
 
prasanna kanth
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, can you explain clearly,

Prasanna
 
Chinmay Bajikar
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.


 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic