Re: 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: > Hello again! > Few things before I get started: > 1) do not change teh subject in that way, because you broke the thread > into two separated pices. > 2) do NOT name variables or fields with names with first capital > letter! That is againts convention (names of classes are the only > allowed to have capital letters first). > For example: String[] Devices = ... should be replaced by String[] > devices = ... > In this way you can easily distinguish between classes from instances > of that classes from fields from.... etc.... > > The code you presented is missing too many things (I mean it is only a > fragment), but maybe there should be something like getJComboBox1(), > and you could use this method where I said befor - in 'code > generation' property of CODE tab in properties window. > Of course you would have to get instance of that object containing > getJComboBox1() method first... > > > > 2006/8/23, Olalekan Samuel <[email protected]>: > >> 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(); >> } >> what I am trying to do really is that I am trying to develop a plugin modules using the top components look up and so this top component does not allow me to incorporate any swing property related component into the application. please what can I do to solve this problem. Somebody please help. -- 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/