Java Swing Tutorial - Java JComboBox .setLightWeightPopupEnabled (boolean aFlag)








Syntax

JComboBox.setLightWeightPopupEnabled(boolean aFlag) has the following syntax.

public void setLightWeightPopupEnabled(boolean aFlag)

Example

In the following code shows how to use JComboBox.setLightWeightPopupEnabled(boolean aFlag) method.

//from   www.  j a v a 2s . c om
import javax.swing.JComboBox;

public class Main {
  public static void main(String[] argv) throws Exception {
    String[] items = { "item1", "item2" };
    JComboBox cb = new JComboBox(items);

    cb.setLightWeightPopupEnabled(true);
  }
}