Package javax.swing

Examples of javax.swing.JButton


        panel.add(new JLabel(Localizer.getLocalization(Localizer.I18N_CHANNELS) + ":"), cc.xy(2, 1));
        panel.add(mBox, cc.xy(4, 1));
        panel.add(new JLabel(mLocalizer.msg("filter", "Filter:")), cc.xy(2, 3));
        panel.add(mFilterBox, cc.xy(4, 3));

        mSendBtn = new JButton(TVBrowserIcons.copy(TVBrowserIcons.SIZE_SMALL));
        mSendBtn.setToolTipText(mLocalizer.msg("send", "Send to other Plugins"));
        mSendBtn.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            Program[] programs = mList.getSelectedPrograms();
            if (programs == null || programs.length == 0) {
              programs = mPrograms.toArray(new Program[mPrograms.size()]);
            }
            if (programs != null && programs.length > 0) {
              SendToPluginDialog sendDialog = new SendToPluginDialog(ProgramListPlugin.getInstance(), (Window) mDialog,
                  programs);
              sendDialog.setVisible(true);
            }
          }
        });

        mShowDescription = new JCheckBox(mLocalizer.msg("showProgramDescription", "Show program description"),
            showDescription);
        mShowDescription.addItemListener(new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            int topRow = mList.getFirstVisibleIndex();
            mProgramPanelSettings.setShowOnlyDateAndTitle(e.getStateChange() == ItemEvent.DESELECTED);
            mSettings.setShowDescription(e.getStateChange() == ItemEvent.SELECTED);
            mList.updateUI();
            if (topRow != -1) {
              mList.ensureIndexIsVisible(topRow);
            }
          }
        });

        JButton close = new JButton(Localizer.getLocalization(Localizer.I18N_CLOSE));
        close.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            closeDialog();
          }
        });
View Full Code Here


    mDescription = new ParamInputField(mSettings.getDescription());
   
    panel.addGrowingRow();
    panel.add(mDescription, cc.xyw(2,panel.getRow(),3));
   
    final JButton testGrowl = new JButton(mLocalizer.msg("testGrowl",
        "Test Growl"));
    testGrowl.addActionListener(new ActionListener() {

      public void actionPerformed(final ActionEvent e) {
        final GrowlSettings testSettings = new GrowlSettings(null);
        testSettings.setTitle(mTitle.getText());
        testSettings.setDescription(mDescription.getText());
View Full Code Here

    JPanel panel3 = new JPanel(new BorderLayout());
    JPanel btnPn = new JPanel();
    btnPn.setLayout(new GridLayout(0, 1, 0, 4));

    mAddBtn = new JButton(Localizer.getLocalization(Localizer.I18N_ADD),
        TVBrowserIcons.newIcon(TVBrowserIcons.SIZE_SMALL));
    mRemoveBtn = new JButton(mLocalizer.msg("remove", "Remove"),
        TVBrowserIcons.delete(TVBrowserIcons.SIZE_SMALL));

    mInfoBtn = new JButton("Information", AbstractTvDataService
        .getPluginManager().getIconFromTheme(null, "actions", "help-browser",
            16));

    mAddBtn.setHorizontalAlignment(SwingConstants.LEFT);
    mRemoveBtn.setHorizontalAlignment(SwingConstants.LEFT);
View Full Code Here

    mSearchBar = b.getPanel();
    mSearchBar.addComponentListener(this);
    mSearchBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, mSearchBar.getBackground().darker()));

    mSearchCloseBtn = new JButton(IconLoader.getInstance()
        .getIconFromTheme("actions", "process-stop", 16));
    mSearchCloseBtn.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    mSearchCloseBtn.setPressedIcon(IconLoader.getInstance().getIconFromTheme(
        "actions", "close-pressed", 16));
    mSearchCloseBtn.setToolTipText(mLocalizer.msg("closeToolTip",
        "Close Find bar"));
    mSearchCloseBtn.setContentAreaFilled(false);
    mSearchCloseBtn.setFocusable(false);
   
    MouseListener[] ml = mSearchCloseBtn.getMouseListeners();
   
    for(int i = 0; i < ml.length; i++) {
      if(!(ml[i] instanceof ToolTipManager)) {
        mSearchCloseBtn.removeMouseListener(ml[i]);
      }
    }

    final JTextField searchField = getSearchField();

    mFindNext = new JButton(mLocalizer.msg("next", "Find Next"));
    mFindNext.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    mFindNext.setIcon(TVBrowserIcons.down(TVBrowserIcons.SIZE_SMALL));
    mFindNext.setContentAreaFilled(false);
    mFindNext.setFocusable(false);
    mFindNext.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        next();
      }
    });

    mFindPrev = new JButton(mLocalizer.msg("prev", "Find Previous"));
    mFindPrev.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    mFindPrev.setIcon(TVBrowserIcons.up(TVBrowserIcons.SIZE_SMALL));
    mFindPrev.setContentAreaFilled(false);
    mFindPrev.setFocusable(false);
    mFindPrev.addActionListener(new ActionListener() {
View Full Code Here

      boolean mOver;
      boolean mPressed;

      public void mouseEntered(MouseEvent e) {
        mOver = true;
        JButton b = (JButton) e.getSource();
        if (b.isEnabled()) {
          if (b.equals(mFindPrev) || b.equals(mFindNext)) {
            setBorder(b, mPressed);
          } else if (mPressed) {
            b.setIcon(IconLoader.getInstance().getIconFromTheme("actions",
                "close-pressed", 16));
          } else {
            b.setIcon(IconLoader.getInstance().getIconFromTheme("status",
                "close-over", 16));
          }
        }
      }

      public void mouseExited(MouseEvent e) {
        mOver = false;
        JButton b = (JButton) e.getSource();
        if (b.isEnabled()) {
          if (b.equals(mFindPrev) || b.equals(mFindNext)) {
            b.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
          } else {
            b.setIcon(IconLoader.getInstance().getIconFromTheme("actions",
                "process-stop", 16));
          }
        }
      }

      public void mousePressed(MouseEvent e) {
        mPressed = true;
        JButton b = (JButton) e.getSource();
        if (b.isEnabled()) {
          if (b.equals(mFindPrev) || b.equals(mFindNext)) {
            setBorder(b, true);
          } else {
            b.setIcon(IconLoader.getInstance().getIconFromTheme("actions",
                "close-pressed", 16));
          }
        }
      }

      public void mouseReleased(MouseEvent e) {
        mPressed = false;
        JButton b = (JButton) e.getSource();
        if (b.isEnabled()) {
          if (b.equals(mFindPrev) || b.equals(mFindNext)) {
            if (mOver) {
              setBorder(b, false);
            } else {
              b.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
            }
          } else {
            b.setIcon(IconLoader.getInstance().getIconFromTheme("actions",
                "process-stop", 16));

            if (mOver) {
              mSearchBar.setVisible(false);
              mSearchCloseBtn.setVisible(false);
View Full Code Here


    ButtonBarBuilder2 builder = new ButtonBarBuilder2();
    builder.addGlue();

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

    mOkButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        okPressed(settings);
      }
    });

    getRootPane().setDefaultButton(mOkButton);

    JButton cancel = new JButton (Localizer.getLocalization(Localizer.I18N_CANCEL));

    cancel.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        close();
      }
    });
View Full Code Here

    this.setTitle(propertiesMgr.getValue("titleBuddyDialog"));   
    this.getContentPane().setLayout(new GridBagLayout());
       
    nameLabel = new JLabel(propertiesMgr.getValue("buddyName"));
    groupLabel = new JLabel(propertiesMgr.getValue("buddyGroup"));
    ok = new JButton(propertiesMgr.getValue("okForAddBuddy"));
    ok.addActionListener(this);
    cancel = new JButton(propertiesMgr.getValue("cancelForAddBuddy"));
    cancel.addActionListener(this);
    GridBagConstraints c = new GridBagConstraints();

    c.weightx = 1;
    c.insets = new Insets(5, 5, 5, 5);
View Full Code Here

  private void init()
  {
    this.setTitle(propertiesMgr.getValue("optionFrameTitle"));
    this.getContentPane().setLayout(mainLayout);

    ok = new JButton(this.propertiesMgr.getValue("validOptionButton"));
    ok.addActionListener(this);
    cancel = new JButton(this.propertiesMgr.getValue("cancelOptionButton"));
    cancel.addActionListener(this);

    //Construct language panel option.
    french = new JCheckBox(this.propertiesMgr.getValue("frenchOption"));
    english = new JCheckBox(this.propertiesMgr.getValue("englishOption"));
View Full Code Here

   
    mFile = new JTextField(mExecFile);
   
    filePanel.add(mFile, BorderLayout.CENTER);
   
    JButton chooseFile = new JButton("...");
   
    chooseFile.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        changeFile();
      }
    });
   
    filePanel.add(chooseFile, BorderLayout.EAST);
   
    panel.add(filePanel, BorderLayout.NORTH);
   
    filePanel.setBorder(BorderFactory.createTitledBorder(mLocalizer.msg("executionApp","Application")));
   
    if (mParamLibrary == null) {
      mParamLibrary = new ParamLibrary();
    }
    mParam = new ParamInputField(mParamLibrary, mExecParam, true);
   
    mParam.setBorder(BorderFactory.createTitledBorder(mLocalizer.msg("parameters", "Parameters")));
   
    panel.add(mParam, BorderLayout.CENTER);
   
    JButton ok = new JButton(Localizer.getLocalization(Localizer.I18N_OK));
    ok.addActionListener(new ActionListener() {

      public void actionPerformed(ActionEvent e) {
        okPressed();
        setVisible(false);
      }
     
    });
   
    JButton cancel = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL));
    cancel.addActionListener(new ActionListener() {

      public void actionPerformed(ActionEvent e) {
        setVisible(false);
      }
     
View Full Code Here

      FormLayout layout = new FormLayout("0dlu:grow,pref,5dlu,pref", "pref");
      layout.setColumnGroups(new int[][] { { 2, 4 } });

      JPanel buttonPanel = new JPanel(layout);

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

      ok.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          okPressed();
        }
      });

      JButton cancel = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL));
      cancel.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          cancelPressed();
        }
      });
View Full Code Here

TOP

Related Classes of javax.swing.JButton

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.