Article View: borland.public.jbuilder.java.swing
Article #421Re: Preferred Event listener for jTabbedPane?
From: Magnus
Date: Thu, 05 May 2005 13:12
Date: Thu, 05 May 2005 13:12
29 lines
2340 bytes
2340 bytes
Thanks Kevin The values in tab1 will be stored in an external SQL-DB and (at least I planned to) fill my ComboBox from that table. Can I still work with a Model? If so, do you have any examples/tutorials that can guide me? Kevin Dean [TeamB] wrote: > Magnus wrote: > > >>I have a series of tabs that are �in series� so that values entered >>in the first pane are used in a ComboBox in the second and third >>tabs. So when a user selects the second or third tab. I need to fill >>my ComboBox with possible new values from tab 1. >> >>After some testing I found that stateChanged seems to be the Event to >>use. Am I doing right using this event or are there better (more >>appropriate) ways to deal with this? > > > That will work, but an alternative you might consider is creating a > ComboBoxModel derived class and assigning it to the JComboBox instance > you're interested in. With a ComboBoxModel class, the combo box is > automatically updated when the underlying list is updated. That way, > you are no longer dependent on the specific user interface you choose > to implement. >
Technical Details
Message-ID:
<427a1bc2@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!diablo.voicenet.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42796743$1@newsgroups.borland.com> <xn0e1vud81jnfp6001-kdean@www.teamb.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,39af497ef65f112c X-Google-Attributes: gid111d45,public X-Google-Language: ENGLISH,CP1252 Date: Thu, 05 May 2005 09:12:32 -0400 From: Magnus <magnus_bjorkman@iwon.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en, sv MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing Subject: Re: Preferred Event listener for jTabbedPane? References: <42796743$1@newsgroups.borland.com> <xn0e1vud81jnfp6001-kdean@www.teamb.com> In-Reply-To: <xn0e1vud81jnfp6001-kdean@www.teamb.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 67.76.179.221 Message-ID: <427a1bc2@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1115298754 67.76.179.221 (5 May 2005 06:12:34 -0700) Lines: 29 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!diablo.voicenet.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail