Calling method in JFrame from child JPanel
843805Nov 26 2006 — edited Nov 26 2006Hi guys,
I have written a custom JFrame class initialized from Main.java upon load.
Within the JFrame class (GUI.java), i have created a few methods (get & set stuff).
When a button is clicked in the JFrame, GUI.java adds a custom JPanel to the JFrame.
The problem i'm having, is how to reference the methods in the JFrame from within the JPanel, since the Panel doesn't "know" the name of the Frame.
Basically when a button on the panel is pressed, i want to call a method in the JFrame, but i have no idea how to "Get to it".
Any help would be much appreciated.
-Mark