|
-
October 7th, 2011, 07:51 PM
#1
Newb with (probably) a fundamental misunderstanding
Hi all, I'm new to Java, and to programming in general, but in an attempt to learn, I am trying to create some programs, but have run into an issue...
So, let me just dive right in to my problem...
I have three classes:
TimerPanel which extends JPanel, and contains methods to start and stop the timer
InputPanel which extends JPanel, and accepts user input
And my main which contains the instances of, and displays both of these panels
I have created instances of TimerPanel and InputPanel in a JFrame in my main.
My problem is that I wish to call the start and stop timer methods on the specific instance of TimerPanel which resides in my main FROM my InputPanel.
I have googled for a couple hours for a solution to this problem, but I cannot figure it out. So far, I have gathered that I must reference the specific instance of my TimerPanel object within my InputPanel, but I cannot figure out how to do this...perhaps because of a fundamental flaw in my design or understanding? Please educate me. Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|