Thanks John and Jeff.
Here's my minimal code
import java.awt.*;
import javax.swing.*;
public class LoginFrame extends JFrame implements KeyListener
{
XYLayout layout;
javax.swing.JPasswordField Password;
public LoginFrame(
String args[])
{
layout = new XYLayout(369,151,0);
getContentPane().setLayout(null);
setVisible(false);
setSize(369,151);
setFont(new Font("Dialog",Font.PLAIN,12));
setBackground(new Color(12632256));
Password = new javax.swing.JPasswordField();
Password.setEchoChar("0");
Password.setBounds(100,39,208,22);
getContentPane().add(Password);
// Adding Ok and Cancel Buttons along with Key listeners
}
public void setVisible(boolean b)
{
if(b)
{
setLocation(300,300)
}
super.setVisible(b);
}
// other methods for KeyListener
}
public class MainPrg extends JFrame
{
static public void main(String args[])
{
LoginFrame login = new LoginFrame(args);
login.setVisible(true);
//login.repaint() // didnt work
//login.validate() // didn't work - only blank frame at the start
}
}
Please lemme know this code snippet helps to figure out the problem.
I would restate the problem. On running the MainPrg, at the start only a blank frame, without the password field and the buttons, appears. But on just dragging the frame around the frame appears with the password field and the buttons. This problems has cropped up only after the update to XP. While I was using windows 2000 this worked fine. Moreover it still works fine on a Windows 2000 machine. Please help me out.
Thanks
Bharath S