Search code examples
javauser-interfacejframejcombobox

Calling JComboBox with JFrame


I´m new in creating GUI in Java, I would like to implement JComboBox (which uses GlazedLists), in my JFrame, which is in another class. Is it possible to call this JComboBox in my JFrame? I´m asking because I use NetBeans (some parts of code are forbidden to edit). Thanks


Solution

  • You can access the reference to the JComboBox like any other variable. The name of the combo boxes variable will depend if your reamed the object or not (you can do this from the form inspector, usually found under the projects window when in design mode)

    While you can't modify the code in the protected blocks, you still effect he combo box (or any other component) within your code normally, just make sure initComponents has been called first