I've been trying to set the location of my text field but it seems that it is only
being generated the the middle of the JFrame
.
I want it in the north left corner, how do I do that? I've add the code of my program.
private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame("Atarim");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Create and set up the content pane.
JComponent newContentPane = new Atarim(frame);
newContentPane.setOpaque(true);
frame.setContentPane(newContentPane);
frame.setLocationRelativeTo(null);
frame.setSize(352, 950);
JTextField textfield = new JTextField("search...");
textfield.setLocation(0, 0);
textfield.setSize(150,20);
textfield.setVisible(true);
newContentPane.add(textfield);
frame.setVisible(true);
}