File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes event handling in jtable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "event handling in jtable" Watch "event handling in jtable" New topic

event handling in jtable

Rajesh em

Joined: Nov 01, 2004
Posts: 1
i am new to this ,
how to handle events if more than one combo box used in jtable
if u click on the first combo get the selected name or combo according to that the values should be added on the next combo..

pl.reply soon
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Add a ListSelectionListener to the table SelectionModel and to the TableColumnModel SelectionModel of each TableColumn. Find the selected cell(row,col) in the valueChanged method and determine what you want to do with the selected value based on the (row,col) position.
It is sorta covered in the JavaRanch Style Guide.
subject: event handling in jtable
It's not a secret anymore!