Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #1694

=?utf-8?B?UmU6IEpDb21ib0J

From "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Subject =?utf-8?B?UmU6IEpDb21ib0J
Message-ID <72bec7b1aa98f@uwe> (permalink)
Newsgroups comp.lang.java.gui
References <1180128252.619652.119670@q75g2000hsh.googlegroups.com>
Date 2011-04-27 15:34 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
Piet71 wrote:
>Hi,
>I have written a program that heavily uses JComboBoxes to have the
>user select some stuff. In oder to allow for a quick exchange between
>JComboBox and JList, I have coded a class that could serve as Model
>for both JComponents.  In my program it is frequently the case that
>when the user selects an item from a JComboBox, the selection in other
>JComboBoxes needs to be updated and the new selection shown in the
>JTextField of the JComboBox. The latter is not working. 

I am not entirely confident I understand the code, but
try changing this bit for different behaviour.

>public class ComboProblemDemo extends JFrame implements
>ActionListener{
..

>	public void actionPerformed(ActionEvent ae){
>	
>basketModel.setSelectedItem(((Fruit)fruit.getSelectedItem()).getBasket());

  // tell the UI to update..
  repaint();

>	}
...

HTH

-- 
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via http://www.javakb.com

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

=?iso-8859-1?q?JComboBox= "Piet71" <piet71@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
  =?iso-8859-1?q?Re:_JCombo "Piet71" <piet71@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
  Re: JComboBox.setSelected "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
    =?iso-8859-1?q?Re:_JCombo "Piet71" <piet71@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
      Re: JComboBox.setSelected "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
        =?UTF-8?B?U3lzdGVtLm91dC5 "RedGrittyBrick" <redgrittybrick@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
          =?UTF-8?B?UmU6IFN5c3RlbS5 "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
            =?UTF-8?B?UmU6IFN5c3RlbS5 "RedGrittyBrick" <redgrittybrick@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
              =?UTF-8?B?UmU6IFN5c3RlbS5 "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
  =?utf-8?B?UmU6IEpDb21ib0J "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
    =?iso-8859-1?q?Re:_JCombo "Piet71" <piet71@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000

csiph-web