Les dejo el codigo a continuación, gracias por su ayuda!
Código:
import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Point; import java.awt.Toolkit; import java.io.FileNotFoundException; import java.io.IOException; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; public final class Frame extends JFrame { int array; public Frame() throws FileNotFoundException, IOException { super("PruebaFrame"); setVisible(true); setResizable(false); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Point middle = new Point(screenSize.width / 2, screenSize.height / 2); Point newLocation = new Point(middle.x - (getContentPane().getWidth() / 2), middle.y - (getContentPane().getHeight() / 2)); getContentPane().setLocation(newLocation); setSize(650,600); InitComponents();} public void InitComponents() throws FileNotFoundException, IOException{ setLayout(new FlowLayout()); //JLabel PH= new JLabel("Turbidez Rio"); final JTextField textfield = new JTextField(2); getContentPane().add(textfield);} public static void main(String[] args) throws FileNotFoundException, IOException { System.out.println("Funciona Main"); new Frame(); } }