Results 1 to 2 of 2
- 02-03-2012, 03:20 AM #1Member
- Join Date
- Feb 2012
- Rep Power
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
JTabbedPane jtp = getITDAJTabbedPane(); jtp.remove(index);
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?
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.
- By Kevinw778 in forum AWT / SwingReplies: 2Last Post: 12-11-2011, 11:44 PM
- By ptreves in forum Java AppletsReplies: 1Last Post: 09-25-2011, 03:30 PM
- By Kethas in forum New To JavaReplies: 4Last Post: 03-03-2010, 06:38 AM
- By ajordanneve in forum NetworkingReplies: 0Last Post: 03-24-2009, 06:22 AM
- By email@example.com in forum NetBeansReplies: 7Last Post: 07-23-2008, 07:35 AM