Package javax.swing

Examples of javax.swing.JButton$AccessibleJButton


  }

  protected void appearanceFinal() {
    removeAll();
    setLayout(new BorderLayout());
    JButton goButton = new JButton("Start...");
    add(goButton, BorderLayout.CENTER);
    goButton.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent e) {
    startLoading();
  }
      });
  }
View Full Code Here


    add(m_caEditor, BorderLayout.CENTER);
    addButtons();
  }
 
  private void addButtons() {
    JButton okBut = new JButton("OK");
    JButton cancelBut = new JButton("Cancel");
   
    JPanel butHolder = new JPanel();
    butHolder.setLayout(new GridLayout(1, 2));
    butHolder.add(okBut); butHolder.add(cancelBut);
    add(butHolder, BorderLayout.SOUTH);
   
    okBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        m_modifyListener.setModifiedStatus(ClassAssignerCustomizer.this, true);
        if (m_parent != null) {
          m_parent.dispose();
        }
      }
    });
   
    cancelBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        customizerClosing();
        if (m_parent != null) {
          m_parent.dispose();
        }
View Full Code Here

    gbLayout.setConstraints(m_idBox, gbConstraints);
    db.add(m_idBox);

    JPanel buttonsP = new JPanel();
    buttonsP.setLayout(new FlowLayout());
    JButton ok,cancel;
    buttonsP.add(ok = new JButton("OK"));
    buttonsP.add(cancel=new JButton("Cancel"));
    ok.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent evt){
        ((DatabaseSaver)m_dsSaver.getSaverTemplate()).resetStructure()
        ((DatabaseConverter)m_dsSaver.getSaverTemplate()).setUrl(m_dbaseURLText.getText());
        ((DatabaseConverter)m_dsSaver.getSaverTemplate()).setUser(m_userNameText.getText());
        ((DatabaseConverter)m_dsSaver.getSaverTemplate()).setPassword(new String(m_passwordText.getPassword()));
View Full Code Here

      m_directoryText.setText(m_dsSaver.getSaverTemplate().retrieveDir());
    } catch (IOException ex) {
      // ignore
    }
   
    JButton browseBut = new JButton("Browse...");
    browseBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        try {
          //final JFrame jf = new JFrame("Choose directory");
          final JDialog jf = new JDialog((JDialog)SaverCustomizer.this.getTopLevelAncestor(),
              "Choose directory", true);
          jf.setLayout(new BorderLayout());
          jf.getContentPane().add(m_fileChooser, BorderLayout.CENTER);
          m_fileChooserFrame = jf;
          jf.pack();
          jf.setVisible(true);
        } catch (Exception ex) {
          ex.printStackTrace();
        }
      }
    });
   
    JPanel efHolder = new JPanel();
    efHolder.setLayout(new BorderLayout());
    JPanel bP = new JPanel(); bP.setLayout(new BorderLayout());
    bP.setBorder(BorderFactory.createEmptyBorder(5,0,5,5));
    bP.add(browseBut, BorderLayout.CENTER);
    efHolder.add(m_directoryText, BorderLayout.CENTER);
    efHolder.add(bP, BorderLayout.EAST);
    //efHolder.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    gbConstraints = new GridBagConstraints();
    gbConstraints.anchor = GridBagConstraints.EAST;
    gbConstraints.fill = GridBagConstraints.HORIZONTAL;
    gbConstraints.gridy = 2; gbConstraints.gridx = 1;
    gbLayout.setConstraints(efHolder, gbConstraints);
    alignedP.add(efHolder);
   

    JLabel relativeLab = new JLabel("Use relative file paths", SwingConstants.RIGHT);
    relativeLab.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
    gbConstraints = new GridBagConstraints();
    gbConstraints.anchor = GridBagConstraints.EAST;
    gbConstraints.fill = GridBagConstraints.HORIZONTAL;
    gbConstraints.gridy = 3; gbConstraints.gridx = 0;
    gbLayout.setConstraints(relativeLab, gbConstraints);
    alignedP.add(relativeLab);
   
    m_relativeFilePath = new JCheckBox();
    m_relativeFilePath.
    setSelected(((FileSourcedConverter)m_dsSaver.getSaverTemplate()).getUseRelativePath());

    m_relativeFilePath.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        ((FileSourcedConverter)m_dsSaver.getSaverTemplate()).
        setUseRelativePath(m_relativeFilePath.isSelected());
      }
    });
    gbConstraints = new GridBagConstraints();
    gbConstraints.anchor = GridBagConstraints.EAST;
    gbConstraints.fill = GridBagConstraints.HORIZONTAL;
    gbConstraints.gridy = 3; gbConstraints.gridx = 1;
    gbLayout.setConstraints(m_relativeFilePath, gbConstraints);
    alignedP.add(m_relativeFilePath);
       
    JButton OKBut = new JButton("OK");
    OKBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        try {         
          (m_dsSaver.getSaverTemplate()).setFilePrefix(m_prefixText.getText());
          (m_dsSaver.getSaverTemplate()).setDir(m_directoryText.getText());
          m_dsSaver.
            setRelationNameForFilename(m_relationNameForFilename.isSelected());
        } catch (Exception ex) {
          ex.printStackTrace();
        }
       
        if (m_modifyListener != null) {
          m_modifyListener.setModifiedStatus(SaverCustomizer.this, true);
        }
       
        m_parentWindow.dispose();
      }
    });

    JButton CancelBut = new JButton("Cancel");
    CancelBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        if (m_modifyListener != null) {
          m_modifyListener.setModifiedStatus(SaverCustomizer.this, false);
        }
       
View Full Code Here

        moreOptionsPanel.add(sourcePanel);

  JPanel all = new JPanel();
  all.setLayout(new BorderLayout())

  JButton oK = new JButton("OK");
  JPanel okP = new JPanel();
  okP.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
  okP.setLayout(new GridLayout(1,1,5,5));
  okP.add(oK);

  all.add(moreOptionsPanel, BorderLayout.CENTER);
  all.add(okP, BorderLayout.SOUTH);
 
  final JDialog jd =
    new JDialog(PropertyDialog.getParentFrame(ClassifierPanel.this), "Classifier evaluation options");
  jd.getContentPane().setLayout(new BorderLayout());
  jd.getContentPane().add(all, BorderLayout.CENTER);
  jd.addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(java.awt.event.WindowEvent w) {
      jd.dispose();
      m_MoreOptions.setEnabled(true);
    }
  });
  oK.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent a) {
      m_MoreOptions.setEnabled(true);
      jd.dispose();
    }
  });
View Full Code Here

    gbLayout.setConstraints(m_keyText, gbConstraints);
    db.add(m_keyText);

    JPanel buttonsP = new JPanel();
    buttonsP.setLayout(new FlowLayout());
    JButton ok,cancel;
    buttonsP.add(ok = new JButton("OK"));
    buttonsP.add(cancel=new JButton("Cancel"));
    ok.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent evt){
        ((DatabaseLoader)m_dsLoader.getLoader()).resetStructure()
        ((DatabaseConverter)m_dsLoader.getLoader()).setUrl(m_dbaseURLText.getText());
        ((DatabaseConverter)m_dsLoader.getLoader()).setUser(m_userNameText.getText());
        ((DatabaseConverter)m_dsLoader.getLoader()).setPassword(new String(m_passwordText.getPassword()));
View Full Code Here

    if (!currentFileIsDir) {
      ef.setText(tmp.toString());
    }
   
    efHolder.add(ef, BorderLayout.CENTER);
    JButton browseBut = new JButton("Browse...");
    browseBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        try {
          //final JFrame jf = new JFrame("Choose file");
          final JDialog jf = new JDialog((JDialog)LoaderCustomizer.this.getTopLevelAncestor(),
              "Choose file", true);
          jf.setLayout(new BorderLayout());
          //jf.getContentPane().setLayout(new BorderLayout());
          jf.getContentPane().add(m_fileChooser, BorderLayout.CENTER);
          m_fileChooserFrame = jf;
          jf.pack();
          jf.setVisible(true);
        } catch (Exception ex) {
          ex.printStackTrace();
        }
      }
    });
   
    JPanel bP = new JPanel(); bP.setLayout(new BorderLayout());
    bP.setBorder(BorderFactory.createEmptyBorder(5,0,5,5));
    bP.add(browseBut, BorderLayout.CENTER);
    efHolder.add(bP, BorderLayout.EAST);
    JPanel alignedP = new JPanel();
    alignedP.setBorder(BorderFactory.createTitledBorder("File"));
    alignedP.setLayout(new BorderLayout());
    JLabel efLab = new JLabel("Filename", SwingConstants.RIGHT);
    efLab.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
    alignedP.add(efLab, BorderLayout.WEST);   
    alignedP.add(efHolder, BorderLayout.CENTER);
   
    northPanel.add(alignedP, BorderLayout.SOUTH);
       
    JPanel butHolder = new JPanel();
    //butHolder.setLayout(new GridLayout(1,2));
    butHolder.setLayout(new FlowLayout());
    JButton OKBut = new JButton("OK");
    OKBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        try {
          ((FileSourcedConverter)m_dsLoader.getLoader()).
          setFile(new File(ef.getText()));
          // tell the loader that a new file has been selected so
          // that it can attempt to load the header
          //m_dsLoader.setLoader(m_dsLoader.getLoader());
          m_dsLoader.newFileSelected();
        } catch (Exception ex) {
          ex.printStackTrace();
        }
        if (m_modifyListener != null) {
          m_modifyListener.setModifiedStatus(LoaderCustomizer.this, true);
        }
        m_parentWindow.dispose();
      }
    });

    JButton CancelBut = new JButton("Cancel");
    CancelBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {               
        if (m_modifyListener != null) {
          m_modifyListener.setModifiedStatus(LoaderCustomizer.this, false);
        }
       
View Full Code Here

    add(m_messageLabel, BorderLayout.CENTER);
    addButtons();
  }
 
  private void addButtons() {
    JButton okBut = new JButton("OK");
    JButton cancelBut = new JButton("Cancel");
   
    JPanel butHolder = new JPanel();
    butHolder.setLayout(new GridLayout(1, 2));
    butHolder.add(okBut); butHolder.add(cancelBut);
    add(butHolder, BorderLayout.SOUTH);
   
    okBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {       
        if (m_modifyListener != null) {
          m_modifyListener.setModifiedStatus(ClassValuePickerCustomizer.this, m_modified);
        }
       
        if (m_parent != null) {
          m_parent.dispose();
        }
      }
    });
   
    cancelBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        m_classValuePicker.setClassValueIndex(m_backup);
       
        customizerClosing();
        if (m_parent != null) {
View Full Code Here

    });

    final JScrollPane scrollPane = new JScrollPane(infoPanel);
    panel.add(scrollPane, cc.xyw(1,1,2));

    JButton ok = new JButton(Localizer.getLocalization(Localizer.I18N_OK));

    ok.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        setVisible(false);
      }
    });
View Full Code Here

    txt.setMinimumSize(new Dimension(200, 20));
    panel.add(txt, cc.xyw(1, 3, 3));

    ButtonBarBuilder2 builder = new ButtonBarBuilder2();
   
    JButton defaultButton = new JButton(Localizer.getLocalization(Localizer.I18N_DEFAULT));
   
    defaultButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        resetToDefaults();
      }

    });
   
    builder.addButton(defaultButton);
    builder.addRelatedGap();
    builder.addGlue();

    mOKBt = new JButton(Localizer.getLocalization(Localizer.I18N_OK));
    mOKBt.addActionListener(this);
    getRootPane().setDefaultButton(mOKBt);
   
    mCloseBt = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL));
    mCloseBt.addActionListener(this);

    builder.addButton(new JButton[] { mOKBt, mCloseBt });

    panel.add(builder.getPanel(), cc.xyw(1, 5, 3));
View Full Code Here

TOP

Related Classes of javax.swing.JButton$AccessibleJButton

Copyright © 2018 www.massapicom. 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.