Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calling method in JFrame from child JPanel

843805Nov 26 2006 — edited Nov 26 2006
Hi 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 24 2006
Added on Nov 26 2006
3 comments
320 views