Article View: borland.public.jbuilder.java.swing
Article #8347Corrupted JTabbedPane display
From: Arie van Wingerden
Date: Sat, 23 Sep 2000 00:00
Date: Sat, 23 Sep 2000 00:00
43 lines
2013 bytes
2013 bytes
Hello gurus,
I've got a problem and hope ther is somebody out there who can help me.
I've got a JTabbedPane (named jTabbedPane1) with 4 TABs. Every TAB
contains a Jpanel.
In the last JPanel I defined (using GridLayout 1,3 ) 2 other JPanels and a
CheckBoxPanel (see my class definition below).
If I run my applet and SelectedIndex() has been set to a TAB different from
the one containing my CheckBoxPanel class,
my Radiobuttons (instantiated in my class) "overlay" the JPanel display of a
different TAB.
If I click on other TABs, the same problem occurs. However, the problem
disappears as soon as I have clicked once one the TAB containing my
CheckBoxPanel class. Clicking other TABs afterwards results in correct
displays.
If I set the SelectedIndex() in the applet's Init(0 code right away to the
TAB containing class CheckBoxPanel, Then the problem doesn't show up.
However, I need to open the applet with another TAB!!
class CheckBoxPanel extends JPanel {
CheckboxGroup CGroup;
Checkbox[] check;
CheckBoxPanel(Vector name) {
CGroup = new CheckboxGroup();
check = new Checkbox[name.size()];
setBackground(Color.white);
setForeground(Color.black);
for (int i=0; i < name.size(); i++) {
check[i] = new Checkbox((String)name.get(i), CGroup, false);
check[i].setFont(new java.awt.Font("Monospaced", 0, 12));
check[i].setBackground(Color.white);
check[i].setForeground(Color.black);
add(check[i]);
}
check[0].setState(true);
}
}
Thanks in advance,
Arie.
Technical Details
Message-ID:
<OHzxGlWJAHA.254@net025s>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,66c81aad297eb472,start X-Google-Attributes: gid111d45,public From: "Arie van Wingerden" <awing@hetnet.nl> Subject: Corrupted JTabbedPane display Date: 2000/09/23 Message-ID: <OHzxGlWJAHA.254@net025s> X-Deja-AN: 673215494 X-MSMail-Priority: Normal X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Newsgroups: borland.public.jbuilder.java.swing