How I can get a JFrame to open in the middle of the screen?

Okay, I have been looking for an answer on how I can make a JFrame open in the center of the screen like the JOptionpane's "null" argument does. Maybe, I am putting the wrong words in the search but I can't find any help on this.
Thanks
***Sample***
import java.awt.FlowLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class JFrameProb extends JFrame
     private JLabel someText;
     private JLabel someText2;
     private JLabel someText3;
     public JFrameProb()
          super("Why is this always going to the Corner?");
          setLayout( new FlowLayout() );
          someText = new JLabel("This Window Popped open in the top-left Corner...");
          add(someText);
          someText2 = new JLabel("Is there a way to open in the Center of the Screen?");
          add(someText2);
          someText3 = new JLabel("I know JOptionPane does.");
          add(someText3);
}

JosAH,
I tried using your code but it errored out:
C:\Program Files\Java\jdk1.5.0\PimpThatHo\PimpNameGetter.java:78: cannot find symbol
symbol : variable Centralizer
location: class PimpNameGetter.TextFieldHandler
Centralizer.centralize(comboBox);
^
1 error
Process completed.
So I made a java file for the Cebtralizer Class but it gave me this:
--------------------Configuration: <Default>--------------------
C:\Program Files\Java\jdk1.5.0\PimpThatHo\Centralizer.java:3: cannot find symbol
symbol : class Component
location: class Centralizer
public static void centralize(Component c) {
^
C:\Program Files\Java\jdk1.5.0\PimpThatHo\Centralizer.java:5: cannot find symbol
symbol : class Dimension
location: class Centralizer
Dimension screenSize= Toolkit.getDefaultToolkit().getScreenSize();
^
C:\Program Files\Java\jdk1.5.0\PimpThatHo\Centralizer.java:5: cannot find symbol
symbol : variable Toolkit
location: class Centralizer
Dimension screenSize= Toolkit.getDefaultToolkit().getScreenSize();
^
C:\Program Files\Java\jdk1.5.0\PimpThatHo\Centralizer.java:6: cannot find symbol
symbol : class Dimension
location: class Centralizer
Dimension compSize= c.getPreferredSize();
^
4 errors
Process completed.
I know I am missing packages but I don't know which ones.
Roman03_

Similar Messages

Maybe you are looking for

  • Error while applying patchset 11.1.0.7 to 11.1.0.6

    Hi, I am a new DBA and would appreciate any help on this. I am in the process of upgrading my database from 10.2.0.4 to 11.1.0.7. I installed 11.1.0.6 and was applying the 11.1.0.7 patch. I installed the 11g patchset successfully and was working on '

  • Spool - PDF - Binary - EMail as an attachment

    Hi all, I have a classical report output that I need to send as a PDF attachment in an e-mail. I am converting the spool to PDF using FM CONVERT_ABAPSPOOLJOB_2_PDF. I have a bespoke e-mail framework that recognizes the data only in Binary format. And

  • Foreign JMS Server Limitation

    Hi all,           Iam facing a limitation with Foreign JMS server.           We are tyring to migrate from Message Bridge to Foreign JMS server.           Our current setup is           We have 3 MQ queues which are bridged to one JMS destination(que

  • Installing Web Premium CS4 Student Edition on Laptop After Windows 7 Upgrade Question

    I hope that this hasn't been asked before but my question is the following: I want to upgrade my laptop computer from Windows XP to Windows 7.  But I hear that all programs get uninstalled after installing Windows 7 on a Windows XP machine.  I would

  • FAQ: Can I share on the web without sharing to Facebook?

    FAQ: Can I share on the web without sharing to Facebook? Answer: Yes, GroupPix has a web-sharing feature built in. However, only the owner of the GroupPix Event can control whether it's shared or not. If you go into the GroupPix Event settings, and s