Skip to main content



      Home
Home » Archived » Visual Editor (VE) » Visual Class Component as local variable
Visual Class Component as local variable [message #612978] Tue, 30 May 2006 02:35
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
Previous Topic:V.E not writing the code returned by property editor --urgent :please help its
Next Topic:Visual Class Component as local variable
Goto Forum:
  


Current Time: Wed Jun 18 16:57:24 EDT 2025

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

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

Back to the top