Your main
method is static, therefore, you cannot access non-static variables. If you don't want static
on your Key
object, then do the following:
1) Make a constructor for your ClickBot
class
2) Initialize keyObject in it
2) In your main
method create an instance of ClickBot
3) Make a new method in your ClickBot
class (public void methodName()
)
4) Put all your further code in it
5) Call clickBotObject.methodName()
in your main
method.
Otherwise, if static
on your Key
object is alright with you, then just add static
on it.
Or, make it a local variable in your main
method if that's alright with you.