Article View: borland.public.jbuilder.java.language
Article #16769adding components with a function
From: Daniel R. J. Lind
Date: Tue, 19 Jan 1999 00:00
Date: Tue, 19 Jan 1999 00:00
25 lines
1358 bytes
1358 bytes
Hi,
Thanks to the guys who replied to my two earlier posts. I have tried to
implement what you suggested but it's not working. Here is the code I
tried:
void jButton1_actionPerformed(ActionEvent e) {
int z = jSlider1.getValue();
for (int x = 0; x < z; x++){
String tabNumber = String.valueOf(x);
String tabName = "newPanel" + tabNumber;
javax.swing.JPanel tabName = new javax.swing.JPanel();
jTabbedPane1.addTab("tabTitle", null, tabName, null);
}
}
Can you see what I am trying to do? I want each tab to have a unique
identity that I can reference later. I'm after a proper object orientated
solution. I want to be able to create a tab with it's name and title as
parameters that I can pass to it. I attached it here to a button action so
I could test it but I really need a new class.
Thanks for your help,
Daniel
Technical Details
Message-ID:
<780uhe$aq55@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,de56a2e57de1717,start X-Google-Attributes: gidf74b3,public From: "Daniel R. J. Lind" <daniel@synopsys.co.nz> Subject: adding components with a function Date: 1999/01/19 Message-ID: <780uhe$aq55@forums.borland.com> X-Deja-AN: 434271006 Organization: Another Netscape Collabra Server User X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: borland.public.jbuilder.java.language