-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.4.0
-
x86
-
windows_nt
Name: ddT132432 Date: 11/07/2001
java version "1.3.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
When calling toFront() on the parent Frame of an applet, the cursor disappears
and cannot be set on a JTextField that is contained within the applet.
Clicking on another application and then back on the applet causes the
cursor/caret to reappear. Here is some sample code that can be used to
reproduce the problem. Type some input into the textfield, then push the
button. Try to type into the text field again!
This problem also occurs when using JDk1.4beta3
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
public class MyApplet extends JApplet {
JButton myButton = new JButton("Push me");
JTextField tf = new JTextField(20);
public void init() {
getContentPane().setLayout( new java.awt.FlowLayout() );
myButton.addActionListener( new ToFrontHandler() );
getContentPane( ).add( myButton );
getContentPane( ).add( tf );
}
Frame getParentFrame() {
return (Frame) SwingUtilities.getAncestorOfClass( Frame.class, this );
}
class ToFrontHandler implements ActionListener {
public void actionPerformed(ActionEvent e) {
Frame frame = getParentFrame();
frame.toFront();
}
}
}
(Review ID: 134616)
======================================================================
- duplicates
-
JDK-4290675 Focus Management Enhancements
- Closed