Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4201986

Swing Tooltips not honoring desktop setting for tooltip font

XMLWordPrintable

    • beta
    • x86
    • windows_nt



      Name: dbT83986 Date: 01/10/99


      In the Windows Look&Feel, the ToolTip font that is set on the
      desktop, via the Desktop -> Properties -> Appearance menu, is
      not being used. Only the background color is being used, but
      not the foreground or font/font-style.

      To see the bug, change the settings for the desktop tooltip
      appearance and watch how the Swing Tooltip doesn't pick up
      the change.

      As an added bonus, the test program below should display the
      clipping bug whereby tooltips don't extend outside the bounds
      of the frame(under some circumstances) :-(


      //~~~~~~~~~~~~~~~~~~~~~~~~~ cut here ~~~~~~~~~~~~~~~~~~~~~~
      import javax.swing.*;
      import java.awt.*;
      import java.awt.event.*;

      class tooltipFontBug {
          public static void main (String args[]) {
              try {
                  UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              } catch (Exception e) {e.printStackTrace();}

              JFrame frame = new JFrame();
              frame.addWindowListener(new WindowAdapter() {
                  public void windowClosing(WindowEvent e) {System.exit(0);}
              });

              JButton b = new JButton("I'm a button");
              b.setToolTipText("Here is my example tooltip text");

              frame.getContentPane().add(b);
              frame.pack();
              frame.setVisible(true);
          }
      }
      (Review ID: 52366)
      ======================================================================

            amfowler Anne Fowler (Inactive)
            dblairsunw Dave Blair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: