Adding textbox to a pane
<p>I am trying to add a simple textbox to my class of type <code>JDialog</code> but it does not seem to work, I don't know what I am doing wrong:</p>

<pre><code>    Container pane = getContentPane();      

    JPanel panel = new JPanel();
    pane.add(panel);
    JTextField userText = new JTextField(20);
    userText.setBounds(100, 10, 160, 25);
    pane.setVisible(true);

    panel.add(userText);
    panel.setLayout(null);
</code></pre>