Pb with this keyword. [message #16399] |
Thu, 22 January 2004 10:09  |
Eclipse User |
|
|
|
Originally posted by: thierry.doucet.fr.ibm.com
Hello,
I just found a startling thing with VE.
using this code :
import javax.swing.JPanel;
/**
* @author Thierry Doucet
*/
public class VETest extends JPanel {
private javax.swing.JLabel jLabel = null;
/**
* This method initializes
*/
public VETest() {
super();
initialize();
}
/**
* This method initializes this
*/
private void initialize() {
this.add(getJLabel(), null);
}
/**
* This method initializes jLabel
*/
private javax.swing.JLabel getJLabel() {
if(jLabel == null) {
jLabel = new javax.swing.JLabel();
jLabel.setText("Test Label");
}
return jLabel;
}
}
if you put 'this' keyword before using jLabel attribute in getJLabel
method, it seemS VE can'T render correctly the panel.
especially on line:
- "this.jLabel = new javax.swing.JLabel();" : jLabel didn't appear.
- "this.jLabel.setText("Test Label");" : jLabel isn't put in the panel and
jLabel text didn't appear
- "return this.jLabel" or "if(this.jLabel == null) {": jLabel isn't put in
the panel
Thank you for your help
Thierry
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03133 seconds