🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #18505

Removing a JTabbedPane tab and its components

#18505
From: Anne Ritchie
Date: Mon, 15 Jun 1998 00:00
26 lines
1260 bytes
Help....

I'm having a curious problem with the JTabbedPane.  After removing a tab its
component is sometimes still visible and only gets removed by clicking on a
different tab and back.

Using the following code I remove the selected tab.

    int i = jTabbedPane1.getSelectedIndex();
    jTabbedPane1.removeTabAt(i);
    repaint();

When tabs are removed from right to left there is no problem since the index
is decremented and the selected tab's index is different from the removed
tab's index.  When removing a tab from left to right or from the middle, the
tab is removed, but its components are still visible, because the newly
selected tab has the same index as the removed tab...


Anybody resolved this one?

TIA

Anne Ritchie
aritchie@oriental.com
Technical Details
Message-ID: <6m3er5$3rj4@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,9b97d672ba7e6d60,start
X-Google-Attributes: gidf74b3,public
From: "Anne Ritchie" <aritchie@oriental.com>
Subject: Removing a JTabbedPane tab and its components
Date: 1998/06/15
Message-ID: <6m3er5$3rj4@forums.borland.com>
X-Deja-AN: 362852541
X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.language