1304 Java Media Framework and Java (Geocities web hosting) Sound (on
1304 Java Media Framework and Java Sound (on CD) Chapter 22 209 210 configurePanel.add( volumeSlider ); 211 212 JLabel tempLabel = new JLabel( “tempo” ); 213 configurePanel.add( tempLabel ); 214 215 resolutionSlider = new JSlider( 216 SwingConstants.HORIZONTAL, 1, 10, 1 ); 217 218 // register a ChangeListener slider for change events 219 resolutionSlider.addChangeListener( 220 221 // anonymous inner class to handle tempo slider events 222 new ChangeListener() { 223 224 // change resolution if value changed 225 public void stateChanged( ChangeEvent changeEvent ) 226 { 227 resolution = resolutionSlider.getValue(); 228 } 229 230 } // end ChangeListener 231 232 ); // end call to method addChangeListener 233 234 resolutionSlider.setEnabled( false ); 235 configurePanel.add( resolutionSlider ); 236 237 } // end method makeConfigureControls 238 239 // set up play and save buttons 240 private void makePlaySaveButtons() 241 { 242 playButton = new JButton( “Playback” ); 243 244 // register an ActionListener for playButton events 245 playButton.addActionListener( 246 247 // anonymous inner class to handle playButton event 248 new ActionListener() { 249 250 // playback last recorded MIDI 251 public void actionPerformed( ActionEvent event ) 252 { 253 if ( midiRecord != null ) 254 midiRecord.play(); 255 } 256 257 } // end ActionListener 258 259 ); // end call to method addActionListener 260 Fig. 22.10 MidiDemoprovides the GUI than enables users to interact with the application (part 5 of 14).
If you are in need for cheap and reliable webhost to host your website, we recommend http web server services.