JDK-6216005 : JDialog - textfield fails to accept keyboard input.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: orion3
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2005-01-11
  • Updated: 2006-04-06
  • Resolved: 2005-09-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b53Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
I have an issue with JDialog box in JDK1.5/JDK1.6 on Red Hat Linux Advanced Server release 2.1AS/i686.
The text field in the dialogbox does not accept keyboard input, even
though i see the cursor blinking in the text field. The workaround is
to click on some other component in the dialog and back to textfield.

I tried to reproduce the problem in a sample application, but the
problem does not seem to occur. In my application also it does not
appear consistently.

Here is the code. I have created the same exact steps my app is using.
I will file a bug.

/*
 * DlgTest.java
 *
 * Created on January 5, 2005, 2:12 PM
 */
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
/**
 *
 * @author  vp151719
 */
public class DlgTest {
        static class MyDialog extends JDialog {
        MyDialog(Frame fr, String title, boolean modal) {
            super(fr,modal);
            JTextField tf = new JTextField();
            setTitle(title);       
            //getContentPane().setLayout(new GridBagLayout());
            setModal(true);
            setLocation(100,100);
            getContentPane().add(tf);
            pack();
        }
    }
        /** Creates a new instance of DlgTest */
    public DlgTest() {
    }
        public static void main(String s[])  {
        final JFrame fr = new JFrame("DlgTest");
        JButton b = new JButton("Show Dialog");
        b.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e) {
                MyDialog d = new MyDialog(fr,"Hello",true);
                d.setVisible(true);
                d.setModal(true);
            }
        });
        fr.getContentPane().add(b);
        fr.pack();
        fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        fr.setVisible(true);
    }
}
###@###.### 2005-1-11 08:37:38 GMT

Comments
EVALUATION I tried to reproduce it with XToolkit remotely. Nor with Tiger nor with Mustang I was able to reproduce the bug. I guess it requires farther investigation. ###@###.### 2005-04-15 08:40:04 GMT Looks as a duplicate of 6183877 "typeAhead characters are not always processed". ###@###.### 2005-05-06 12:49:39 GMT
15-04-2005