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
should remove the newly inserted tab at index 3 and leave the JTabbedPane in its original state.
JTabbedPane jtp = getITDAJTabbedPane();
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.