-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.4.0
-
generic
-
generic
Name: yyT116575 Date: 06/12/2001
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)
let says "textInput" is javax.swing.JTextField/JTextPane/JTextArea/any "text
input component"
textinput.setToolTipText("anytext");
1) click on the textinput component, to give it a 'focus'.
2) now, 'caret' will blinking in the textinput component.
3) move the mouse pointer to the textinput component,
and stop over it.
4) tooltip of the textinput component will popped up,
and 'caret' disappeared.
note: not test with AWT components yet and it doesn't happen in
Solaris 7 platform.
----
see the screenshots at
http://bacteria.thethai.net/bugs/j2se14b/inputmethod1/lost_focus.html
small test program (has JTextField, JTextPane, JTextArea),
public class inputTest extends java.awt.Frame {
private javax.swing.JPanel jPanel1;
private javax.swing.JLabel FontName1;
private javax.swing.JTextField TextField1;
private javax.swing.JLabel FontName2;
private javax.swing.JTextField TextField2;
private javax.swing.JLabel FontName3;
private javax.swing.JTextField TextField3;
private javax.swing.JLabel FontName4;
private javax.swing.JPasswordField TextField4;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel4;
private javax.swing.JLabel jLabel2;
private javax.swing.JTextArea jTextArea2;
private javax.swing.JPanel jPanel3;
private javax.swing.JLabel jLabel1;
private javax.swing.JTextPane jTextPane;
public inputTest() {
initComponents ();
pack ();
}
private void initComponents () {
setLayout (new java.awt.GridLayout (2, 1));
setResizable (false);
String frameTitle;
frameTitle = "Thai Input Test @ VM: "+System.getProperty("java.vm.name")
+" "+System.getProperty("java.vm.version")+" ("
+System.getProperty("java.vm.info")+" "+System.getProperty("java.compiler")
+") OS: "+System.getProperty("os.name")+" "+System.getProperty("os.version");
setTitle (frameTitle);
addWindowListener (new java.awt.event.WindowAdapter () {
public void windowClosing (java.awt.event.WindowEvent evt) {
exitForm (evt);
}
}
);
jPanel1 = new javax.swing.JPanel ();
jPanel1.setPreferredSize (new java.awt.Dimension(620, 300));
FontName1 = new javax.swing.JLabel ();
FontName1.setPreferredSize (new java.awt.Dimension(100, 14));
FontName1.setText ("AngsanaUPC");
FontName1.setFont (new java.awt.Font ("Courier", 0, 12));
jPanel1.add (FontName1);
TextField1 = new javax.swing.JTextField ();
TextField1.setToolTipText ("Angsana 50 Plain");
TextField1.setPreferredSize (new java.awt.Dimension(500, 85));
TextField1.setFont (new java.awt.Font ("AngsanaUPC", 0, 50));
jPanel1.add (TextField1);
FontName2 = new javax.swing.JLabel ();
FontName2.setPreferredSize (new java.awt.Dimension(100, 14));
FontName2.setText ("BrowalliaUPC");
FontName2.setFont (new java.awt.Font ("Courier", 0, 12));
jPanel1.add (FontName2);
TextField2 = new javax.swing.JTextField ();
TextField2.setToolTipText ("BrowalliaUPC 36 Plain");
TextField2.setPreferredSize (new java.awt.Dimension(500, 70));
TextField2.setFont (new java.awt.Font ("BrowalliaUPC", 0, 36));
jPanel1.add (TextField2);
FontName3 = new javax.swing.JLabel ();
FontName3.setPreferredSize (new java.awt.Dimension(100, 14));
FontName3.setText ("CordiaUPC");
FontName3.setFont (new java.awt.Font ("Courier", 0, 12));
jPanel1.add (FontName3);
TextField3 = new javax.swing.JTextField ();
TextField3.setToolTipText ("CordiaUPC 32 Plain");
TextField3.setPreferredSize (new java.awt.Dimension(500, 50));
TextField3.setFont (new java.awt.Font ("CordiaUPC", 0, 32));
jPanel1.add (TextField3);
FontName4 = new javax.swing.JLabel ();
FontName4.setPreferredSize (new java.awt.Dimension(100, 14));
FontName4.setText ("Password Field");
FontName4.setFont (new java.awt.Font ("Dialog", 0, 16));
jPanel1.add (FontName4);
TextField4 = new javax.swing.JPasswordField ();
TextField4.setToolTipText ("Must be masked");
TextField4.setPreferredSize (new java.awt.Dimension(500, 30));
TextField4.setFont (new java.awt.Font ("Dialog", 0, 20));
TextField4.setEchoChar('#');
jPanel1.add (TextField4);
add (jPanel1);
jPanel2 = new javax.swing.JPanel ();
jPanel2.setLayout (new java.awt.GridLayout (1, 2));
jPanel2.setPreferredSize (new java.awt.Dimension(620, 300));
jPanel4 = new javax.swing.JPanel ();
jLabel2 = new javax.swing.JLabel ();
jLabel2.setText ("JTextArea");
jLabel2.setFont (new java.awt.Font ("Dialog", 0, 12));
jPanel4.add (jLabel2);
jTextArea2 = new javax.swing.JTextArea ();
jTextArea2.setToolTipText ("Dialog (AWT)");
jTextArea2.setPreferredSize (new java.awt.Dimension(300, 250));
jTextArea2.setFont (new java.awt.Font("Dialog", java.awt.Font.PLAIN, 16));
jPanel4.add (jTextArea2);
jPanel2.add (jPanel4);
jPanel3 = new javax.swing.JPanel ();
jPanel3.setPreferredSize (new java.awt.Dimension(165, 300));
jLabel1 = new javax.swing.JLabel ();
jLabel1.setText ("JTextPane");
jLabel1.setFont (new java.awt.Font ("Dialog", 0, 12));
jPanel3.add (jLabel1);
jTextPane = new javax.swing.JTextPane ();
jTextPane.setToolTipText ("Dialog (AWT)");
jTextPane.setPreferredSize (new java.awt.Dimension(300, 250));
jTextPane.setFont (new java.awt.Font("Dialog", java.awt.Font.PLAIN, 16) );
jPanel3.add (jTextPane);
jPanel2.add (jPanel3);
add (jPanel2);
pack ();
java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
java.awt.Dimension dialogSize = getSize();
setSize (new java.awt.Dimension (630, 600));
setLocation((screenSize.width-630)/2, (screenSize.height-600)/2);
}
private void exitForm(java.awt.event.WindowEvent evt) {
System.exit (0);
}
public static void main (String args[]) {
new inputTest ().show ();
}
}
(Review ID: 126368)
======================================================================
- duplicates
-
JDK-4432422 ToolTips over a heavy-weight window causes the app to lose focus.
- Closed