[Solved] The static method…should be accessed in a static way [closed]

You are calling your methods correctly (from logical point of view) but apparently you have declared them incorrectly (as static). Make them instance methods by removing the static modifier. That should fix your problem. And learn the the difference between static and instance methods (seems you haven’t quite yet). In particular getName and setName should … Read more

[Solved] Java never declares access level of variables in methods whether static or not [closed]

Because it doesn’t make sense. Variables declared in a method are local to the method; i.e. they can’t be accessed outside the method. Why and how could these variables be modified outside the method? Code outside the method doesn’t even know of them, so you don’t need to protect them from outside code. solved Java … Read more

[Solved] size() command not working when containing method is run within a static method [closed]

If you want the size() method to resize your window you need a least to declare one. I suggest you replace void setup(){ size(500,500); } with void setup(){ JFrame myFrame = new JFrame(); myFrame.setSize(500,500); myFrame.setVisible(true); } 2 solved size() command not working when containing method is run within a static method [closed]