private void initCancelButton() { widgets.cancelButton = new JButton("Cancel"); widgets.cancelButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { widgets.window.dispose(); } }); }
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(); } }); }
private void initEnableSpotifyCheckbox() { widgets.enableSpotifyCheckbox = new JCheckBox("Enable Spotify Streaming", preferences.isSpotifyEnabled()); }
private void initEnablePandoraCheckbox() { widgets.enablePandoraCheckbox = new JCheckBox("Enable Pandora Streaming", preferences.isPandoraEnabled()); }
private void initEnableMuseControlCheckbox() { widgets.enableMuseControlCheckbox = new JCheckBox("Enable Web Services for Muse Control", preferences.isMuseControlEnabled()); }
private void initWindow() { widgets.window = new JFrame("Preferences"); }