Join Patrick Royal for an in-depth discussion in this video Solution overview, part of Code Clinic: Java.
- View Offline
- Exercise Files
- My solution to this code clinic,…is a Java project consisting of three files.…Main, MouseChecker, and MouseMusic.…Before we go into detail about what they contain,…let's run the application and see what happens.…Open the main .java file, and click run.…This will bring up a blank frame…that covers the entire screen.…If I put my mouse cursor within the frame…and press the button, then a sound will play.…(piano sound)…Moving the cursor up and down changes the pitch of the sound…while moving it left and right changes the volume.…
(varying piano sounds)…When I let go of the mouse button, the sound stops.…With this set up, we have all the functionality…required by the clinic's problem statement.…Now let's dig in to the actual code…and see how this is created.…I think the easiest way to look at this code…is to follow the path of how it will actually execute.…When the application is run, it calls the main thread,…which immediately starts MouseChecker as a thread.…
Why does it need to be in a separate thread?…Well, as we'll see later, this program requires…
Patrick introduces challenges and provide an overview of his solutions in Java. Challenges include topics such as statistical analysis, searching directories for images, and accessing peripheral devices.
Visit other courses in the series to see how to solve the exact same challenges in languages like C#, C++, PHP, Python, and Ruby.
Skill Level Intermediate
Problem One: Exploring Lake Pend Oreille
Problem Two: Image Analysis
Problem Three: Eight Queens
Problem Four: Accessing Peripherals
Problem Five: Recursion and Directories
Problem Six: Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.