Example usage for javax.swing JScrollPane setToolTipText

List of usage examples for javax.swing JScrollPane setToolTipText

Introduction

In this page you can find the example usage for javax.swing JScrollPane 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:org.eurocarbdb.application.glycoworkbench.plugin.s3.gui.LoginLocalFolderPanel.java

private void initGui() {
    // Textual information.
    String descriptionText = "<html><center>"
            + "Your AWS Credentials are stored in encrypted files in a folder on "
            + "your computer. Each stored login has a nickname."
            + "<br><font size=\"-2\">You need to store your AWS credentials before you can use this login method.</font>"
            + "</center></html>";
    String folderTooltipText = "The folder containing your AWS Credentials";
    String browseButtonText = "Change Folder";
    String accountNicknameText = "Stored logins";
    String accountNicknameTooltipText = "Nicknames of the login credentials you have stored";
    String passwordLabelText = "Password";
    String passwordTooltipText = "The password that protects your encrypted file. "
            + "This password may be left empty if you are sure your computer cannot be compromised";

    // Components.
    JHtmlLabel descriptionLabel = new JHtmlLabel(descriptionText, hyperlinkListener);
    descriptionLabel.setHorizontalAlignment(JLabel.CENTER);
    folderPathTextField = new JTextField(this.cockpitHomeFolder.getAbsolutePath());
    folderPathTextField.setEnabled(false);
    folderPathTextField.setToolTipText(folderTooltipText);
    JButton browseButton = new JButton(browseButtonText);
    browseButton.addActionListener(this);
    JHtmlLabel accountNicknamesLabel = new JHtmlLabel(accountNicknameText, hyperlinkListener);
    nicknamesTableModel = new AWSCredentialsFileTableModel();
    accountNicknameTable = new JTable(nicknamesTableModel);
    accountNicknameTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    accountNicknameTable.setShowHorizontalLines(true);
    accountNicknameTable.getTableHeader().setVisible(false);
    JScrollPane accountNicknamesScrollPane = new JScrollPane(accountNicknameTable);
    accountNicknamesScrollPane.setToolTipText(accountNicknameTooltipText);
    JHtmlLabel passwordLabel = new JHtmlLabel(passwordLabelText, hyperlinkListener);
    passwordPasswordField = new JPasswordField();
    passwordPasswordField.setToolTipText(passwordTooltipText);

    int row = 0;/*from   w w  w . j a  v a  2s  . co  m*/
    add(descriptionLabel, new GridBagConstraints(0, row++, 2, 1, 0, 0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, insetsDefault, 0, 0));
    add(folderPathTextField, new GridBagConstraints(0, row, 1, 1, 1, 0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
    add(browseButton, new GridBagConstraints(1, row++, 1, 1, 0, 0, GridBagConstraints.EAST,
            GridBagConstraints.NONE, insetsDefault, 0, 0));
    add(accountNicknamesLabel, new GridBagConstraints(0, row++, 2, 1, 0, 0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, insetsDefault, 0, 0));
    add(accountNicknamesScrollPane, new GridBagConstraints(0, row++, 2, 1, 0, 1, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, insetsDefault, 0, 0));
    add(passwordLabel, new GridBagConstraints(0, row++, 2, 1, 0, 0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
    add(passwordPasswordField, new GridBagConstraints(0, row++, 2, 1, 1, 0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
}

From source file:org.jets3t.apps.cockpit.gui.LoginLocalFolderPanel.java

private void initGui() {
    // Textual information.
    String descriptionText = "<html><center>" + "Your credentials are stored in encrypted files in a folder on "
            + "your computer. Each stored login has a nickname."
            + "<br><font size=\"-2\">You need to store your credentials before you can use this login method.</font>"
            + "</center></html>";
    String folderTooltipText = "The folder containing your credentials";
    String browseButtonText = "Change Folder";
    String accountNicknameText = "Stored logins";
    String accountNicknameTooltipText = "Nicknames of the login credentials you have stored";
    String passwordLabelText = "Password";
    String passwordTooltipText = "The password that protects your encrypted file. "
            + "This password may be left empty if you are sure your computer cannot be compromised";

    // Components.
    JHtmlLabel descriptionLabel = new JHtmlLabel(descriptionText, hyperlinkListener);
    descriptionLabel.setHorizontalAlignment(JLabel.CENTER);
    folderPathTextField = new JTextField(this.cockpitHomeFolder.getAbsolutePath());
    folderPathTextField.setEnabled(false);
    folderPathTextField.setToolTipText(folderTooltipText);
    JButton browseButton = new JButton(browseButtonText);
    browseButton.addActionListener(this);
    JHtmlLabel accountNicknamesLabel = new JHtmlLabel(accountNicknameText, hyperlinkListener);
    nicknamesTableModel = new ProviderCredentialsFileTableModel();
    accountNicknameTable = new JTable(nicknamesTableModel);
    accountNicknameTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    accountNicknameTable.setShowHorizontalLines(true);
    accountNicknameTable.getTableHeader().setVisible(false);
    JScrollPane accountNicknamesScrollPane = new JScrollPane(accountNicknameTable);
    accountNicknamesScrollPane.setToolTipText(accountNicknameTooltipText);
    JHtmlLabel passwordLabel = new JHtmlLabel(passwordLabelText, hyperlinkListener);
    passwordPasswordField = new JPasswordField();
    passwordPasswordField.setToolTipText(passwordTooltipText);

    int row = 0;//from www  .  java 2s.c o m
    add(descriptionLabel, new GridBagConstraints(0, row++, 2, 1, 0, 0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, insetsDefault, 0, 0));
    add(folderPathTextField, new GridBagConstraints(0, row, 1, 1, 1, 0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
    add(browseButton, new GridBagConstraints(1, row++, 1, 1, 0, 0, GridBagConstraints.EAST,
            GridBagConstraints.NONE, insetsDefault, 0, 0));
    add(accountNicknamesLabel, new GridBagConstraints(0, row++, 2, 1, 0, 0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, insetsDefault, 0, 0));
    add(accountNicknamesScrollPane, new GridBagConstraints(0, row++, 2, 1, 0, 1, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, insetsDefault, 0, 0));
    add(passwordLabel, new GridBagConstraints(0, row++, 2, 1, 0, 0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
    add(passwordPasswordField, new GridBagConstraints(0, row++, 2, 1, 1, 0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
}