The first tutorial looked at the application without any GUI code, in this tutorial some simple start and stop buttons are displayed in a window frame, then in the next tutorial sliders are added to control tempo and volume, next the GUI is done as an applet for use in a web browser, and finally the GUI is rewritten using Java's Swing GUI library. One of the strengths of Java programming is its platform independence. The awt classes allow you to specify a graphical user interface with windows, buttons, sliders, and so on and each of the Java implementaions takes care of applying those to the host platform. This means that GUIs written in awt take on the appearance of Microsoft Windows components when run under Windows, and on a MAc look like a native Mac application, and so on. Click here to view the source.
Lets have a closer look.
In order to have real time playback of our drum patterns we will use classes in jMusic's qt package, so it is also imported. In the constructor all the GUI setup work is done. A Panel is an awt class than is a blank area on which other componenrts can be put. A Panel instance called transport is created. Each button instance is added to the panel.