• 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
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Editable JCombobox in JTree

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My tree contains some 8 columns.Each column has an individual combobox. In this i need only one column to be editable, i mean values in one combobox alone must be editable. On submit button., all these values must be sent to db. I need your help in the first part., having individual combobox in JTable, editable combobox in one column alone.

Thanks in Advance.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't help but think that this question is in the wrong forum. Is this question about JSF?
 
Sheriff
Posts: 28398
100
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JTree is a Swing component. It doesn't have "columns" so the first sentence is kind of nonsense, but then the rest starts talking about JTable, which does have columns. At any rate it doesn't seem to be about anything but Swing (definitely not Ant or Maven or any other build tool whatsoever) so I will move it to the Swing column.

It would also help if Dhivya could clarify the question so we at least knew whether it was about JTree or JTable.
 
Dhivya Krishnan
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
very sorry., its JTable., each column in the JTable must have individual combobox in which one combo box is editable. for eg take combobox in the 5th column in the table is alone editable.
 
Sheriff
Posts: 22849
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out how TableCellEditors work for the combo box. DefaultCellEditor can be used for this. Override isCellEditable of your TableModel to determine for each cell separately if it should be editable or not.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic