• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to give evets to JTextField in JTable

 
Vishal Fichadiya
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have Table which displays current directory files
I m using first column as file column which give file names as well as directory. i m using Abstract Table Model and i have set renderer for the first column in my program.In my render i have taken first field as TextField
now i want to give event to that text filed so that whenever i double click on that field it displays files under it.
how can i give events to these text filed under JTable
 
Pavan Kumar Srinivasan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Cellrenderer(like a rubberstamp) does not consume any events.
In the abstract tablemodel return true for isCellEditable and use CellEditors(DefaultCellEditor) with a click count of 2.

More info can be found here : Table Cell Editors
[ October 20, 2008: Message edited by: Pavan Kumar Srinivasan ]
 
Darryl Burke
Bartender
Posts: 5153
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could search the net for JTreeTable, looks likely that this will serve your purpose better.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!