Package java.awt

Examples of java.awt.Button.addActionListener()


        update.setActionCommand(CommonSettingsDialog.UPDATE);
        update.addActionListener(this);
        buttons.add(update);
        Button cancel = new Button(Messages.getString("Cancel")); //$NON-NLS-1$
        cancel.setActionCommand(CommonSettingsDialog.CANCEL);
        cancel.addActionListener(this);
        buttons.add(cancel);

        return buttons;
    }
View Full Code Here


        this.add(scroll, BorderLayout.CENTER);

        // Add a "Close" button.
        Button butClose = new Button(Messages
                .getString("CommonHelpDialog.Close")); //$NON-NLS-1$
        butClose.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                quit();
            }
        });
        this.add(butClose, BorderLayout.SOUTH);
View Full Code Here

        labVersion
                .setText(Messages.getString("MegaMek.Version") + MegaMek.VERSION); //$NON-NLS-1$

        hostB = new Button(Messages.getString("MegaMek.hostNewGame.label")); //$NON-NLS-1$
        hostB.setActionCommand("fileGameNew"); //$NON-NLS-1$
        hostB.addActionListener(actionListener);

        scenB = new Button(Messages.getString("MegaMek.hostScenario.label")); //$NON-NLS-1$
        scenB.setActionCommand("fileGameScenario"); //$NON-NLS-1$
        scenB.addActionListener(actionListener);
View Full Code Here

                .getString("CommonAboutDialog.about")); //$NON-NLS-1$

        // Add a "Close" button.
        Button butClose = new Button(Messages
                .getString("CommonAboutDialog.Close")); //$NON-NLS-1$
        butClose.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                quit();
            }
        });
View Full Code Here

        ta.setText(mechView.getMechReadout());
        final Dialog dialog = new Dialog(clientgui.frame, Messages
                .getString("ChatLounge.quickView"), false); //$NON-NLS-1$
        Button btn = new Button(Messages.getString("Okay")); //$NON-NLS-1$
        dialog.add("South", btn); //$NON-NLS-1$
        btn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(ActionEvent e) {
                dialog.setVisible(false);
            }
        });
        dialog.addWindowListener(new java.awt.event.WindowAdapter() {
View Full Code Here

        setLocation(frame.getLocation().x + frame.getSize().width / 2
                - getSize().width / 2, frame.getLocation().y
                + frame.getSize().height / 2 - getSize().height / 2);

        Button okButton = new Button(Messages.getString("Okay")); //$NON-NLS-1$
        okButton.addActionListener(this);

        add(okButton, BorderLayout.SOUTH);

        while (failedUnits.hasNext()) {
            failedList.add(failedUnits.next());
View Full Code Here

        for (int i = 0; i < mapSettings.getMapHeight(); i++) {
            for (int j = 0; j < mapSettings.getMapWidth(); j++) {
                Button button = new Button(new Integer(i
                        * mapSettings.getMapWidth() + j).toString());
                button.addActionListener(this);
                panMapButtons.add(button);
            }
        }

        scrMapButtons.validate();
View Full Code Here

        Panel butPanel = new Panel();
        butPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
        Button bOkay = new Button(Messages.getString("Okay")); //$NON-NLS-1$
        bOkay.setActionCommand("okay"); //$NON-NLS-1$
        bOkay.addActionListener(this);
        Button bCancel = new Button(Messages.getString("Cancel")); //$NON-NLS-1$
        bCancel.setActionCommand("cancel"); //$NON-NLS-1$
        bCancel.addActionListener(this);
        butPanel.add(bOkay);
        butPanel.add(bCancel);
View Full Code Here

        Button bOkay = new Button(Messages.getString("Okay")); //$NON-NLS-1$
        bOkay.setActionCommand("okay"); //$NON-NLS-1$
        bOkay.addActionListener(this);
        Button bCancel = new Button(Messages.getString("Cancel")); //$NON-NLS-1$
        bCancel.setActionCommand("cancel"); //$NON-NLS-1$
        bCancel.addActionListener(this);
        butPanel.add(bOkay);
        butPanel.add(bCancel);
        add(butPanel, BorderLayout.SOUTH);
        pack();
        setResizable(false);
View Full Code Here

        panConnect.add(hostName);
        panConnect.add(new Label("Port Number:"));
        hostPort = new TextField("2346", 10);
        panConnect.add(hostPort);
        button = new Button("Listen");
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                (new Thread(PacketTool.this, "Packet Reader")).start();
            }
        });
        panConnect.add(button);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.