Results 1 to 7 of 7
  1. #1
    Aswq is offline Member
    Join Date
    Jul 2008
    Posts
    10
    Rep Power
    0

    Default Remove Maxi and min option from title bar

    Hi All

    I have frame and i want to remove maximaize and minimiaze option from title bar of frame and only showing close option.I try through
    Java Code:
     frame.setUndecorated(false);
            frame.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
    But i haven't got solution.Can any one tell me how can i do that..

    Thx's in advance

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    8

    Default

    This seemed to do it.
    Java Code:
    f.setUndecorated(true);
    f.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);

  3. #3
    Aswq is offline Member
    Join Date
    Jul 2008
    Posts
    10
    Rep Power
    0

    Default

    Quote Originally Posted by hardwired View Post
    This seemed to do it.
    Java Code:
    f.setUndecorated(true);
    f.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
    Thxs for reply..It is working..

    One more problem when i use
    Java Code:
    dispose();
    then it is showing error.So plz tell me how i dispose the frame when i click the Login button..

    Plz help me..

  4. #4
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    8

    Default

    I'd have to see the error.

  5. #5
    Aswq is offline Member
    Join Date
    Jul 2008
    Posts
    10
    Rep Power
    0

    Default

    Quote Originally Posted by hardwired View Post
    I'd have to see the error.
    Ok it is working...Sir how can i show in center of windows.Right now it is showing on Left-upper corner. So can you tell me sir..

    Plz Help me

  6. #6
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    8

    Default

    Java Code:
    // superclass Component method
    frame.setLocation(x, y);
    // superclass Window method
    frame.setLocationRelativeTo(null);  // centered

  7. #7
    Aswq is offline Member
    Join Date
    Jul 2008
    Posts
    10
    Rep Power
    0

    Default

    Quote Originally Posted by hardwired View Post
    Java Code:
    // superclass Component method
    frame.setLocation(x, y);
    // superclass Window method
    frame.setLocationRelativeTo(null);  // centered
    Thx's It is working..

Similar Threads

  1. the -eprof option?
    By GVD in forum Advanced Java
    Replies: 2
    Last Post: 01-10-2008, 01:48 PM
  2. Hiding the frameís title bar
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-21-2007, 08:41 AM
  3. How to alter the title of JOptionPane
    By mew in forum New To Java
    Replies: 2
    Last Post: 12-17-2007, 10:39 AM
  4. Getting values of an Option List
    By mutuah in forum Advanced Java
    Replies: 0
    Last Post: 08-07-2007, 03:42 AM
  5. Is there a way to remove an option from optionsCollection?
    By schu777 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 08-02-2007, 09:47 PM

Posting Permissions

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