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

Merlin-Beta-b54, No Text Bounding box in JButton after JToolTip is displayed

XMLWordPrintable

    • x86
    • generic



      Name: jbT81659 Date: 03/09/2001

      OS: All windows platforms but not linux or solaris(sparc or intel)
      JDK: Merlin-Beta-b54

      Displaying a JToolTip causes text bounding box to disappear in JButton.
      Repaint of window (Uncover event) redisplays text bounding box.

      To reproduce bug:
      Please compile and run the following code:
      - Hold the mouse over a JButton for a couple of seconds.
      - Note that JToolTip is displayed.
      - Move the mouse slowly over other buttons.
      - Note that JToolTip is displayed for each JButton
      - Note that text bounding box disappears as JToolTip is displayed.
      - When text bounding box disappers minimize application window then open it again
      - Note that text bounding box is displayed again.
      To activate and diactivate JToolTip from keyboard press "Ctrl+F1"
      - Select a JButton
      - Note that text bounding box is displayed
      - Press "Ctrl+F1" to activate JToolTip
      - Note that JToolTip is displayed for the selected JButton
      - Note that text bounding box disappeard
      - Minimize application window then open it again
      - Note that text bounding box is displayed again

      ===========Code============
      /* Copyright (c) Sun Microsystems 1998

      $Header: /home/sun/src/JDK1.2/jToolTip.java,v 1.14 2000/03/30 08:13:08 isam Exp $

      */

      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;

      public class jToolTip extends JApplet
      {
              public void init()
              {
                      TooltipPanel1 tooltip = new TooltipPanel1();
                      getContentPane().add(tooltip);
              }

              public static void main(String[] argv)
              {
              JFrame frame = new JFrame("\u0645\u062b\u0627\u0644");
              frame.setContentPane(new TooltipPanel1());
              frame.pack();
              frame.setVisible(true);
              frame.addWindowListener( new WindowAdapter()
              {
                   public void windowClosing( WindowEvent e)
                   {
                       System.exit(0);
                   }
              });
              }
      }
      class TooltipPanel1 extends JPanel
      {
              public TooltipPanel1()
              {
                      setLayout(new GridLayout(5,1));
                      UIManager.getDefaults().put("ToolTip.font",new Font("Lucida Sans Regular" , Font.PLAIN, 16));

                      JButton Button1 = new JButton();
                      JToolTip Button1TT = new JToolTip();

                      Button1TT.setFont(new Font("Lucida Sans Regular",Font.PLAIN,12));
                      Button1.setToolTipText ("\u0647\u0630\u0627\u0020\u064a\u0648\u0645\u0020\u0644\u0637\u064a\u0641\u0020\u05d6\u05d4\u0020\u05d9\u05d5\u05dd\u0020\u05e0\u05e2\u05d9\u05dd" );
                      Button1.add(Button1TT);

                      Button1.setFont(new Font("Lucida Sans Regular",Font.PLAIN,12));
                      Button1.setText("\u062a\u0641\u0627\u062d\u0020\u0623\u062d\u0645\u0631\u0020\u0643\u0628\u064a\u0631\u0020\u0042\u0049\u0047\u0020\u0052\u0045\u0044\u0020\u0041\u0050\u0050\u004c\u0045\u0053\u0665\u0667\u0669\u0661");

                      JButton Button2 = new JButton();
                      Button2.setFont(new Font("Lucida Sans Regular",Font.PLAIN,12));
                      Button2.setText("\u05d6\u05d5\u0020\u05e9\u05e0\u05d4\u0020\u05d9\u05e4\u05d4\u0020\u0054\u0048\u0045\u0020\u0059\u0045\u0041\u0052\u0020\u0031\u0039\u0035\u0038");
                      Button2.setToolTipText ("\u05d6\u05d5\u0020\u05e9\u05e0\u05d4\u0020\u05d9\u05e4\u05d4\u0020\u0054\u0048\u0045\u0020\u0059\u0045\u0041\u0052\u0020\u0031\u0039\u0035\u0038");

                      JButton Button3 = new JButton();
                      Button3.setFont(new Font("Lucida Sans Regular",Font.PLAIN,12));
                      Button3.setText("\u05ea\u05e4\u05d5\u05d6\u05d9\u05dd\u0020\u05d8\u05e2\u05de\u05d9\u05dd\u0020\u006c\u0069\u006d\u0065\u0020\u0069\u0073\u0020\u0067\u0072\u0065\u0065\u006e");
                      Button3.setToolTipText ("\u05ea\u05e4\u05d5\u05d6\u05d9\u05dd\u0020\u05d8\u05e2\u05de\u05d9\u05dd\u0020\u006c\u0069\u006d\u0065\u0020\u0069\u0073\u0020\u0067\u0072\u0065\u0065\u006e");

                      JButton Button4 = new JButton();
                      Button4.setFont(new Font("Lucida Sans Regular",Font.PLAIN,12));
                      Button4.setText("\u006c\u0069\u006d\u0065\u0020\u0069\u0073\u0020\u0067\u0072\u0065\u0065\u006e\u05d7\u05d5\u05de\u05d5\u05e1\u0020\u05d9\u05e7\u05e8");
                      Button4.setToolTipText ("\u006c\u0069\u006d\u0065\u0020\u05d7\u05d5\u05de\u05d5\u05e1\u0020\u05d9\u05e7\u05e8\u0069\u0073\u0020\u0067\u0072\u0065\u0065\u006e");

                      JButton Button5 = new JButton();
                      Button5.setFont(new Font("Lucida Sans Regular",Font.PLAIN,12));
                      Button5.setText("\u05d7\u05d5\u05de\u05d5\u05e1\u0020\u006c\u0069\u006d\u0065\u0020\u0069\u0073\u0020\u0067\u0072\u0065\u0065\u006e\u0020\u05d9\u05e7\u05e8");
                      Button5.setToolTipText ("\u062a\u0641\u0627\u062d\u0020\u0623\u062d\u0645\u0631\u0020\u0643\u0628\u064a\u0631");
                      add(Button1);
                      add(Button2);
                      add(Button3);
                      add(Button4);
                      add(Button5);
              }
      }
      ==========================
      ======================================================================

            dmikhalksunw Denis Mikhalkin (Inactive)
            jbenavrasunw Jonathan Benavraham (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: