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

ToolTipText takes focus from other components in an applet

XMLWordPrintable

    • beta2
    • generic, x86
    • solaris_2.5.1, windows_nt

      I am including code which can be used to demonstrate the problem. My applet contains two buttons. If I click on one of them, giving it the focus, then move my mouse to the other button and bring up its tooltiptext without clicking, the first button loses focus. This behavior does not occur when I run the same code as an application.

      import java.awt.*;
      import com.sun.java.swing.*;

      public class TTApplet extends JApplet {
      JButton tip1, tip2;
      JPanel test;

      public TTApplet() {
      super();
      }

      public void init() {
      // this applet tests tool tip text

        tip1 = new JButton("Tip One");
      tip1.setToolTipText("Tip Text One");
        tip2 = new JButton("Tip Two");
      tip2.setToolTipText("Tip Text Two");

      test = new JPanel();
              this.getContentPane().setLayout( new BorderLayout() );
        test.add( tip1 );
      Canvas spacer = new Canvas();
      spacer.setSize(50,50);
      test.add( spacer );
              test.add( tip2 );
              this.getContentPane().add( "Center", test );
      this.setVisible(true);

          } //end init

      }

            dmendenhsunw David Mendenhall (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: