Results 1 to 6 of 6
  1. #1
    fatabass is offline Senior Member
    Join Date
    Nov 2011
    Location
    Turkey
    Posts
    380
    Blog Entries
    24
    Rep Power
    4

    Default How can I make a JOptionPane undecorated ?

    Is there a way?

    I want this message to appear undecorated:


    Java Code:
    int exitOption = JOptionPane.showConfirmDialog(null,"Are you sure you want to quit this amazing game and go 
    back to your boring life?", "Quit", 0);
    I looked at the API, but couldn't find a way.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: How can I make a JOptionPane undecorated ?

    You can extract the JDialog from the JOptionPane and either make that undecorated, or you could extract the JDialog, get its contentPane and put it in a JWindow.

  3. #3
    fatabass is offline Senior Member
    Join Date
    Nov 2011
    Location
    Turkey
    Posts
    380
    Blog Entries
    24
    Rep Power
    4

    Default Re: How can I make a JOptionPane undecorated ?

    so display a new JFrame, which is undecorated that holds a JOptionPane ?

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: How can I make a JOptionPane undecorated ?

    Quote Originally Posted by fatabass View Post
    so display a new JFrame, which is undecorated that holds a JOptionPane ?
    No, I would either use a JWindow or a JDialog. Have you tried simply undecorating the JDialog extracted from the JOptionPane?

  5. #5
    fatabass is offline Senior Member
    Join Date
    Nov 2011
    Location
    Turkey
    Posts
    380
    Blog Entries
    24
    Rep Power
    4

    Default Re: How can I make a JOptionPane undecorated ?

    I am trying to understand what you mean by "JDialog extracted from the JOptionPane"

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: How can I make a JOptionPane undecorated ?

    Quote Originally Posted by fatabass View Post
    I am trying to understand what you mean by "JDialog extracted from the JOptionPane"
    Please check out the JOptionPane API where you will learn all about this.

Similar Threads

  1. Undecorated JFrame background shadow
    By md_suzon in forum AWT / Swing
    Replies: 6
    Last Post: 10-12-2011, 02:35 AM
  2. Replies: 4
    Last Post: 07-23-2011, 09:08 PM
  3. Help with JOptionPane
    By javaman1 in forum New To Java
    Replies: 6
    Last Post: 11-13-2010, 11:40 PM
  4. need help for JOptionPane....
    By keycoffee in forum New To Java
    Replies: 1
    Last Post: 02-09-2010, 09:59 AM
  5. how to make joptionpane "always on top"
    By kapilverma32 in forum Advanced Java
    Replies: 2
    Last Post: 02-06-2009, 08:57 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
  •