Article View: borland.public.jbuilder.java.swing
Article #897Re: Determining source of state change
From: Lori M Olson [TeamB]
Date: Fri, 12 Nov 2004 18:12
Date: Fri, 12 Nov 2004 18:12
40 lines
2292 bytes
2292 bytes
user@domain.invalid wrote:
> Hello folks,
>
> I have a question regarding JTabbedPane behaviour.
>
> "Inside stateChanged() event handler, how can we know what caused
> the state change?"
>
> getTabCount() call INSIDE the handler reports the number BEFORE
> the tab addition (and removal, too?). For a tab click, the numbers
> (ie before and after the click) are the same, of course. Therefore
> we cannot determine which of addTab(), removeTabAt() or clicking a
> different tab is causing the event this way.
>
> Also the passed ChangeEvent object does not tell what change was
> the cause.
>
> Your help is greatly appreciated...
Have you examined the event's source (event.getSource())?
--
Regards,
Lori Olson [TeamB]
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
http://www.google.ca/advanced_group_search
Other Newsgroup Searches:
http://www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
http://www.visi.com/~gyles19/fom-serve/cache/1.html
Technical Details
Message-ID:
<4194fcf7$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!newsprint.newsread.com!63.218.45.10.MISMATCH!newshosting.com!nx01.iad01.newshosting.com!news-peer0-test!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<419458bd@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,17138179779c2337,start X-Google-Attributes: gid111d45,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Fri, 12 Nov 2004 11:12:08 -0700 From: "Lori M Olson [TeamB]" <javadragon@techie.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax; CDonDemand-Dom) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing Subject: Re: Determining source of state change References: <419458bd@newsgroups.borland.com> In-Reply-To: <419458bd@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 142.179.181.200 Message-ID: <4194fcf7$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1100283127 142.179.181.200 (12 Nov 2004 10:12:07 -0700) Lines: 41 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!newsprint.newsread.com!63.218.45.10.MISMATCH!newshosting.com!nx01.iad01.newshosting.com!news-peer0-test!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail