Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable ComboBox Cell Renderer/Editor  RSS feed

 
Carlos Mario Alvarez Palacio
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All. I'm trying to create a simple JTable with a column that has a custom
Renderer and Editor that displays a JComboBox with a set of choices. Visually everything works fine, the problem is that, if I'm let's say, in row 1, and i go and click the row 3, the combo box on row 3 rapidly displays the popup with it's options, but then they hide immediately. If i click again, the popup is displayed properly. If, on the first click, i hold the mouse button pressed, the combo does not hide at all, and i can pick something, but this is rather weird and not common.
I'm getting this behavior either if i extend from DefaultCellEditor or AbstractCellEditor/implement TableCellEditor.


Any Ideas?
 
Gulsum Ramazanoglu
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carlos hi

I am a newbie too, but your words gave me an impression that you use mouse pressed event... instead of mouse clicked (which means "pressed and released").. is it the question? If yes, by changing MOUSE_PRESSED to MOUSE_CLICKED, your problem may drop.

For APIs I benefit this link.. there I can find relevand codes as well.


Bye
 
Gulsum Ramazanoglu
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PS: Codase is not uptodate.. rarely, but possibly as well, you can see that some specifications are absent.. the more uptodate resource (but tha one that doesnt include code samples) is this
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!