-
Bug
-
Resolution: Fixed
-
P4
-
1.1.6, 1.2.0
-
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
}
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
}
- duplicates
-
JDK-4126296 Adding Solaris AWT Panel cause FocusLost event to be generated
-
- Closed
-