Example usage for java.awt.event ActionListener interface-usage

List of usage examples for java.awt.event ActionListener interface-usage

Introduction

In this page you can find the example usage for java.awt.event ActionListener interface-usage.

Usage

From source file ButtonListener.java

class ButtonListener implements ActionListener {
    public void actionPerformed(ActionEvent ae) {
        Toolkit.getDefaultToolkit().beep();

    }
}

From source file TryCardLayout.java

public class TryCardLayout extends JPanel implements ActionListener {
    CardLayout card = new CardLayout(50, 50); // Create layout

    public TryCardLayout() {
        setLayout(card);
        JButton button;

From source file ButtonDemo.java

class ButtonDemo implements ActionListener {
    JButton jbtnA = new JButton("Alpha");
    JButton jbtnB = new JButton("Beta");

    ButtonDemo() {
        JFrame jfrm = new JFrame("A Button Example");

From source file MyActionListener.java

class MyActionListener implements ActionListener {
    public void actionPerformed(ActionEvent e) {
        JButton source = (JButton) e.getSource();
        String buttonText = source.getText();
        JOptionPane.showMessageDialog(null, "You clicked" + buttonText);
    }

From source file MyActionListener.java

class MyActionListener implements ActionListener {
    public void actionPerformed(ActionEvent e) {
        JButton source = (JButton) e.getSource();
        String buttonText = source.getText();
        JOptionPane.showMessageDialog(null, "You clicked" + buttonText);
    }

From source file ActionFocusMover.java

class ActionFocusMover implements ActionListener {
    public void actionPerformed(ActionEvent actionEvent) {
        KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
        manager.focusNextComponent();
    }
}

From source file Main.java

public class Main implements Runnable, ActionListener {
    private boolean animate;

    private Cursor[] cursors = new Cursor[] { Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR),
            Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR) };

From source file Main.java

public class Main extends JFrame implements ActionListener {
    JTable table;
    JButton button;

    public Main() {
        String[] colNames = { "Subject", "Value" };

From source file Main.java

public class Main extends JDialog implements ActionListener {
    private javax.swing.JButton testButton;

    public Main() {
        setPreferredSize(new Dimension(640, 480));
        getContentPane().setLayout(new BorderLayout());

From source file org.jfree.chart.demo.Rotator.java

class Rotator extends Timer implements ActionListener {

    private static final long serialVersionUID = 1L;

    private PiePlot3D plot;
    private int angle;