Example usage for javax.swing JLabel setToolTipText

List of usage examples for javax.swing JLabel setToolTipText

Introduction

In this page you can find the example usage for javax.swing JLabel 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.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel.java

private JComponent buildToolbar() {
    JXToolBar toolBar = UISupport.createToolbar();
    JButton runButton = UISupport.createToolbarButton(runAction);
    toolBar.add(runButton);//from   w w  w  .  java2 s .c  o m
    toolBar.add(Box.createHorizontalGlue());
    JLabel label = new JLabel("<html>Script is invoked with <code>log</code>, <code>context</code> "
            + "and <code>testRunner</code> variables</html>");
    label.setToolTipText(label.getText());
    label.setMaximumSize(label.getPreferredSize());

    toolBar.add(label);
    toolBar.addRelatedGap();
    toolBar.add(UISupport.createToolbarButton(new ShowOnlineHelpAction(HelpUrls.GROOVYSTEPEDITOR_HELP_URL)));

    componentEnabler.add(runButton);

    return toolBar;
}

From source file:gov.loc.repository.bagger.ui.NewBagInPlaceFrame.java

private void layoutProfileSelectionContent(JPanel contentPane, int row) {
    // content/*  ww  w  .j a  va 2 s  .co  m*/
    // profile selection
    JLabel bagProfileLabel = new JLabel(bagView.getPropertyMessage("Select Profile:"));
    bagProfileLabel.setToolTipText(bagView.getPropertyMessage("bag.projectlist.help"));

    profileList = new JComboBox(bagView.getProfileStore().getProfileNames());
    profileList.setName(bagView.getPropertyMessage("bag.label.projectlist"));
    profileList.setSelectedItem(bagView.getPropertyMessage("bag.project.noproject"));
    profileList.setToolTipText(bagView.getPropertyMessage("bag.projectlist.help"));

    GridBagConstraints glbc = new GridBagConstraints();

    JLabel spacerLabel = new JLabel();
    glbc = LayoutUtil.buildGridBagConstraints(0, row, 1, 1, 5, 50, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.WEST);
    contentPane.add(bagProfileLabel, glbc);
    glbc = LayoutUtil.buildGridBagConstraints(1, row, 1, 1, 40, 50, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.CENTER);
    contentPane.add(profileList, glbc);
    glbc = LayoutUtil.buildGridBagConstraints(2, row, 1, 1, 40, 50, GridBagConstraints.NONE,
            GridBagConstraints.EAST);
    contentPane.add(spacerLabel, glbc);
}

From source file:gov.loc.repository.bagger.ui.NewBagInPlaceFrame.java

private void layoutBagVersionContent(JPanel contentPanel, int row) {
    GridBagConstraints glbc = new GridBagConstraints();

    JLabel bagVersionLabel = new JLabel(bagView.getPropertyMessage("bag.label.version"));
    bagVersionLabel.setToolTipText(bagView.getPropertyMessage("bag.versionlist.help"));
    ArrayList<String> versionModel = new ArrayList<String>();
    Version[] vals = Version.values();//  ww w .ja  va2s .  c  o  m
    for (int i = 0; i < vals.length; i++) {
        versionModel.add(vals[i].versionString);
    }

    bagVersionList = new JComboBox(versionModel.toArray());
    bagVersionList.setName(bagView.getPropertyMessage("bag.label.versionlist"));
    bagVersionList.setSelectedItem(Version.V0_96.versionString);
    bagVersionList.setToolTipText(bagView.getPropertyMessage("bag.versionlist.help"));

    glbc = LayoutUtil.buildGridBagConstraints(0, row, 1, 1, 1, 50, GridBagConstraints.NONE,
            GridBagConstraints.WEST);
    contentPanel.add(bagVersionLabel, glbc);
    glbc = LayoutUtil.buildGridBagConstraints(1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.WEST);
    contentPanel.add(bagVersionList, glbc);
}

From source file:cool.pandora.modeller.ui.jpanel.base.NewBagInPlaceFrame.java

/**
 * layoutProfileSelectionContent.//from  ww w  . j a va  2 s . c  o  m
 *
 * @param contentPane JPanel
 * @param row         int
 */
private void layoutProfileSelectionContent(final JPanel contentPane, final int row) {
    // content
    // profile selection
    final JLabel bagProfileLabel = new JLabel(bagView.getPropertyMessage("Select Profile:"));
    bagProfileLabel.setToolTipText(bagView.getPropertyMessage("bag.projectlist.help"));

    profileList = new JComboBox<>(bagView.getProfileStore().getProfileNames());
    profileList.setName(bagView.getPropertyMessage("bag.label.projectlist"));
    profileList.setSelectedItem(bagView.getPropertyMessage("bag.project.noproject"));
    profileList.setToolTipText(bagView.getPropertyMessage("bag.projectlist.help"));

    GridBagConstraints glbc = new GridBagConstraints();

    final JLabel spacerLabel = new JLabel();
    glbc = LayoutUtil.buildGridBagConstraints(0, row, 1, 1, 5, 50, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.WEST);
    contentPane.add(bagProfileLabel, glbc);
    glbc = LayoutUtil.buildGridBagConstraints(1, row, 1, 1, 40, 50, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.CENTER);
    contentPane.add(profileList, glbc);
    glbc = LayoutUtil.buildGridBagConstraints(2, row, 1, 1, 40, 50, GridBagConstraints.NONE,
            GridBagConstraints.EAST);
    contentPane.add(spacerLabel, glbc);
}

From source file:com.rapidminer.gui.plotter.charts.HistogramChart.java

@Override
public JComponent getOptionsComponent(int index) {
    if (index == 0) {
        return logScaleBox;
    } else if (index == 1) {
        return getRotateLabelComponent();
    } else if (index == 2) {
        JLabel label = new JLabel("Number of Bins");
        label.setToolTipText("Set the number of bins which should be displayed.");
        return label;
    } else if (index == 3) {
        return binNumberSlider;
    } else if (index == 4) {
        JLabel label = new JLabel("Opaqueness");
        label.setToolTipText("Sets the amount of opaqueness / transparency.");
        return label;
    } else if (index == 5) {
        return opaquenessSlider;
    } else {/*from  w w  w  . j av  a  2  s.  c om*/
        return null;
    }
}

From source file:gov.loc.repository.bagger.ui.NewBagInPlaceFrame.java

private void layoutAddKeepFilesToEmptyCheckBox(JPanel contentPane, int row) {
    // Delete Empty Folder(s)
    JLabel addKeepFilesToEmptyFoldersCheckBoxLabel = new JLabel(
            bagView.getPropertyMessage("bag.label.addkeepfilestoemptyfolders"));
    addKeepFilesToEmptyFoldersCheckBoxLabel
            .setToolTipText(bagView.getPropertyMessage("bag.addkeepfilestoemptyfolders.help"));
    addKeepFilesToEmptyFoldersCheckBox = new JCheckBox(bagView.getPropertyMessage(""));
    addKeepFilesToEmptyFoldersCheckBox.setSelected(bag.isAddKeepFilesToEmptyFolders());
    addKeepFilesToEmptyFoldersCheckBox.addActionListener(new AddKeepFilesToEmptyFoldersHandler());

    GridBagConstraints glbc = new GridBagConstraints();

    JLabel spacerLabel = new JLabel();
    glbc = LayoutUtil.buildGridBagConstraints(0, row, 1, 1, 5, 50, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.WEST);
    contentPane.add(addKeepFilesToEmptyFoldersCheckBoxLabel, glbc);
    glbc = LayoutUtil.buildGridBagConstraints(1, row, 1, 1, 40, 50, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.CENTER);
    contentPane.add(addKeepFilesToEmptyFoldersCheckBox, glbc);
    glbc = LayoutUtil.buildGridBagConstraints(2, row, 1, 1, 40, 50, GridBagConstraints.NONE,
            GridBagConstraints.EAST);
    contentPane.add(spacerLabel, glbc);//w  ww. j av  a 2s. com
}

From source file:net.nosleep.superanalyzer.analysis.views.SummaryView.java

private void addStatTriple(JPanel panel, StringTriple triple) {

    JLabel wordLabel = new JLabel(triple.Name + ": ");
    wordLabel.setOpaque(false);// w ww . ja  va 2  s .  c  o m
    wordLabel.setFont(Theme.getFont(12));
    wordLabel.setHorizontalAlignment(JLabel.RIGHT);
    panel.add(wordLabel);

    JLabel wordField = new JLabel();
    wordField.setOpaque(false);
    wordField.setFont(Theme.getBoldFont(12));
    wordField.setBorder(new javax.swing.border.EmptyBorder(1, 1, 1, 1));
    wordField.setForeground(Theme.getColorSet()[0]);
    panel.add(wordField);

    wordField.setText(triple.Value);
    wordField.setToolTipText(Misc.getTooltip(triple.Info));
}

From source file:cool.pandora.modeller.ui.jpanel.base.NewBagInPlaceFrame.java

/**
 * layoutAddKeepFilesToEmptyCheckBox./*w w  w . j a v  a 2  s.c  om*/
 *
 * <p>Setting and displaying the ".keep Files in Empty Folder(s):" Check Box
 * on the Create Bag In Place Pane
 */
private void layoutAddKeepFilesToEmptyCheckBox(final JPanel contentPane, final int row) {
    // Delete Empty Folder(s)
    final JLabel addKeepFilesToEmptyFoldersCheckBoxLabel = new JLabel(
            bagView.getPropertyMessage("bag.label" + ".addkeepfilestoemptyfolders"));
    addKeepFilesToEmptyFoldersCheckBoxLabel
            .setToolTipText(bagView.getPropertyMessage("bag" + ".addkeepfilestoemptyfolders" + ".help"));
    final JCheckBox addKeepFilesToEmptyFoldersCheckBox = new JCheckBox(bagView.getPropertyMessage(""));
    addKeepFilesToEmptyFoldersCheckBox.setSelected(bag.isAddKeepFilesToEmptyFolders());
    addKeepFilesToEmptyFoldersCheckBox.addActionListener(new AddKeepFilesToEmptyFoldersHandler());

    GridBagConstraints glbc = new GridBagConstraints();

    final JLabel spacerLabel = new JLabel();
    glbc = LayoutUtil.buildGridBagConstraints(0, row, 1, 1, 5, 50, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.WEST);
    contentPane.add(addKeepFilesToEmptyFoldersCheckBoxLabel, glbc);
    glbc = LayoutUtil.buildGridBagConstraints(1, row, 1, 1, 40, 50, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.CENTER);
    contentPane.add(addKeepFilesToEmptyFoldersCheckBox, glbc);
    glbc = LayoutUtil.buildGridBagConstraints(2, row, 1, 1, 40, 50, GridBagConstraints.NONE,
            GridBagConstraints.EAST);
    contentPane.add(spacerLabel, glbc);
}

From source file:com.rapidminer.gui.plotter.charts.WebPlotter.java

@Override
public JComponent getOptionsComponent(int index) {
    switch (index) {
    case 0:/*from  w  ww .  j  av  a 2s .c  o m*/
        JLabel label = new JLabel("Aggregation:");
        label.setToolTipText(
                "Select the type of the aggregation function which should be used for grouped values.");
        return label;
    case 1:
        return aggregationFunction;
    case 2:
        return useDistinct;
    default:
        return null;
    }
}

From source file:components.LabelDemo.java

public LabelDemo() {
    super(new GridLayout(3, 1)); //3 rows, 1 column
    JLabel label1, label2, label3;

    ImageIcon icon = createImageIcon("images/middle.gif", "a pretty but meaningless splat");

    //Create the first label.
    label1 = new JLabel("Image and Text", icon, JLabel.CENTER);
    //Set the position of its text, relative to its icon:
    label1.setVerticalTextPosition(JLabel.BOTTOM);
    label1.setHorizontalTextPosition(JLabel.CENTER);

    //Create the other labels.
    label2 = new JLabel("Text-Only Label");
    label3 = new JLabel(icon);

    //Create tool tips, for the heck of it.
    label1.setToolTipText("A label containing both image and text");
    label2.setToolTipText("A label containing only text");
    label3.setToolTipText("A label containing only an image");

    //Add the labels.
    add(label1);/* w ww. j  ava2s.c  om*/
    add(label2);
    add(label3);
}