Search in sources :

Example 1 with JToolTip

use of javax.swing.JToolTip in project felix by apache.

the class TreeNodeCellRenderer method createToolTip.

public JToolTip createToolTip() {
    JToolTip tip = super.createToolTip();
    tip.setBackground(Color.yellow);
    return tip;
}
Also used : JToolTip(javax.swing.JToolTip)

Example 2 with JToolTip

use of javax.swing.JToolTip in project processdash by dtuma.

the class NarrowJMenu method getTooltipOffset.

private static Point getTooltipOffset() {
    JToolTip tip = new JToolTip();
    tip.setTipText("X");
    int delta = tip.getPreferredSize().height + 2;
    return new Point(-40, -delta);
}
Also used : JToolTip(javax.swing.JToolTip) Point(java.awt.Point) Point(java.awt.Point)

Example 3 with JToolTip

use of javax.swing.JToolTip in project UniversalMediaServer by UniversalMediaServer.

the class CustomJTextField method createToolTip.

public JToolTip createToolTip() {
    JToolTip tip = new HyperLinkToolTip();
    tip.setComponent(this);
    return tip;
}
Also used : JToolTip(javax.swing.JToolTip)

Example 4 with JToolTip

use of javax.swing.JToolTip in project UniversalMediaServer by UniversalMediaServer.

the class CustomJButton method createToolTip.

@Override
public JToolTip createToolTip() {
    JToolTip tip = new HyperLinkToolTip();
    tip.setComponent(this);
    return tip;
}
Also used : JToolTip(javax.swing.JToolTip)

Example 5 with JToolTip

use of javax.swing.JToolTip in project jsql-injection by ron190.

the class PanelConsoles method buildI18nTab.

private void buildI18nTab(String keyLabel, String keyTooltip, Icon icon, Component manager, int position) {
    final JToolTipI18n[] j = new JToolTipI18n[] { new JToolTipI18n(I18nView.valueByKey(keyTooltip)) };
    JLabel labelTab = new JLabel(I18nView.valueByKey(keyLabel), icon, SwingConstants.CENTER) {

        @Override
        public JToolTip createToolTip() {
            JToolTip tipI18n = new JToolTipI18n(I18nView.valueByKey(keyTooltip));
            j[0] = (JToolTipI18n) tipI18n;
            return tipI18n;
        }
    };
    labelTab.setName(keyLabel);
    labelTab.addMouseListener(new MouseAdapter() {

        @Override
        public void mousePressed(MouseEvent e) {
            MediatorGui.tabConsoles().setSelectedComponent(manager);
            super.mousePressed(e);
        }
    });
    MediatorGui.tabConsoles().insertTab(I18nView.valueByKey(keyLabel), icon, manager, null, position);
    MediatorGui.tabConsoles().setTabComponentAt(MediatorGui.tabConsoles().indexOfTab(I18nView.valueByKey(keyLabel)), labelTab);
    I18nView.addComponentForKey(keyLabel, labelTab);
    I18nView.addComponentForKey(keyTooltip, j[0]);
    labelTab.setToolTipText(I18nView.valueByKey(keyTooltip));
}
Also used : JToolTip(javax.swing.JToolTip) MouseEvent(java.awt.event.MouseEvent) MouseAdapter(java.awt.event.MouseAdapter) JLabel(javax.swing.JLabel) JToolTipI18n(com.jsql.view.swing.text.JToolTipI18n)

Aggregations

JToolTip (javax.swing.JToolTip)15 Dimension (java.awt.Dimension)3 JToolTipI18n (com.jsql.view.swing.text.JToolTipI18n)2 Point (java.awt.Point)2 MouseAdapter (java.awt.event.MouseAdapter)2 MouseEvent (java.awt.event.MouseEvent)2 JLabel (javax.swing.JLabel)2 JTextArea (javax.swing.JTextArea)2 Unit (games.strategy.engine.data.Unit)1 TripleAUnit (games.strategy.triplea.TripleAUnit)1 TerritoryAttachment (games.strategy.triplea.attachments.TerritoryAttachment)1 UnitAttachment (games.strategy.triplea.attachments.UnitAttachment)1 Font (java.awt.Font)1 FontMetrics (java.awt.FontMetrics)1 KeyEvent (java.awt.event.KeyEvent)1 KeyListener (java.awt.event.KeyListener)1 Popup (javax.swing.Popup)1 PopupFactory (javax.swing.PopupFactory)1