Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Visual Class Component as local variable
Visual Class Component as local variable [message #125392] Tue, 30 May 2006 06:35 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Visual Class Component as local variable
Next Topic:How to recognize and execute the non-visual methods?
Goto Forum:
  


Current Time: Sat Apr 27 02:44:19 GMT 2024

Powered by FUDForum. Page generated in 0.03224 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top