🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #9997

Re: confusing JTabbedPanes

#9997
From: Greg Hamer
Date: Wed, 08 Dec 1999 00:00
36 lines
1682 bytes
It sounds like you are using heavyweight awt components within your
lightweight JTabbedPane. This will cause the heavyweight  components to
appear as if they are on the other tab.
To disable a tab, I had to subclass JTabbedPane like this

JTabbedPane listPanel = new JTabbedPane(){
    public void setSelectedIndex(int index) {
      try {
        fireVetoableChange("selectedIndex", new
Integer(model.getSelectedIndex()),new Integer(index));
        super.setSelectedIndex(index);
      }
      catch (PropertyVetoException e) {}
    }
  };

Then you add a vetoableChange listener to the JTabbedPane, and veto any
changes to the selection that you do not want by throwing a
PropertyVetoException  from the vetoableChange method.

"Mirko K�mpf" wrote:

> I adde two JPanes to a JTabbedPane.
> The view of the JTabbedPane is verry confusing. The
> second Tab is over the first one and you can see
> parts of both tabs.
>
> After I click on the tabs the view is ok.
>
> How can I select the first tab?
>
> Is it possible to disable a Tab in a JTabbedPane?
>
> Thanks for your help.
>
> Mirko K�mpf
Technical Details
Message-ID: <384F0407.C772D510@borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <82ktbo$8s47@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 111d45,696d1fdfa36ce774
X-Google-Attributes: gid111d45,public
From: Greg Hamer <ghamer@borland.com>
Subject: Re: confusing JTabbedPanes
Date: 1999/12/08
Message-ID: <384F0407.C772D510@borland.com>
X-Deja-AN: 558377497
Content-Transfer-Encoding: 8bit
References: <82ktbo$8s47@forums.borland.com>
X-Accept-Language: en
Content-Type: text/plain; charset=iso-8859-1
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing