title: Swing applet componets are invisable untill interacted with
body: <p>I am trying to make a applet with a simple login screen, if I use normal components it works fine but if I use swing components the object wont show up until it is clicked on. I would use regular components but i need a masked password field (if there is a non swing version please let me know).</p>
  
  <p>I am trying to get a vertical placement in the top left corner.</p>
  
  <pre><code>public class RdpApplet extends JApplet {
     JButton Connect;
     JTextField Username;
     JPasswordField Password;
     JLabel UsernameLabel;
     JLabel PasswordLabel;
  
     //(Snip)
  
     public void paint(Graphics g){
     }
     public void start(){
     }
     public void stop(){
     }
     public void init(){
         SwingUtilities.invokeLater(new Runnable() {
          public void run() {
             JPanel panel = new JPanel (new GridBagLayout());
             GridBagConstraints gbc = new GridBagConstraints();
             gbc.insets = new Insets(2,5,1,1);
             gbc.weightx = 1.0;
             gbc.anchor = GridBagConstraints.WEST;
             gbc.gridwidth = GridBagConstraints.REMAINDER;
  
             UsernameLabel = new JLabel("Username:");
             panel.add(UsernameLabel,gbc);
  
             Username = new JTextField(15);
             panel.add(Username,gbc);
  
             PasswordLabel = new JLabel("Password:");
             panel.add(PasswordLabel,gbc);
  
             Password = new JPasswordField(15);
             panel.add(Password,gbc);
  
             Connect = new JButton("Connect");
             panel.add(Connect,gbc);
             gbc.weighty = 1.0;
             gbc.anchor = gbc.NORTHWEST;
  
             setLayout(new FlowLayout(FlowLayout.LEFT));
             add(panel);
             validate();
             panel.validate();
         }});
     }
  
     //(Snip)
  }
  </code></pre>
  
  <p>If I use JButton and JTextField and JLabel the items do not show up until i interact with them(click on the text field, mouse over for the button, I cant get the label to show up) and if I use the normal versions I get the ugly gray backgrounds around the labels.</p>
  
  <p>Can anyone help show me what I am doing wrong to get everything working properly.</p>
  
  <p>EDIT:
  Changing from Applet to JApplet did not solve the problem.</p>
  
  <p>EDIT2:
  added other methods.</p>
  
  <p>EDIT3:
  Cursor now starts in the user name box but everything is still invisible until interacted with. Updated code with all of the latest suggestions.</p>