Package java.awt

Examples of java.awt.Button.addActionListener()


            });

            Button subdlg = new Button("SubDialog");
            p.add(subdlg);

            subdlg.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    DialogWindow sw = new DialogWindow(parent);
                    sw.setVisible(true);
                }
            });
View Full Code Here


            cursorCanvas.setSize(80, 80);

            add(cursorCanvas, "Center");

            Button cb = new Button("Close");
            cb.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    dispose();
                }
            });
View Full Code Here

            sensitive.addItemListener(this);

            add(p, "Center");

            Button cb = new Button("Close");
            cb.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    dispose();
                }
            });
View Full Code Here

            p.add(new Label("right justified label", Label.RIGHT));

            add(p, "Center");

            Button cb = new Button("Close");
            cb.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    dispose();
                }
            });
View Full Code Here

        Menu m = new Menu("Menu " + (menuList.size() + 1));
        menuList.add(m);
        mb.add(m);

        Button addMenu = new Button("Add menu");
        addMenu.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                Menu m = new Menu("Menu " + (menuList.size() + 1));
                menuList.add(m);
                mb.add(m);
            }
View Full Code Here

                }
            }
        });
        f.add(addMenu, BorderLayout.NORTH);
        Button addItem = new Button("Add item");
        addItem.addActionListener(new ActionListener() {
            int cnt = 1;

            public void actionPerformed(ActionEvent event) {
                for (Menu m : menuList) {
                    m.add(new MenuItem("Item " + cnt));
View Full Code Here

                cnt++;
            }
        });
        f.add(addItem, BorderLayout.WEST);
        Button addSeparator = new Button("Add separator");
        addSeparator.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                for (Menu m : menuList) {
                    m.addSeparator();
                }
                popup.addSeparator();
View Full Code Here

                popup.addSeparator();
            }
        });
        f.add(addSeparator, BorderLayout.EAST);
        Button removeItem = new Button("Remove item");
        removeItem.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                for (Menu m : menuList) {
                    if (m.getItemCount() > 0)
                        m.remove(0);
                }
View Full Code Here

     */
    public DialogTest(String title) {
        super(new Frame(), title);
        setModal(true);
        final Button ok = new Button("Ok");
        ok.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                DialogTest.this.dispose();
            }

        });
View Full Code Here

                System.exit(0);
            }
        };

        Button show = new Button("show");
        show.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                f2.setVisible(true);
            }
        });
        //f.add(show);
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.