How to setup focus for JFrame

Discussion in 'Java' started by RomaHBC, Nov 12, 2009.

  1. RomaHBC

    RomaHBC

    Joined:
    Nov 12, 2009
    Messages:
    2
    Likes Received:
    0
    Hi,
    Is anyone knows how to pop up a frame.
    When my frame is called it is behind the calling window. So I need to minimize calling window and see the frame. However when I call it for the second time it is on top. Is it possible to force my frame to be on top from the first time? Could it be because of Windows XP or Internet Explorer settings? I already tried toFront, show, setVissible etc.

    JFrame frame = new JFrame("TA MESSAGE");
    //frame.toFront();
    //frame.show();
    //frame.setLocationRelativeTo(null);
    //frame.setVisible(true);

    JTextField zone1 = new JTextField();
    JTextField slot1 = new JTextField("", 2);
    Object[] message = new Object[]
    {
    "ZONE:", zone1, "SLOT:", slot1
    };

    Thanks
     
    RomaHBC, Nov 12, 2009
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.