• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Timer stop method

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got a problem now i cant use sqltimer.stop(); when i press the disconnect button i get an error on eclipse saying sqltimer cannot be resolved
even though its delcared properly it just cant seem to find variable sqltimer :\

 
Sheriff
Posts: 27234
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll need to declare the variable in a scope where it's accessible to any code which needs to use it.
 
sean beacham
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
something like Timer sqltimer; in the main class?

but then when i do an action listener on it what do i do?
 
Paul Clapham
Sheriff
Posts: 27234
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sean beacham wrote:something like Timer sqltimer; in the main class?


I don't know what you mean by "the main class". The variable should be declared at a higher level in the class from which that code was extracted. Quite likely it would have to be an instance variable of the class, since making it a local variable in one method makes it inaccessible from any other method.

but then when i do an action listener on it what do i do?


Sorry, don't understand.
reply
    Bookmark Topic Watch Topic
  • New Topic