Example Depot

Useful code samples
  • Home
  • Java
  • Contact
  • Blog
Java » Java packages » javax.swing » JComboBox

Determining If the Menu of a JComboBox Component Is Visible

COPY
// Create a read-only combobox String[] items = {"item1", "item2"}; JComboBox cb = new JComboBox(items); // Determine if the menu is visible boolean isVisible = cb.isPopupVisible();

Related examples

Adding and Removing an Item in a JComboBox Component
Creating a JComboBox Component
Determining When the Menu of a JComboBox Component Is Displayed
Displaying the Menu in a JComboBox Component Using a Keystroke
Displaying the Menu in a JComboBox Component Using a Keystroke If the Selected Item Is Not Unique
Getting and Setting the Selected Item in a JComboBox Component
Getting the Items in a JComboBox Component
Listening for Action Events from a JComboBox Component
Listening for Changes to the Selected Item in a JComboBox Component
Selecting an Item in a JComboBox Component with Multiple Keystrokes
Setting the Number of Visible Items in the Menu of a JComboBox Component

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.

Login | Terms of Use | Trademarks | Privacy Statement
Copyright © 2009 Example Depot. All Rights Reserved.