Hello all =)
Well I'm continuing my trek through the wonderful world of java and have run into another question. Currently I'm learning the concepts between the use of nested and external classes. Basically what I have right now is a working java file (it's an applet) that when run, will show a little happy face bouncing around the applet. There is a method that listens for a mouse click on the applet to stop the face from running around and again to start it back up. What I'm trying to do is take that nested method (called ReboundMouseListener) and turn it into an external class to be called upon by the original file. I think I almost have it figured out, but the driver file seems to run into a couple errors while compiling (one of them having to do with trying to import the external class). Can anyone take a look and tell me what exactly I'm doing wrong? Links to the code follows below.
Thanks!
Jisoo22
Original program:
Happy Face GIF:
New program:
External Class:
Well I'm continuing my trek through the wonderful world of java and have run into another question. Currently I'm learning the concepts between the use of nested and external classes. Basically what I have right now is a working java file (it's an applet) that when run, will show a little happy face bouncing around the applet. There is a method that listens for a mouse click on the applet to stop the face from running around and again to start it back up. What I'm trying to do is take that nested method (called ReboundMouseListener) and turn it into an external class to be called upon by the original file. I think I almost have it figured out, but the driver file seems to run into a couple errors while compiling (one of them having to do with trying to import the external class). Can anyone take a look and tell me what exactly I'm doing wrong? Links to the code follows below.
Thanks!
Jisoo22
Original program:
Happy Face GIF:
New program:
External Class: