when to call setBounds(), setLocation(), ...



Hello.
I'm using BoxLayout and I can't get components to show as I want. I create components, do setBounds on them, make everything visible and it dosen't work! It only works if I set bounds after I show them (make them visible).. why? Of course I want to set where the components will be displayed first and then display them, not display them and then move them around... help? Below is example of the problem.

-------------------------------------------------------
import java.awt.Dimension;
import javax.swing.*;

public class TFrame extends JFrame {
JTextField tf1 = new JTextField("Test 1");

public TFrame() {
super("TEST");
setLayout(new BoxLayout(getContentPane(), BoxLayout.X_AXIS));
setDefaultCloseOperation(EXIT_ON_CLOSE);

tf1.setBounds(50,50,200,75); // dosen't work
tf1.setMaximumSize(new Dimension(200,75));
add(tf1);
setBounds(0,0,400,200);
setVisible(true);
// tf1.setBounds(175,50,200,75); // this works
}

public static void main(String[] args) {
new TFrame();
System.out.println("Tnx a lot comp.lang.java.gui! :)");
}

} // end of class
------------------------------------------------
.