Accessing GUI object methods
I am writing a simple game with Java and Swing. For writing the GUI I use the NetBeans design tool.
In my code I have a custom java.awt.Canvas object named GameCanvas, in a JPanel Form called GamePanel, and I want to call a custom method terminarEstadoInicialin that object. Though, when I try to call it from the Panel NetBeans tells me that it cannot finds that symbol.
Here you see that I instantiated my custom Canvas:
This is the method in the Canvas file I try to call from the Panel file:
And here is the error I get from NetBeans:
Why is that not possible? Is there a way to access my custom Canvas object?