JToolTip.setFont
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using javax.swing.JToolTip.setFont (Showing top 7 results out of 315)

  • Common ways to obtain JToolTip
private void myMethod () {
JToolTip j =
  • new JToolTip()
  • JComponent jComponent;jComponent.createToolTip()
  • JLabel jLabel;jLabel.createToolTip()
  • Smart code suggestions by Codota
}
origin: org.netbeans.modules/org-netbeans-modules-gsf

public void setFont(Font font) {
  super.setFont(font);
  fontMetrics = this.getFontMetrics(font);
  fontHeight = fontMetrics.getHeight();
  
  descent = fontMetrics.getDescent();
  drawFont = font;
}
origin: org.netbeans.modules/org-netbeans-modules-cnd-modelutil

@Override
public void setFont(Font font) {
  super.setFont(font);
  fontMetrics = this.getFontMetrics(font);
  fontHeight = fontMetrics.getHeight();
  ascent = fontMetrics.getAscent();
  drawFont = font;
}
origin: stackoverflow.com

public class Main {
  public static void main(String args[]) {
   JFrame frame = new JFrame("JToolTip Sample");
   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   JButton b1 = new JButton("Button 1") {
    public JToolTip createToolTip() {
     JToolTip tip = super.createToolTip();
     tip.setForeground(Color.YELLOW);
     tip.setBackground(Color.RED);
     tip.setFont(new Font("Arial", Font.BOLD,36));
     return tip;
    }
   };
   b1.setToolTipText("HELLO");
   frame.add(b1, BorderLayout.NORTH);
   frame.setSize(300, 150);
   frame.setVisible(true);
  }
 }
origin: stackoverflow.com

 public class CButton extends JButton
{
  public CButton(String text, Icon icon)
  {
    super(text, icon);
  }

  @Override
  public JToolTip createToolTip()
  {
    JToolTip toolTip = super.createToolTip();
    toolTip.setForeground(Color.BLACK);
    toolTip.setBackground(Color.WHITE);
    toolTip.setFont(new Font("Arial", Font.PLAIN, 12));
    return toolTip;
  }
};
origin: icza/scelight

/**
 * Creates a tool tip with the label's font.
 */
@Override
public JToolTip createToolTip() {
  final JToolTip tt = super.createToolTip();
  
  tt.setFont( getFont() );
  
  return tt;
}
 
origin: icza/scelight

  /**
   * Create a tool tip with the same font that is used in the tree.
   */
  @Override
  public JToolTip createToolTip() {
    final JToolTip tt = super.createToolTip();
    tt.setFont( getFont().deriveFont(
        (float) LEnv.LAUNCHER_SETTINGS.get( LSettings.PAGE_LIST_FONT_SIZE ) ) );
    return tt;
  }
};
origin: com.jidesoft/jide-oss

/**
 * Creates a new tooltip. If overlapping is true then the tooltip will take on the foreground/background color and
 * font of the specified component (if the component isspecifiedd)
 *
 * @param c           the component the tooltip describes
 * @param overlapping whether the tooltip is for a normal or overlapping tooltip
 * @return the new tooltip object
 */
public JToolTip createToolTip(JComponent c, boolean overlapping) {
  JToolTip tt = new JToolTip();
  if (c != null) {
    tt.setComponent(c);
    if (overlapping) {
      if (c.getBackground() != null) {
        Color bg = c.getBackground();
        if (bg.getAlpha() != 255) {
          bg = new Color(bg.getRed(), bg.getGreen(), bg.getBlue());
        }
        tt.setBackground(bg);
      }
      if (c.getForeground() != null) {
        tt.setForeground(c.getForeground());
      }
      if (c.getFont() != null) {
        tt.setFont(c.getFont());
      }
    }
  }
  return tt;
}
javax.swingJToolTipsetFont

Popular methods of JToolTip

  • setTipText
  • getTipText
  • <init>
  • getPreferredSize
  • setBackground
  • setBorder
  • getWidth
  • getComponent
  • getHeight
  • setComponent
  • setForeground
  • add
  • setForeground,
  • add,
  • getInsets,
  • setLayout,
  • setPreferredSize,
  • addMouseListener,
  • getClientProperty,
  • getComponentCount,
  • isShowing

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • getContentResolver (Context)
  • getSystemService (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)