Package javax.swing

Examples of javax.swing.JToggleButton.addActionListener()


        toolBar_1.setAlignmentX( Component.LEFT_ALIGNMENT );
        contentPane.add( toolBar_1 );

        JToggleButton newFrame = new JToggleButton( "New Window" );
        toolBar_1.add( newFrame );
        newFrame.addActionListener( new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                TextAdventure.createFrame( gameEngine,
                                           JFrame.DISPOSE_ON_CLOSE );
            }
        } );
View Full Code Here


        parent.add( cmdTextField,
                    "growx, spanx 3, wrap" );
        JToggleButton sendBtn = new JToggleButton( "send" );
        parent.add( sendBtn );

        sendBtn.addActionListener( new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                //msg.setContent( cmd );
                gameEngine.receiveMessage( session,
                                           cmd );
                cmd = null;
View Full Code Here

        toolbar.add(new JLabel("Zoom:"));
        toolbar.addSeparator();

        JToggleButton tbutton = new JToggleButton("h", hZoom);
        tbutton.setActionCommand(ZOOM_H);
        tbutton.addActionListener(this);
        toolbar.add(tbutton);

        tbutton = new JToggleButton("v", vZoom);
        tbutton.setActionCommand(ZOOM_V);
        tbutton.addActionListener(this);
View Full Code Here

        tbutton.addActionListener(this);
        toolbar.add(tbutton);

        tbutton = new JToggleButton("v", vZoom);
        tbutton.setActionCommand(ZOOM_V);
        tbutton.addActionListener(this);
        toolbar.add(tbutton);
        toolbar.addSeparator();

        tbutton = new JToggleButton("in", zoomIn);
        tbutton.setActionCommand(ZOOM_IN);
View Full Code Here

        toolbar.add(tbutton);
        toolbar.addSeparator();

        tbutton = new JToggleButton("in", zoomIn);
        tbutton.setActionCommand(ZOOM_IN);
        tbutton.addActionListener(this);
        toolbar.add(tbutton);
        button_zoom_in = tbutton;

        tbutton = new JToggleButton("out", !zoomIn);
        tbutton.setActionCommand(ZOOM_OUT);
View Full Code Here

        toolbar.add(tbutton);
        button_zoom_in = tbutton;

        tbutton = new JToggleButton("out", !zoomIn);
        tbutton.setActionCommand(ZOOM_OUT);
        tbutton.addActionListener(this);
        toolbar.add(tbutton);
        button_zoom_out = tbutton;
        toolbar.addSeparator();

        JButton button = new JButton("reset");
View Full Code Here

    JToggleButton button = new JToggleButton(
      IconLoader.getInstance().getIcon(getResourceString(prefix + ".icon")));
    button.setMargin(new Insets(1, 1, 1, 1));
    String command = getResourceString(prefix + ".command");
    button.setActionCommand(command);
    button.addActionListener(this);
    toolbar.add(button);
    button.setToolTipText(getResourceString(prefix + ".tooltip"));
    buttonMap.put(AppCommand.getCommand(command), button);
    if (aButtonGroup != null) {
      aButtonGroup.add(button);
View Full Code Here

    JToggleButton button = new JToggleButton(
      IconLoader.getInstance().getIcon(getResourceString(prefix + ".icon")));
    button.setMargin(new Insets(1, 1, 1, 1));
    String command = getResourceString(prefix + ".command");
    button.setActionCommand(command);
    button.addActionListener(this);
    toolbar.add(button);
    button.setToolTipText(getResourceString(prefix + ".tooltip"));
    buttonMap.put(AppCommand.getCommand(command), button);
    if (aButtonGroup != null) {
      aButtonGroup.add(button);
View Full Code Here

                      ImageIcon thisImage = new ImageIcon(id.getValue());
                      JToggleButton thisButton = new JToggleButton(PaletteList.this.makeTransparentIcon(thisImage));
                      thisButton.setPreferredSize(imageSize);
                      thisButton.setMinimumSize(imageSize);
                      thisButton.setMaximumSize(imageSize);
                      thisButton.addActionListener(new ActionListener() {
                          public void actionPerformed(ActionEvent arg0) {
                              PaletteList.this.actionChange(arg0);
                          }
                      });
                      buttons.add(thisButton);
View Full Code Here

                      ImageIcon thisImage = new ImageIcon(id.getValue());
                      JToggleButton thisButton = new JToggleButton(PaletteList.this.makeTransparentIcon(thisImage));
                      thisButton.setPreferredSize(imageSize);
                      thisButton.setMinimumSize(imageSize);
                      thisButton.setMaximumSize(imageSize);
                      thisButton.addActionListener(new ActionListener() {
                          public void actionPerformed(ActionEvent arg0) {
                              PaletteList.this.actionChange(arg0);
                          }
                      });
                      buttons.add(thisButton);
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.