Example usage for javax.swing JButton setToolTipText

List of usage examples for javax.swing JButton setToolTipText

Introduction

In this page you can find the example usage for javax.swing JButton setToolTipText.

Prototype

@BeanProperty(bound = false, preferred = true, description = "The text to display in a tool tip.")
public void setToolTipText(String text) 

Source Link

Document

Registers the text to display in a tool tip.

Usage

From source file:com.github.cric.app.ui.SettingPanel.java

private JButton submitButton() {

    JButton b = new JButton("Submit");
    b.setToolTipText("Schedule for score updates via popup");
    parentFrame.getRootPane().setDefaultButton(b);
    b.addActionListener(e -> {//from w  w w  .j  a v a2s.c om

        if (!validatedInputFields()) {
            return;
        }

        if (CollectionUtils.isEmpty(matchList)) {

            System.setProperty(API_KEY_PROP, apiKeyField.getText());
            populateMatchList();

        } else {
            submitted();
        }
    });
    return b;
}

From source file:com.emental.mindraider.ui.panels.ConceptAttachmentsJPanel.java

public void init() {
    JPanel pp;/* w ww  . ja va 2 s. c o  m*/
    setBorder(new TitledBorder(Messages.getString("ConceptJPanel.attachments")));
    setLayout(new BorderLayout());

    // button
    pp = new JPanel();
    pp.setLayout(new GridLayout(3, 1));
    JButton jbutton = new JButton("", IconsRegistry.getImageIcon("attach.png"));
    jbutton.setToolTipText(Messages.getString("ConceptJPanel.attachLocalResourceToConcept"));
    jbutton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            // some concept must be selected - select graph node according
            // to the selected concept =-> touchgraph
            // method needed
            if (conceptJPanel.getConceptResource() == null) {
                JOptionPane.showMessageDialog(MindRaider.mainJFrame,
                        Messages.getString("ConceptJPanel.attachResourceWarning"),
                        Messages.getString("ConceptJPanel.attachmentError"), JOptionPane.ERROR_MESSAGE);
                return;
            }
            new AttachmentJDialog(conceptJPanel.getConceptResource());
        }
    });
    pp.add(jbutton);
    // @todo edit resource description
    // jbutton=new JButton("",IconsRegistry.getImageIcon("attachLink.png"));
    // jbutton.setToolTipText("Attach web resource to concept");
    // jbutton.addActionListener(new ActionListener() {
    // public void actionPerformed(ActionEvent e) {
    // }
    // });
    // pp.add(jbutton);
    // attach another concept/folder/resource... - perhaps extra frame with
    // radio
    jbutton = new JButton("", IconsRegistry.getImageIcon("launch.png"));
    jbutton.setToolTipText(Messages.getString("ConceptJPanel.showAttachment"));
    jbutton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (attachmentsTableModel.attachments != null) {
                if (attachments.getSelectedRow() == -1) {
                    JOptionPane.showMessageDialog(MindRaider.mainJFrame,
                            Messages.getString("ConceptJPanel.selectAttachmentToLaunch"),
                            Messages.getString("ConceptJPanel.attachmentError"), JOptionPane.ERROR_MESSAGE);
                    return;
                }
                String uri = attachmentsTableModel.attachments[attachments.getSelectedRow()].getUrl();
                if (uri != null) {
                    Node node = new Node();
                    node.setLabel(uri);
                    node.setURL(uri);
                    node.setType(
                            MindRaider.spidersColorProfileRegistry.getCurrentProfile().getLiteralNodeType());
                    MindRaider.spidersGraph.handleDoubleSelect(node);
                }
            }
        }
    });
    pp.add(jbutton);
    jbutton = new JButton("", IconsRegistry.getImageIcon("explorerDiscardSmall.png"));
    jbutton.setToolTipText(Messages.getString("ConceptJPanel.removeAttachment"));
    pp.add(jbutton);
    jbutton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (attachmentsTableModel.attachments != null) {
                if (getAttachments().getSelectedRow() != -1) {
                    logger.debug(Messages.getString("ConceptJPanel.removingAttachment",
                            getAttachments().getSelectedRow()));
                    String attachUrl = getAttachmentsTableModel().attachments[getAttachments().getSelectedRow()]
                            .getUrl();
                    logger.debug(Messages.getString("ConceptJPanel.removingAttachmentUrl", attachUrl));
                    if (conceptJPanel.getConceptResource() != null) {
                        // check, that selected node is type of literal
                        // (helper on spiders graph)
                        MindRaider.noteCustodian.removeAttachment(
                                MindRaider.profile.getActiveOutlineUri().toString(),
                                conceptJPanel.getConceptResource(), attachUrl);
                        conceptJPanel.refresh();
                        MindRaider.spidersGraph.renderModel();
                        return;
                    }
                }
                JOptionPane.showMessageDialog(MindRaider.mainJFrame,
                        Messages.getString("ConceptJPanel.selectAttachmentToRemove"),
                        Messages.getString("ConceptJPanel.attachmentError"), JOptionPane.ERROR_MESSAGE);
            }
        }
    });
    add(pp, BorderLayout.EAST);

    // table
    attachmentsTableModel = new AttachmentsTableModel();
    attachments = new JTable(attachmentsTableModel) {

        private static final long serialVersionUID = 1L;

        public String getToolTipText(MouseEvent e) {
            String tip = null;
            java.awt.Point p = e.getPoint();
            int rowIndex = rowAtPoint(p);

            AttachmentsTableModel model = (AttachmentsTableModel) getModel();
            tip = Messages.getString("ConceptJPanel.attachmentUrl") + model.attachments[rowIndex].getUrl();
            // You can omit this part if you know you don't
            // have any renderers that supply their own tool
            // tips.
            // tip = super.getToolTipText(e);
            return tip;
        }
    };
    TableColumn column = attachments.getColumnModel().getColumn(0);
    column.setMaxWidth(50);
    attachments.setRowHeight(20);
    attachments.setAutoscrolls(true);
    attachments.setPreferredScrollableViewportSize(new Dimension(500, 70));
    JScrollPane scrollPane = new JScrollPane(attachments);
    add(scrollPane, BorderLayout.CENTER);
}

From source file:com.smart.aqimonitor.client.AqiMonitor.java

/**
 * Create the frame.//from w w w.  ja  v  a 2 s  . c o m
 */
public AqiMonitor() {
    refSelf = this;
    setPreferredSize(new Dimension(640, 480));
    setTitle("\u7A7A\u6C14\u8D28\u91CF\u76D1\u6D4B");
    setIconImage(Toolkit.getDefaultToolkit()
            .getImage(AqiMonitor.class.getResource("/lombok/installer/eclipse/STS.png")));
    setMinimumSize(new Dimension(640, 480));
    setMaximumSize(new Dimension(1024, 768));
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setBounds(100, 100, 636, 412);
    contentPane = new JPanel();
    contentPane.setPreferredSize(new Dimension(640, 480));
    contentPane.setMinimumSize(new Dimension(640, 480));
    contentPane.setMaximumSize(new Dimension(1024, 768));
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    contentPane.setLayout(new BorderLayout(0, 0));
    setContentPane(contentPane);

    JPanel mainPanel = new JPanel();
    contentPane.add(mainPanel, BorderLayout.CENTER);
    mainPanel.setLayout(new BorderLayout(0, 0));

    JPanel contentPanel = new JPanel();
    mainPanel.add(contentPanel, BorderLayout.CENTER);
    contentPanel.setLayout(new BorderLayout(0, 0));

    JScrollPane scrollPane = new JScrollPane();
    scrollPane
            .setViewportBorder(new TitledBorder(null, "", TitledBorder.LEADING, TitledBorder.TOP, null, null));
    contentPanel.add(scrollPane, BorderLayout.CENTER);

    textPane = new AqiTextPane();
    textPane.addInputMethodListener(new InputMethodListener() {

        public void caretPositionChanged(InputMethodEvent event) {

        }

        public void inputMethodTextChanged(InputMethodEvent event) {
            textPane.setCaretPosition(document.getLength() + 1);
        }
    });
    textPane.setEditable(false);
    textPane.setOpaque(false);
    textPane.setForeground(Color.BLACK);
    scrollPane.setViewportView(textPane);
    document = textPane.getStyledDocument();

    document.addDocumentListener(new DocumentListener() {

        @Override
        public void removeUpdate(DocumentEvent e) {
            changedUpdate(e);
        }

        @Override
        public void insertUpdate(DocumentEvent e) {
            changedUpdate(e);
        }

        @Override
        public void changedUpdate(DocumentEvent e) {
            if (e.getDocument() == document) {
                textPane.setCaretPosition(document.getLength());
            }
        }
    });

    JPanel buttonPanel = new JPanel();
    contentPane.add(buttonPanel, BorderLayout.SOUTH);
    buttonPanel.setLayout(new BorderLayout(0, 0));

    JLabel lblTipsLabel = new JLabel(
            "Tips\uFF1A\u6587\u4EF6\u4FDD\u5B58\u683C\u5F0Fcsv\u53EF\u7528Excel\u6253\u5F00");
    lblTipsLabel.setForeground(Color.BLUE);
    buttonPanel.add(lblTipsLabel, BorderLayout.WEST);

    JPanel panel = new JPanel();
    buttonPanel.add(panel, BorderLayout.CENTER);
    panel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));

    JButton btnRetrieve = new JButton("\u624B\u52A8\u83B7\u53D6\u6570\u636E");
    panel.add(btnRetrieve);
    btnRetrieve.setVerticalAlignment(SwingConstants.BOTTOM);

    JButton btnNewButton = new JButton("\u5173\u4E8E");
    btnNewButton.setToolTipText("\u5173\u4E8E");
    btnNewButton.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            JTextArea textArea = new JTextArea(
                    "\n        csv\n\n        smartstudio@foxmail.com");
            textArea.setColumns(35);
            textArea.setRows(6);
            textArea.setLineWrap(true);// 
            textArea.setEditable(false);// 
            textArea.setOpaque(false);
            JOptionPane.showMessageDialog(contentPane, textArea, "", JOptionPane.PLAIN_MESSAGE);
        }
    });

    JButton btnSetting = new JButton("\u8BBE\u7F6E");
    btnSetting.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {

            Point parentPos = refSelf.getLocation();

            AqiSettingDialog settingDialog = new AqiSettingDialog(refSelf, pm25InDetailJob.getAqiParser());
            settingDialog.setModal(true);
            settingDialog.setLocation(parentPos.x + 100, parentPos.y + 150);
            settingDialog.init();
            settingDialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
            settingDialog.setVisible(true);
        }
    });

    JButton btnExportDir = new JButton("\u67E5\u770B\u6570\u636E");
    btnExportDir.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            try {

                String[] cmd = new String[5];

                String filePath = pm25InDetailJob.getAqiParser().getFilePath();
                File file = new File(filePath);
                if (!file.exists()) {
                    FileUtil.makeDir(file);
                }
                if (!file.isDirectory()) {
                    JOptionPane.showMessageDialog(contentPane, "", "",
                            JOptionPane.ERROR_MESSAGE);
                    return;
                }

                cmd[0] = "cmd";
                cmd[1] = "/c";
                cmd[2] = "start";
                cmd[3] = " ";
                cmd[4] = pm25InDetailJob.getAqiParser().getFilePath();

                Runtime.getRuntime().exec(cmd);

            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
    });
    panel.add(btnExportDir);
    panel.add(btnSetting);
    panel.add(btnNewButton);
    btnRetrieve.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            if (!isRetrieving) {
                isRetrieving = true;
                Thread firstRun = new Thread(new Runnable() {

                    @Override
                    public void run() {
                        pm25InDetailJob.refresh();
                        isRetrieving = false;
                    }
                });

                firstRun.start();
            }
        }
    });

    init();
}

From source file:edu.harvard.mcz.imagecapture.BulkMediaFrame.java

private void init() {
    thisFrame = this;
    setTitle("BulkMedia Preparation");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setBounds(100, 100, 902, 174);/*from  w ww . jav  a2 s  .c o m*/

    JMenuBar menuBar = new JMenuBar();
    setJMenuBar(menuBar);

    JMenu mnFile = new JMenu("File");
    mnFile.setMnemonic(KeyEvent.VK_F);
    menuBar.add(mnFile);

    JMenuItem mntmPrepareDirectory = new JMenuItem("Prepare Directory");
    mntmPrepareDirectory.setMnemonic(KeyEvent.VK_D);
    mntmPrepareDirectory.addActionListener(new PrepareDirectoryAction());
    mnFile.add(mntmPrepareDirectory);

    JMenuItem mntmNewMenuItem = new JMenuItem("Exit");
    mntmNewMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            done();
        }
    });

    JMenuItem mntmNewMenuItem_1 = new JMenuItem("Edit Properties");
    mntmNewMenuItem_1.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            PropertiesEditor p = new PropertiesEditor();
            p.pack();
            p.setVisible(true);
        }
    });
    mnFile.add(mntmNewMenuItem_1);
    mntmNewMenuItem.setMnemonic(KeyEvent.VK_X);
    mntmNewMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK));
    mnFile.add(mntmNewMenuItem);
    contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(new BorderLayout(0, 0));

    JPanel panel = new JPanel();
    contentPane.add(panel, BorderLayout.CENTER);
    panel.setLayout(new GridLayout(3, 2, 0, 0));

    JLabel lblBaseUri = new JLabel("Base URI (first part of path to images on the web)");
    lblBaseUri.setHorizontalAlignment(SwingConstants.TRAILING);
    panel.add(lblBaseUri, "2, 2");

    textField = new JTextField();
    textField.setEditable(false);
    textField.setText(Singleton.getSingletonInstance().getProperties().getProperties()
            .getProperty(ImageCaptureProperties.KEY_IMAGEBASEURI));
    panel.add(textField);
    textField.setColumns(10);

    JLabel lblNewLabel = new JLabel("Local Path To Base (local mount path that maps to base URI)");
    lblNewLabel.setHorizontalAlignment(SwingConstants.TRAILING);
    panel.add(lblNewLabel);

    textField_1 = new JTextField();
    textField_1.setEditable(false);
    textField_1.setText(Singleton.getSingletonInstance().getProperties().getProperties()
            .getProperty(ImageCaptureProperties.KEY_IMAGEBASE));
    panel.add(textField_1);
    textField_1.setColumns(10);

    JLabel lblBeforeExitingWait = new JLabel(
            "Before exiting wait for both the Done and Thumbnails Built messages.");
    panel.add(lblBeforeExitingWait);

    JLabel lblThumbnailGenerationIs = new JLabel("Thumbnail generation is not reported on the progress bar.");
    panel.add(lblThumbnailGenerationIs);

    progressBar = new JProgressBar();
    progressBar.setStringPainted(false);
    contentPane.add(progressBar, BorderLayout.NORTH);

    JPanel panel_1 = new JPanel();
    contentPane.add(panel_1, BorderLayout.SOUTH);

    JButton btnPrepareDirectory = new JButton("Run");
    btnPrepareDirectory.setToolTipText("Select a directory and prepare a bulk media file for images therein.");
    panel_1.add(btnPrepareDirectory);
    btnPrepareDirectory.addActionListener(new PrepareDirectoryAction());
    btnPrepareDirectory.setPreferredSize(new Dimension(80, 25));

    JButton btnExit = new JButton("Exit");
    btnExit.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            done();
        }
    });
    panel_1.add(btnExit);
}

From source file:net.sf.jabref.gui.search.SearchBar.java

/**
 * Initializes the search bar./*from w  w w .j av a 2 s  . com*/
 *
 * @param basePanel the base panel
 */
public SearchBar(BasePanel basePanel) {
    super();

    this.basePanel = Objects.requireNonNull(basePanel);
    this.searchQueryHighlightObservable = new SearchQueryHighlightObservable();

    currentResults.setFont(currentResults.getFont().deriveFont(Font.BOLD));

    caseSensitive = new JToggleButton(IconTheme.JabRefIcon.CASE_SENSITIVE.getSmallIcon(),
            Globals.prefs.getBoolean(JabRefPreferences.SEARCH_CASE_SENSITIVE));
    caseSensitive.setToolTipText(Localization.lang("Case sensitive"));
    caseSensitive.addActionListener(e -> {
        performSearch();
        updatePreferences();
    });

    regularExp = new JToggleButton(IconTheme.JabRefIcon.REG_EX.getSmallIcon(),
            Globals.prefs.getBoolean(JabRefPreferences.SEARCH_REG_EXP));
    regularExp.setToolTipText(Localization.lang("regular expression"));
    regularExp.addActionListener(e -> {
        performSearch();
        updatePreferences();
    });

    openCurrentResultsInDialog = new JButton(IconTheme.JabRefIcon.OPEN_IN_NEW_WINDOW.getSmallIcon());
    openCurrentResultsInDialog.setToolTipText(Localization.lang("Show search results in a window"));
    openCurrentResultsInDialog.addActionListener(ae -> {
        SearchResultsDialog searchDialog = new SearchResultsDialog(basePanel.frame(),
                Localization.lang("Search results in database %0 for %1",
                        basePanel.getBibDatabaseContext().getDatabaseFile().getName(),
                        this.getSearchQuery().localize()));
        List<BibEntry> entries = basePanel.getDatabase().getEntries().stream().filter(BibEntry::isSearchHit)
                .collect(Collectors.toList());
        searchDialog.addEntries(entries, basePanel);
        searchDialog.selectFirstEntry();
        searchDialog.setVisible(true);
    });
    openCurrentResultsInDialog.setEnabled(false);

    // Init controls
    setLayout(new WrapLayout(FlowLayout.LEFT));

    searchIcon = new JLabel(IconTheme.JabRefIcon.SEARCH.getSmallIcon());
    this.add(searchIcon);
    initSearchField();
    if (OS.OS_X) {
        searchField.putClientProperty("JTextField.variant", "search");
    }
    this.add(searchField);

    JButton clearSearchButton = new JButton(IconTheme.JabRefIcon.CLOSE.getSmallIcon());
    clearSearchButton.setToolTipText(Localization.lang("Clear"));
    clearSearchButton.addActionListener(l -> endSearch());

    this.add(clearSearchButton);

    searchModeButton = new JButton();
    updateSearchModeButtonText();
    searchModeButton.addActionListener(l -> toggleSearchModeAndSearch());

    JToolBar toolBar = new OSXCompatibleToolbar();
    toolBar.setFloatable(false);
    toolBar.add(clearSearchButton);
    toolBar.addSeparator();
    toolBar.add(regularExp);
    toolBar.add(caseSensitive);
    toolBar.addSeparator();
    toolBar.add(searchModeButton);
    toolBar.addSeparator();
    toolBar.add(openCurrentResultsInDialog);
    globalSearch = new JButton(Localization.lang("Search globally"));
    globalSearch.setToolTipText(Localization.lang("Search in all open databases"));
    globalSearch.addActionListener(l -> {
        AbstractWorker worker = new GlobalSearchWorker(basePanel.frame(), getSearchQuery());
        worker.run();
        worker.update();
    });
    globalSearch.setEnabled(false);
    toolBar.add(globalSearch);
    toolBar.addSeparator();
    toolBar.add(new HelpAction(HelpFile.SEARCH));

    this.add(toolBar);
    this.add(currentResults);

    paintBackgroundWhite(this);
}

From source file:org.obiba.onyx.jade.instrument.summitdoppler.VantageABIInstrumentRunner.java

protected JPanel buildFileSelectionSubPanel() {
    final JPanel panel = new JPanel();

    panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
    panel.add(Box.createVerticalGlue());

    JButton openButton = new JButton(resourceBundle.getString("Select_file"));
    openButton.setMnemonic('O');
    openButton.setToolTipText(resourceBundle.getString("ToolTip.Select_file"));
    panel.add(openButton);//  w ww .  j a v  a2s .  c  o  m
    panel.add(Box.createRigidArea(new Dimension(10, 10)));

    JLabel fileLabel = new ABIFileLabel();
    panel.add(fileLabel);

    // Open button listener.
    openButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            int returnVal = fileChooser.showOpenDialog(appWindow);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                abiFile = fileChooser.getSelectedFile();
                panel.repaint();
                saveButton.setEnabled(true);
            }
        }
    });

    panel.setAlignmentX(Component.LEFT_ALIGNMENT);

    return panel;
}

From source file:org.obiba.onyx.jade.instrument.summitdoppler.VantageABIInstrumentRunner.java

/**
 * Build action buttons sub panel/*w  w w  . j a v a2 s  .c  o m*/
 */
protected JPanel buildActionButtonSubPanel() {

    // Add the action buttons sub panel.
    JPanel panel = new JPanel();
    panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));

    JButton cancelButton = new JButton(resourceBundle.getString("Cancel"));
    cancelButton.setMnemonic('A');
    cancelButton.setToolTipText(resourceBundle.getString("ToolTip.Cancel_measurement"));
    panel.add(Box.createHorizontalGlue());
    panel.add(saveButton);
    panel.add(Box.createRigidArea(new Dimension(10, 0)));
    panel.add(cancelButton);

    // Save button listener.
    saveButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            sendOutputToServer();
        }
    });

    // Cancel button listener.
    cancelButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            confirmOnExit();
        }
    });

    panel.setAlignmentX(Component.LEFT_ALIGNMENT);

    return (panel);
}

From source file:be.nbb.demetra.dfm.DfmExecViewTopComponent.java

@Override
public JComponent getToolbarRepresentation() {
    JToolBar toolBar = NbComponents.newInnerToolbar();
    toolBar.addSeparator();//from w  w  w  . j  a v a 2 s .co  m
    toolBar.add(Box.createRigidArea(new Dimension(5, 0)));

    JToggleButton startStop = (JToggleButton) toolBar
            .add(new JToggleButton(StartStopCommand.INSTANCE.toAction(this)));
    startStop.setIcon(DemetraUiIcon.COMPILE_16);
    startStop.setDisabledIcon(createDisabledIcon(startStop.getIcon()));
    startStop.setToolTipText("Start/Stop");

    JButton edit = toolBar.add(EditSpecCommand.INSTANCE.toAction(this));
    edit.setIcon(DemetraUiIcon.PREFERENCES);
    edit.setDisabledIcon(createDisabledIcon(edit.getIcon()));
    edit.setToolTipText("Specification");

    JButton clear = toolBar.add(ClearCommand.INSTANCE.toAction(this));
    clear.setIcon(DemetraUiIcon.EDIT_CLEAR_16);
    clear.setDisabledIcon(createDisabledIcon(clear.getIcon()));
    clear.setToolTipText("Clear");

    SwingColorSchemeSupport colorSchemeSupport = SwingColorSchemeSupport
            .from(DemetraUI.getInstance().getColorScheme());
    sparkline = (ChartPanel) toolBar
            .add(Charts.avoidScaling(new ChartPanel(Charts.createSparkLineChart(null))));
    sparkline.setPreferredSize(new Dimension(150, 16));
    sparkline.setMaximumSize(new Dimension(150, 16));
    sparkline.getChart().getXYPlot().setDataset(dataset);
    sparkline.getChart().getXYPlot().getRenderer()
            .setBasePaint(colorSchemeSupport.getLineColor(ColorScheme.KnownColor.GREEN));
    sparkline.setBackground(colorSchemeSupport.getPlotColor());
    sparkline.setBorder(BorderFactory.createLineBorder(colorSchemeSupport.getGridColor()));
    sparkline.setToolTipText("loglikelihood");

    return toolBar;
}

From source file:captureplugin.drivers.defaultdriver.AdditionalParams.java

/**
 * Create List-Panel//from w  w w . j a  va 2s. c  om
 * @return List-Panel
 */
private Component createListPanel() {
    JPanel panel = new JPanel(new BorderLayout(0, 2));
    panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));

    panel.add(new JLabel(mLocalizer.msg("command", "Command")), BorderLayout.NORTH);

    mList = new JList(mListModel);
    panel.add(new JScrollPane(mList), BorderLayout.CENTER);

    JPanel buttons = new JPanel(new FlowLayout(FlowLayout.LEFT));

    JButton add = new JButton(TVBrowserIcons.newIcon(TVBrowserIcons.SIZE_SMALL));
    add.setToolTipText(Localizer.getLocalization(Localizer.I18N_ADD));
    add.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            addPressed();
        }

    });

    buttons.add(add);

    JButton remove = new JButton(TVBrowserIcons.delete(TVBrowserIcons.SIZE_SMALL));
    remove.setToolTipText(Localizer.getLocalization(Localizer.I18N_DELETE));

    remove.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            removePressed();
        }

    });

    buttons.add(remove);

    final JButton up = new JButton(TVBrowserIcons.up(TVBrowserIcons.SIZE_SMALL));
    up.setToolTipText(Localizer.getLocalization(Localizer.I18N_UP));
    buttons.add(up);

    up.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            upPressed();
        }

    });

    final JButton down = new JButton(TVBrowserIcons.down(TVBrowserIcons.SIZE_SMALL));
    down.setToolTipText(Localizer.getLocalization(Localizer.I18N_DOWN));
    buttons.add(down);

    down.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            downPressed();
        }

    });

    mStartStop = new JButton(mStartIcon);
    mStartStop.setToolTipText(mLocalizer.msg("startstop", "Activate or Deactivate Parameter"));

    mStartStop.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            startStopPressed();
        }
    });

    buttons.add(mStartStop);

    panel.add(buttons, BorderLayout.SOUTH);

    mList.addListSelectionListener(new ListSelectionListener() {

        public void valueChanged(ListSelectionEvent e) {
            selectionChanged();
            if (mList.getSelectedIndex() == 0) {
                up.setEnabled(false);
                down.setEnabled(true);
            } else if (mList.getSelectedIndex() == mListModel.getSize() - 1) {
                up.setEnabled(true);
                down.setEnabled(false);
            } else {
                up.setEnabled(true);
                down.setEnabled(true);
            }
        }

    });

    selectionChanged();
    return panel;
}

From source file:org.drugis.addis.gui.builder.NetworkMetaAnalysisView.java

private JButton createSaveDataButton() {
    final JButton button = new JButton("Open in GeMTC");
    button.setToolTipText("Open for analysis in drugis.org GeMTC");
    button.addActionListener(new ActionListener() {
        @Override//from w  w w.  j a  v  a 2  s .co  m
        public void actionPerformed(final ActionEvent arg0) {
            openGeMTC();
        }
    });
    return button;
}