コード例 #1
0
 private void initCancelButton() {
   widgets.cancelButton = new JButton("Cancel");
   widgets.cancelButton.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent actionEvent) {
           widgets.window.dispose();
         }
       });
 }
コード例 #2
0
 private void initSaveButton() {
   widgets.saveButton = new JButton("OK");
   widgets.saveButton.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent actionEvent) {
           preferences.enablePandora(widgets.enablePandoraCheckbox.isSelected());
           preferences.enableSpotify(widgets.enableSpotifyCheckbox.isSelected());
           preferences.enableMuseControl(widgets.enableMuseControlCheckbox.isSelected());
           try {
             preferences.save();
           } catch (BackingStoreException e) {
             JOptionPane.showMessageDialog(
                 widgets.window, "Unable to Save Preferences", "Error", JOptionPane.ERROR_MESSAGE);
           }
           widgets.window.dispose();
         }
       });
 }
コード例 #3
0
 private void initEnableSpotifyCheckbox() {
   widgets.enableSpotifyCheckbox =
       new JCheckBox("Enable Spotify Streaming", preferences.isSpotifyEnabled());
 }
コード例 #4
0
 private void initEnablePandoraCheckbox() {
   widgets.enablePandoraCheckbox =
       new JCheckBox("Enable Pandora Streaming", preferences.isPandoraEnabled());
 }
コード例 #5
0
 private void initEnableMuseControlCheckbox() {
   widgets.enableMuseControlCheckbox =
       new JCheckBox("Enable Web Services for Muse Control", preferences.isMuseControlEnabled());
 }
コード例 #6
0
 private void initWindow() {
   widgets.window = new JFrame("Preferences");
 }