Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.33 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Returning a JButtons action listener so another class can use it
  2. public JButton button() {
  3.     return button;
  4. }
  5.        
  6. buttonClass.button().addActionListener(new buttonActionListener());
  7.  
  8. public class buttonActionListener implements ActionListener {
  9.     public void actionPerformed(ActionEvent e) {
  10.        //local method calls
  11.     }
  12. }