Java 8 JToolTip - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 JToolTip class.

This code example shows how to use the following methods:getFont, getHeight, getInsets, getWidth
This code example shows how to use the following methods:isShowing, setTipText
        } 
        if (text.isEmpty()) {
            text = " "; /* can't be "" */
        } 
        super.setToolTipText(text);
        toolTip.setTipText(text);
        if (toolTip != null && toolTip.isShowing() && robot != null) {
            final GraphicsDevice[] devices = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
            int xOffset = 0;
            if (devices.length >= 2) {
                /* workaround for dual monitors that are flipped. */ 
                //TODO: not sure how is it with three monitors 
                final int x1 = devices[0].getDefaultConfiguration().getBounds().x;
                final int x2 = devices[1].getDefaultConfiguration().getBounds().x;
                if (x1 > x2) {
                    xOffset = -x1;
                } 
            } 
            final Point2D p = MouseInfo.getPointerInfo().getLocation();
            robot.mouseMove((int) p.getX() + xOffset - 1, (int) p.getY());
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setBackground
 
    @Override 
    public final JToolTip createToolTip() {
        toolTip = super.createToolTip();
        if (toolTipBackground != null) {
            toolTip.setBackground(toolTipBackground);
        } 
        return toolTip;
    } 
 
    @Override 
    public final void setToolTipBackground(final Color toolTipBackground) {
        this.toolTipBackground = toolTipBackground;
    } 
 
    @Override 
    public final void setToolTipText(final String simulationToolTip) {
        this.simulationResultToolTip = simulationToolTip;
        updateToolTip(); 
    } 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setBorder
    } 
 
    @Override 
    public JToolTip createToolTip() {
        JToolTip tip = super.createToolTip();
        tip.setBorder(HOVER_BORDER);
        return tip;
    } 
 
} 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setBorder
    } 
 
    public JToolTip createToolTip() {
        JToolTip tip = super.createToolTip();
        Border border = new CustomLineBorder(5, App.THEME.getHoverBorderColor(), 2);
        tip.setBorder(border);
        return tip;
    } 
} 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setBackground
    @Override 
    public JToolTip createToolTip() {
 
        JToolTip tooltip = super.createToolTip();
 
        tooltip.setBackground(new Color(255, 255, 140, 128));
 
        this.repaint(); // TODO: will this bog us down?
 
        return tooltip;
 
    } 
 
    @Override 
    public String getToolTipText(java.awt.event.MouseEvent e) {
 
        for (int r = 0; r < rings.size(); r++) {
            Ring ring = rings.get(r);
 
            for (int index = 0; index < ring.count(); index++) {
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setBorder
    } 
 
    @Override 
    public JToolTip createToolTip() {
        JToolTip tip = super.createToolTip();
        tip.setBorder(HOVER_BORDER);
        return tip;
    } 
} 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getPreferredSize, setPreferredSize, setTipText
This code example shows how to use the following methods:
													boolean isSelected,      // is the cell selected
													boolean cellHasFocus ) { // the list and the cell have the focus
 
			JLabel lbl = (JLabel)value;
 
			JToolTip tool = new JToolTip();
			lbl.setOpaque(true);
			lbl.setBorder(null);
 
			return lbl;
		} 
	} 
} 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setComponent
	} 
 
	public JToolTip createToolTip() {
		if (getToolTipText().startsWith("<html>")) {
			JToolTip tip = new HyperLinkToolTip();
			tip.setComponent(this);
			return tip;
		} else { 
			return super.createToolTip(); 
		} 
	} 
	 
	public void paintComponent(Graphics graphics) {
		boolean none =  (getSelectedIndex() <= 0);
		setForeground(none ? UIManager.getColor("ComboBox.foreground") : Color.RED); //$NON-NLS-1$
		super.paintComponent(graphics);
	} 
	public void transformBasedOnValue() { 
		CommonTransformFactory factory = (CommonTransformFactory)getSelectedItem();
		((TransformComboBoxModel)getModel()).changeTransform(factory);
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Java 8 JToolTip Methods: