List of usage examples for java.awt.event ActionEvent getSource
public Object getSource()
From source file:musiccrawler.App.java
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() instanceof JRadioButton) { JRadioButton source = (JRadioButton) e.getSource(); switch (source.getActionCommand()) { case QUERY_ALL_ACTION: break; case QUERY_OPTION: configVisibleFrameQuery(true); break; }//from w w w. java 2 s . co m } }
From source file:TextSamplerDemo.java
public void actionPerformed(ActionEvent e) { String prefix = "You typed \""; if (textFieldString.equals(e.getActionCommand())) { JTextField source = (JTextField) e.getSource(); actionLabel.setText(prefix + source.getText() + "\""); } else if (passwordFieldString.equals(e.getActionCommand())) { JPasswordField source = (JPasswordField) e.getSource(); actionLabel.setText(prefix + new String(source.getPassword()) + "\""); } else if (buttonString.equals(e.getActionCommand())) { Toolkit.getDefaultToolkit().beep(); }//from w w w . j ava2 s.c o m }
From source file:org.yccheok.jstock.gui.SellPortfolioChartJDialog.java
private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed String selected = ((javax.swing.JComboBox) evt.getSource()).getSelectedItem().toString(); final int selectedIndex = ((javax.swing.JComboBox) evt.getSource()).getSelectedIndex(); JStock.instance().getJStockOptions().setLastSelectedSellPortfolioChartIndex(selectedIndex); final JFreeChart freeChart = this.createChart(selected); org.yccheok.jstock.charting.Utils.applyChartTheme(freeChart); chartPanel.setChart(freeChart);// ww w . ja v a2 s . com }
From source file:com.orange.atk.graphAnalyser.RealtimeGraph.java
public void addUrlMarkerCheckBox() { urlMarkersCheckBox = new JCheckBox("Display Url markers"); urlMarkersCheckBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { boolean selected = ((JCheckBox) e.getSource()).isSelected(); JaTKCharts.displayUrlMarkers(selected); }/*from w w w. j a v a 2 s . c o m*/ }); toolPane.add(urlMarkersCheckBox); urlMarkersCheckBox.setSelected(true); toolPane.invalidate(); }
From source file:com.raphfrk.craftproxyclient.gui.CraftProxyGUI.java
public void actionPerformed(ActionEvent action) { if (action.getSource().equals(connect)) { if (action.getActionCommand().equals("Start")) { startProxyServer();//from w w w .j a va2s . c om } else if (action.getActionCommand().equals("Stop")) { connectionListener.interrupt(); connect.setText("Stopping"); setStatus("Halting proxy server"); } else if (action.getActionCommand().equals("Stopping")) { JOptionPane.showMessageDialog(CraftProxyGUI.this, "Server halt is in progress", "Error", JOptionPane.ERROR_MESSAGE); } } }
From source file:de.unibayreuth.bayeos.goat.options.JOptionDialog.java
private void jCheckBoxToolTipsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxToolTipsActionPerformed JCheckBox s = (JCheckBox) evt.getSource(); pref.putBoolean("charttooltips", s.isSelected()); }
From source file:deodex.ui.about.CheckUpdatePan.java
@Override public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if (e.getSource().equals(checkForUpdate)) { new UpdateFetcher().start(); // getThis().remove(progress); } else if (e.getSource().equals(openDownloadpage)) { DesktopUtils.openWebpage(downloadPage); } else if (e.getSource().equals(this.downloadNewVersion)) { new DownloadnewVersion().start(); }//from ww w . j a v a 2 s . c o m }
From source file:appInterface.AppFrame.java
/** * */// w w w . ja v a 2 s . c om @Override public void actionPerformed(ActionEvent evt) { String moduleChanged = getModuleAsKey(); int nextQuestion = _questionArea.getCurrentQuestion() + 1; int previousQuestion = _questionArea.getCurrentQuestion() - 1; if (evt.getSource() == _mainToolBar.randomButton) { // Need to disable the ActionListener to not call initQuestion twice this._mainToolBar.moduleComboBox.removeActionListener(this); chooseRandomQuestion(); this._mainToolBar.moduleComboBox.addActionListener(this); } else if (evt.getSource() == _botToolBar.nextButton) { initQuestion(moduleChanged, nextQuestion); } else if (evt.getSource() == _botToolBar.previousButton) { initQuestion(moduleChanged, previousQuestion); } else if (evt.getSource() == _mainToolBar.moduleComboBox) { initQuestion(moduleChanged, 0); } }
From source file:com.intuit.tank.tools.debugger.FindReplaceDialog.java
public void actionPerformed(ActionEvent evt) { Object source = evt.getSource(); if (source == btnCancel) { setVisible(false);//from www . j a v a 2 s .co m } else if (source == btnFind) { doFind(); } else if (source == btnReplace) { doReplace(); } else if (source == btnReplaceAll) { doReplaceAll(); } }
From source file:PrintCanvas3D.java
public void actionPerformed(ActionEvent event) { Object target = event.getSource(); if (target == printItem) { new ImagePrinter(bImage).print(); } else if (target == closeItem) { this.removeAll(); this.setVisible(false); bImage = null;/*w ww.j a va 2 s . co m*/ } }