Results 1 to 1 of 1
- 01-04-2011, 12:29 AM #1
Member
- Join Date
- Dec 2010
- Posts
- 10
- Rep Power
- 0
Combo Box defining what appears in a Jlist
Hi!
When my combobox changes object, the Jlist that is set to change depending on which object is selected, doesn't change but instead just freezes the Jlist.
Edit: only the default selected object has it's DefaultListModel do what it's supposed.
here's the code
Java Code:final JComboBox cb = new JComboBox(Personlista.Personlista); Person selected = (Person)cb.getSelectedItem(); LanlistModel = selected.getList(); lanlist = new JList(LanlistModel);Java Code:cb.addItemListener(new ItemListener(){ @Override public void itemStateChanged(ItemEvent e) { Person selected = (Person)cb.getSelectedItem(); LanlistModel = selected.getList(); } });
Java Code:public void setList(DefaultListModel list) { this.list = list; } public DefaultListModel getList() { return list;
Similar Threads
-
dynamically populate the city combo box based on the values of state combo +ajax+jsp
By sandy1000 in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 12-29-2010, 10:00 AM -
GUI appears grey until resize randomly. Why?
By AcousticBruce in forum New To JavaReplies: 3Last Post: 12-13-2010, 05:54 PM -
Math tutor, no errors, nothing appears when run!
By Reiyn in forum New To JavaReplies: 6Last Post: 11-11-2010, 10:28 AM -
creation of one combo box form another combo box
By er.tyagigaurav in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 12-09-2008, 03:14 PM -
How to make the menu bar objects appears from right to left
By JavaBean in forum AWT / SwingReplies: 3Last Post: 07-19-2007, 11:12 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks