Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "Andrew Thompson" Subject: =?utf-8?B?UmU6IEpDb21ib0J Message-ID: <72bec7b1aa98f@uwe> X-Comment-To: comp.lang.java.gui Newsgroups: comp.lang.java.gui In-Reply-To: <1180128252.619652.119670@q75g2000hsh.googlegroups.com> References: <1180128252.619652.119670@q75g2000hsh.googlegroups.com> Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 40 Date: Wed, 27 Apr 2011 15:34:48 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303918488 96.60.20.240 (Wed, 27 Apr 2011 10:34:48 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:34:48 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:1694 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