-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
None
-
1.1.3
-
None
-
sparc
-
solaris_2.5.1
Name: rlT66838 Date: 07/17/97
I am trying to have focus sent to a TextField
when a Dialog window is created/shown, but this
only works if the "window" is either a Frame or
a Dialog with modal=false. See the following code
segment:
public class CLLogin
{
public CLLogin(Frame parent)
{
super(parent, "Login Screen", true);
// Set size
setBounds(400,400,330,175);
setResizable(false);
// Set font
Font font = new Font("Dialog", Font.BOLD, 16);
setFont(font);
// Set colors
setForeground(Color.black);
setBackground(Color.lightGray);
addComponents();
show();
addWindowListener(new WindowAdapter()
{
public void windowActivated(WindowEvent event)
{
userNameText.requestFocus();
}
});
}
}
Where addComponents() adds 2 TextFields with Labels
and an OK/Cancel Button.
======================================================================
- relates to
-
JDK-4178187 requestFocus not working in 1.1.7
- Closed