This is what I want the JComboBox to do for me
Olalekan Samuel <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.user-interface |
|---|---|
| Message-ID | <[email protected]> |
Witold Szczerba wrote: > 2006/8/22, Olalekan Samuel <[email protected]>: >> [...]I want to load these Jcombobx >> using a class that I wrote but this is given me a problem. Can anybody >> help me out in solving this problem as it is an urgent work please. > What I am trying to do is that I populated a JComboBox with a combox > with a method from a class this is the code from that class private String[] Device = new String[]{"Pagers", "PDA", "Phones"}; public String[] getDevice() { return Device; } and this is the code that I used to collect the data into the JComboBox EmuAPI Emulating = new EmuAPI(); // I declare the instance of that class String[] test = Emulating.getDevice(); public void fillComboBox1() { jComboBox1.addItem(test[0]); jComboBox1.addItem(test[1]); jComboBox1.addItem(test[2]); jComboBox1.invalidate(); } and this is working but my problem is that I want to make sure that whenever I select an item in this JcomboBox then another IComboBox will be fill with various item i.e if I select pager for example another empty combobox will be filled with diferent data in that class. and if I selct phone different data will be filled in replce of the former one. I think I am having problem with my declaration can anybody help me please. > I don't know if this is what you need, but in Matisse, you can place a > JComboBox from palette, select it, open properties, find "Code > Generation" under "Code" tab and there you may place any method call > that will return your custom JComboBox... > Is that what you were looking for? -- Ogunleye Olalekan Samuel Room 300 CVC Laboratory Department of Computer Science University of Cape Town South Africa +27(0)216502670 ------- Work +27(0)792111220 ------- Mobile +27(0)216899465 ------- Fax Website: http://people.cs.uct.ac.za/~olaoye/