File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Swing ChangeEvent occur twice

 
albert kao
Ranch Hand
Posts: 252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The existing source codes, which I try to debug, create the MyTabbedPane class from JTabbedPane.
Clicking the tab will generate the ChangeEvent twice inside the addChangeListener.
Why? Is that to make the ChangeEvent occur once only?


2011-10-11 09:02:00,211 DEBUG Langclient.modules.findPanel - addChangeListener index 1
2011-10-11 09:02:00,211 DEBUG Langclient.modules.findPanel - tabsCurrentIndex 1
2011-10-11 09:02:00,211 DEBUG Langclient.modules.findPanel - addChangeListener index 1
2011-10-11 09:02:00,227 DEBUG Langclient.modules.findPanel - tabsCurrentIndex 1
 
Rob Spoor
Sheriff
Pie
Posts: 20396
47
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure that you haven't added your change listeners twice? I created a little SSCCE and I only get one event.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic