Jframe

Discussion in 'Java' started by Francois Lionet, Mar 31, 2007.

  1. Hello,

    In my application, I open a JFrame, and I need this frame to be
    caption-less. Can someone tell me how to get rid of the title bar and the
    border?

    Thank you!
    Francois
     
    Francois Lionet, Mar 31, 2007
    #1
    1. Advertising

  2. On Mar 31, 6:13 pm, "Francois Lionet" <> wrote:
    ....
    > In my application, I open a JFrame, and I need this frame to be
    > caption-less. Can someone tell me how to get rid of the title bar and the
    > border?


    <sscce>
    import javax.swing.*;

    class UndecoratedFrame {

    public static void main(String[] args) {
    JFrame f = new JFrame();
    f.setUndecorated(true);
    f.getContentPane().add(
    new JLabel("How do you close me?"));
    f.pack();
    f.setLocationRelativeTo(null);
    f.setVisible(true);
    }
    }
    </sscce>

    Andrew T.
     
    Andrew Thompson, Mar 31, 2007
    #2
    1. Advertising

  3. Francois Lionet

    Mark Space Guest

    Francois Lionet wrote:
    > Hello,
    >
    > In my application, I open a JFrame, and I need this frame to be
    > caption-less. Can someone tell me how to get rid of the title bar and the
    > border?
    >
    > Thank you!
    > Francois
    >
    >


    Why not just use JWindow?
     
    Mark Space, Mar 31, 2007
    #3
  4. On Apr 1, 2:04 am, Mark Space <> wrote:
    > Francois Lionet wrote:

    ...
    > > In my application, I open a JFrame, and I need this frame to be
    > > caption-less. Can someone tell me how to get rid of the title bar and the
    > > border?

    ...
    > Why not just use JWindow?


    Excellent question.

    (..but please trim replies of sigs., and other
    unnecessary text)

    Andrew T.
     
    Andrew Thompson, Mar 31, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Passero
    Replies:
    6
    Views:
    3,275
    Tassilo Horn
    Jul 5, 2003
  2. René Kikkenborg

    JFrame URL Link

    René Kikkenborg, Jul 8, 2003, in forum: Java
    Replies:
    1
    Views:
    1,766
    René Kikkenborg
    Jul 9, 2003
  3. Passero
    Replies:
    2
    Views:
    416
    Roedy Green
    Jul 12, 2003
  4. jakester
    Replies:
    3
    Views:
    1,898
    jakester
    Apr 3, 2007
  5. Replies:
    2
    Views:
    439
    markspace
    Aug 27, 2012
Loading...

Share This Page