Results 1 to 6 of 6
  1. #1
    RickAintree is offline Member
    Join Date
    Dec 2010
    Posts
    22
    Rep Power
    0

    Default How do you remove the X in the Title Bar in a Jframe

    Can you at lease disable it so It cannot be clicked so the user would not get the wrong idea. I already no how to set it to DO_NOTHING_ON_CLOSE but the user still keeps pressing the X waiting for something to happen. please help me

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,435
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by RickAintree View Post
    Can you at lease disable it so It cannot be clicked so the user would not get the wrong idea. I already no how to set it to DO_NOTHING_ON_CLOSE but the user still keeps pressing the X waiting for something to happen. please help me
    Why don't you supply some visual feed back (a dialog box?) telling the user that clicking that button isn't going to do anything.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    RickAintree is offline Member
    Join Date
    Dec 2010
    Posts
    22
    Rep Power
    0

    Default

    Is there a way to make the X button grayed out like the Minimize/Maximize button. I will do what you asked but I still want to no if it is possible. Thanx

  4. #4
    RickAintree is offline Member
    Join Date
    Dec 2010
    Posts
    22
    Rep Power
    0

    Default

    My boss wants either the X button to be grayed out or removed. Please I was researching for a while now and cannot find a way to achieve this. Is it even possible.

  5. #5
    rizowski is offline Member
    Join Date
    Nov 2010
    Posts
    37
    Rep Power
    0

    Default

    You can't remove close Button from JFrames, but you can disable by calling setDefaultCloseOperation(WindowConstants.DO_NOTHIN G_ON_CLOSE) on that JFrame. [1]

    [1]

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,435
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by RickAintree View Post
    My boss wants either the X button to be grayed out or removed. Please I was researching for a while now and cannot find a way to achieve this. Is it even possible.
    Maybe the JFrame.setDefaultLookAndFeelDecorated( ... ) method can be of help. Read its API documentation for an explanation and a bit of example code.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. jList - add/remove items and query - using jFrame Form
    By ArneBassez in forum AWT / Swing
    Replies: 2
    Last Post: 12-01-2010, 12:42 PM
  2. Dynamically changing the title of the JFrame??
    By Y. Progammer in forum New To Java
    Replies: 2
    Last Post: 03-15-2010, 09:20 AM
  3. Right-clicking a rectangle on a JFrame to remove it
    By busdude in forum New To Java
    Replies: 4
    Last Post: 02-20-2009, 02:44 AM
  4. Remove Maxi and min option from title bar
    By Aswq in forum New To Java
    Replies: 6
    Last Post: 07-22-2008, 08:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •