Package javax.swing

Examples of javax.swing.JToggleButton.addActionListener()


          LogicConstants.getIcon("capas_button_"
              + layer.name.toLowerCase()), layer.visible);
      // b.setVerticalTextPosition(SwingConstants.BOTTOM);
      // b.setHorizontalTextPosition(SwingConstants.CENTER);
      b.setActionCommand(layer.name);
      b.addActionListener(layerControlListener);
      layerControls.add(b);
      layerControlPanel.removeAll();
      layerControlPanel.add(Box.createHorizontalStrut(10));
      for (JToggleButton bt : layerControls) {
        layerControlPanel.add(bt);
View Full Code Here


      JToggleButton b = new JToggleButton(layer.name,
          LogicConstants.getIcon(icon), layer.visible);
      // b.setVerticalTextPosition(SwingConstants.BOTTOM);
      // b.setHorizontalTextPosition(SwingConstants.CENTER);
      b.setActionCommand(layer.name);
      b.addActionListener(layerControlListener);
      layerControls.add(b);
      layerControlPanel.removeAll();
      layerControlPanel.add(Box.createHorizontalStrut(10));
      for (JToggleButton bt : layerControls) {
        layerControlPanel.add(bt);
View Full Code Here

        for (SchemaTypeConstraint constraint : constraints) {
            jtbAttributes.addActionListener(new SchemaTypeConstraintActionListener(constraint, XSConstants.ATTRIBUTE_DECLARATION));
            jtbComplexTypes.addActionListener(new SchemaTypeConstraintActionListener(constraint, XSTypeDefinition.COMPLEX_TYPE));
            jtbElements.addActionListener(new SchemaTypeConstraintActionListener(constraint, XSConstants.ELEMENT_DECLARATION));
            jtbModelGroups.addActionListener(new SchemaTypeConstraintActionListener(constraint, XSConstants.MODEL_GROUP_DEFINITION));
            jtbSimpleTypes.addActionListener(new SchemaTypeConstraintActionListener(constraint, XSTypeDefinition.SIMPLE_TYPE));
        }

        final JToolBar toolbar = new JToolBar();
        toolbar.add(jtbAttributes);
        toolbar.add(jtbComplexTypes);
View Full Code Here

    JSeparator line = new JSeparator(SwingConstants.HORIZONTAL);

    JToggleButton button = new JToggleButton(TOGGLE_CLOSED, true);
    button.setBorder(new EmptyBorder(0,0,0,0));
    button.setSelectedIcon(TOGGLE_OPEN);
    button.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        for (Component c : toggledComponents) {
          c.setVisible(!c.isVisible());
        }
View Full Code Here

            JToggleButton button = new JToggleButton(getDayString(day));
            button.setLocale(locale);
           
            // set buttons' action command to a string containing the date they represent
            button.setActionCommand(String.valueOf(day));
            button.addActionListener(actionListener);
            button.addKeyListener(keyListener);
            dayButtons.add(button);
        }
       
        // initialize panels
View Full Code Here

  private JToggleButton getResultadosButton() {
    final JToggleButton jToggleButton = new JToggleButton(
        i18n.getString("map.history.button.results"),
        LogicConstants.getIcon("capas_button_resultado"));
    jToggleButton.addActionListener(new ActionListener() {

      @Override
      public void actionPerformed(ActionEvent e) {
        if (jToggleButton.isSelected()) {
          for (Layer l : ConsultaHistoricos.getCapas()) {
View Full Code Here

                XAccessibleStateSet aChildStateSet = mxContext.getAccessibleStateSet();
                aChild.setSelected (aChildStateSet!=null
                    && aChildStateSet.contains(AccessibleStateType.SELECTED));

                aChild.addActionListener (this);
                maChildrenSelector.add (aChild);
               
            }
            catch (IndexOutOfBoundsException e)
            {
View Full Code Here

                    XAccessibleStateSet aChildStateSet =
                        mxContext.getAccessibleStateSet();
                    aChild.setSelected (aChildStateSet!=null
                        && aChildStateSet.contains(AccessibleStateType.SELECTED));
                   
                    aChild.addActionListener (this);
                    maChildrenSelector.add (aChild);
                   
                }
                catch (IndexOutOfBoundsException e)
                {
View Full Code Here

            }
        });

        // toggle button for maximization
        JToggleButton button1 = new JToggleButton("maximized");
        button1.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                AbstractButton abstractButton = (AbstractButton) e.getSource();
                boolean selected = abstractButton.getModel().isSelected();
                if (selected) {
View Full Code Here

        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

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.