Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JBUtton errors(Cant resolve symbol)  RSS feed

 
kimi lynn
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,
I've an interface with couple of buttons which has the functionality to start and stop the matlab engine.The code is working pretty good.So when i press the start,the matlab engine starts and I press stop button to stop the engine.when I press the stop button before pressing the start, I see some errors in my command promtp.I deicided to disable the stop button and declared start and stop button on class level.
Now, I get the errors, cannot resolve symbols at different lines:symbol-variable start and stop.
Could somebody please tell me how can i fix them.
Thanks for your time.

[ October 30, 2003: Message edited by: kimi lynn ]
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"start" and "stop" are local variables declared in the MatlabRC constructor. That means they're not available to any other methods. They need to be member variables -- i.e., declared at the top level of the class.
 
kimi lynn
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
Thanks for your response.I corrected them and I dont see any errors now.But unfortunately, I dont see it working how i actually wanted to.
Before, if i press start and then stop it worked and now it does'nt.What exactly, am trying to do is the stop button shld'nt be able to submit by the user with out submitting the start button.
Any ideas??
I edited my code in my previous post.
Thanks for your time.
 
Jian Zhang
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, I can't see the point why you have to declare it as the instance variables first and redefine it again in the constructor. start = new JButton("Start") is enough for the instantiation I think. So any change to it will synchronize. :roll:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!