Visual Class Component as local variable [message #125392] |
Tue, 30 May 2006 06:35 |
Eclipse User |
|
|
|
Originally posted by: arivera.ucentral.cl
I want to know if I can set as local variable a component inserted from
the control palette. For example a JSeparator, is not necesary to be
declared as a field of my class or a JLabel, ...
Example:
Visual Editor generates this code
import...
public class MyFrame extends JFrame {
private JPanel jPanel1 = null;
private JLabel jLabel1 = null;
private JSeparator jSeparator = null;
//...
JPanel getJPanel1() {
if ()//...
jPanel1.add(getJLabel1());
//..
}
private JLabel getJLabel1() {
//...
}
}
while i would like something like this...
public class MyFrame extends JFrame {
private JPanel jPanel1 = null;
//...
JPanel getJPanel1() {
if ()//...
JLabel jLabel1 = new JLabel("Label text"); // JLabel1 is local
jPanel1.add(jLabel1);
//..
}
}
there is any option to do that? or I have to do it manually
|
|
|
Re: Visual Class Component as local variable [message #125418 is a reply to message #125392] |
Tue, 30 May 2006 15:04 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
There's no automatic way to do it. We at one point in time did that
because we thought it made sense that labels aren't referenced after
creation. But we got too many complaints and had to move it back out. :-(
We will recognize it if you did it manually.
--
Thanks,
Rich Kulp
|
|
|
Re: Visual Class Component as local variable [message #612983 is a reply to message #125392] |
Tue, 30 May 2006 15:04 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
There's no automatic way to do it. We at one point in time did that
because we thought it made sense that labels aren't referenced after
creation. But we got too many complaints and had to move it back out. :-(
We will recognize it if you did it manually.
--
Thanks,
Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.03224 seconds