Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By Fubarable

Thread: JTabbedPane losing listener

  1. #1
    mendescholl is offline Member
    Join Date
    Feb 2012
    Posts
    1
    Rep Power
    0

    Default JTabbedPane losing listener

    I have a JTabbedPane with 3 tabs and at the end a 'plus' tab (which is used to add in other tabs to the JTabbedPane). When I mouse click the 'plus' tab it adds in a fifth tab at index 3 (i.e. just before the + tab) and brings up a JOptionPane so that I can give a title to the new tab (at index 3). However, if I cancel the JOptionPane before inputting a title, the code

    Java Code:
    JTabbedPane jtp = getITDAJTabbedPane();
    jtp.remove(index);
    should remove the newly inserted tab at index 3 and leave the JTabbedPane in its original state.

    What is actually happening is that the tab at index 3 is indeed being removed but the 'plus' tab no longer responds to mouse clicks to add in a new tab - it is as though the 'plus' tab has lost its ChangeListener.
    Anyone know how to fix this one?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: JTabbedPane losing listener

    I'm not sure how we can guess what's wrong or how to fix it without a functioning code example, but we don't want to see you're entire program either as that would over load the volunteers here with too much code, most of it unrelated to the problem at hand. I suggest that you create and post a new program, a minimal compilable and runnable example with the intent that it just demonstrate the problem and nothing else, an SSCCE.
    DarrylBurke likes this.

Similar Threads

  1. Replies: 2
    Last Post: 12-11-2011, 11:44 PM
  2. Swing Applet losing dirty data
    By ptreves in forum Java Applets
    Replies: 1
    Last Post: 09-25-2011, 04:30 PM
  3. NetBeans losing package information when crashing
    By Kethas in forum New To Java
    Replies: 4
    Last Post: 03-03-2010, 06:38 AM
  4. Losing Packets/Bytes using DataInputStream and socket
    By ajordanneve in forum Networking
    Replies: 0
    Last Post: 03-24-2009, 06:22 AM
  5. Problems with JFrame losing the Design view
    By chris@gaiag.net in forum NetBeans
    Replies: 7
    Last Post: 07-23-2008, 08:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •