Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Preventing the unrolled list of a JComboBox to close

Charles Van Damme
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I created a class inheriting from JDialogBox : JDialogB_ComboBEdition . I combined an own JDialogB_ComboBEdition object to the 'mouseClicked()' function of a MouseListener, to have a dialog box getting opened when the user clicks left in the text field of the closed combo box.
It works fine ... at first sight.
The dialog box pane contains some buttons and one edition JTextField which will enable
- an item of the unrolled list to be moved upwards or downwards
- to delete an item
- to edit the text of a pre-selected item.

Problem : When clicking in the upper text field of the combo box, the list unrolls, as expected. but closes when the dialog box frame is displayed, that is almost immediately.
How could I keep the unrolled list opened, and later refreshed, so that the user is helped when he activates controls in the combo box. Even if it means that I would use explicitely an API method to close the unrolled list programmatically.
This has anything to do with UIComboBox, isn't it ?

Please, some useful guidance ...
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic