Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Jtable .. cell editor

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a question about setting the default cell editior for each column.
I need to know if it is possible to set two different cell editors for the same column on two different rows.
in the sense I have two combo boxes (A and B) and for column 1 on row 1 ... i want to set the default cell editor as combobox A and for column1 on row 2 .. i need to set the default cell editor as comboBoxB.
Can somebody help me with this one ... I will really appreciate it.
Thanks,
sandsouza
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's easy!
The getTableCellEditorComponent(...) method in TableCellEditor passes in the row and column indices of the cell being edited, you just monitor for the right one and send in the required component!

[ January 31, 2004: Message edited by: saager mhatre ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic