 <p>I'm not sure if this is you intention, but it's weird to me...</p> <p>First, you declare a class that extends from <code>JFrame</code>...</p> <pre><code>public class login extends JFrame { </code></pre> <p>Then you declare a instance variable of the same class...</p> <pre><code>JFrame login = new JFrame(); </code></pre> <p>You than add all your components to this instance...</p> <pre><code>login.add(panel1); login.add(panel2); login.add(panel3); </code></pre> <p>Now, I can't see how you are using this, but I imagine you are doing something like...</p> <pre><code>login login = new login() login.setVisible(true); </code></pre> <p>Which basically, doesn't show anything...</p> <p>Instead. Rather than extending from <code>JFrame</code>, I would extend from <code>JPanel</code> and drop the <code>login</code> instance variable.</p> <p>Create a instance of <code>login</code> and then add it to a <code>JFrame</code> instance that you have created...</p> <p>I also recommend that you take a look at <a href="http://www.oracle.com/technetwork/java/codeconv-138413.html" rel="nofollow">Code Conventions for the Java Programming Language</a></p>