JLabel reference [message #256531] |
Fri, 16 May 2008 19:32 |
Eclipse User |
|
|
|
Originally posted by: web02.comcast.net
I am a newby to VEP. I got it loaded finally and to play, I added a
jButton and a jLabel to the default pane then created a button click event.
The code and some of the auto generated mouse clicked code looks like:
// Globals
private JPanel jContentPane = null;
private JButton jButton = null;
private JLabel jLabel = null;
.
.
.
// Buried in method private "JButton getJButton()"
public void mouseClicked(java.awt.event.MouseEvent e) {
System.out.println("mouseClicked()"); // TODO Auto-generated Event stub
mouseClicked()
jLabel.text="XXX"; // <-- MY CODE
}
If I try to reference jLabel.text in this method I get an error stating
"jLabel.texr is not visible".
Can someone explain what is happening here. I do not see a scope problem,
but obviously something is happening that I don't understand.
Thanx,
Bill
|
|
|
|
Re: JLabel reference [message #256539 is a reply to message #256535] |
Fri, 16 May 2008 20:53 |
Eclipse User |
|
|
|
Originally posted by: web02.comcast.net
Thanks, I tried it and that error went away. Now, I am getting:
jLabel.setText cannot be resolved or is not a field.
The variable is the correct name. It appears to be in scope.
|
|
|
Re: JLabel reference [message #256547 is a reply to message #256539] |
Fri, 16 May 2008 20:58 |
Eclipse User |
|
|
|
Originally posted by: web02.comcast.net
Thanks for your help. I got it.
For some reason. if I enter "jlabel.", I don't get the available method
list.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.09272 seconds