Results 1 to 4 of 4

Thread: JFrame problem

  1. #1

    Thread Starter
    Hyperactive Member buddu's Avatar
    Join Date
    Jul 2001
    Location
    India
    Posts
    446

    Exclamation JFrame problem

    How to hide or disabling the Close Button of Jframe in java
    Please help me
    prasad

  2. #2
    Junior Member
    Join Date
    Aug 2001
    Location
    London
    Posts
    31

    how to hide close button

    I do not think that you can(maybe) but you could use a window and then implement other stuff such as dragging etc.
    Why did I ever start learning VB?! I should have been happy with Java.

  3. #3
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Ill have to second that. I didnt see any options to disable or hide the window closing button on a JFrame. JFrame only has two constructors . One empty and one that takes a string.

  4. #4
    VirtuallyVB
    Guest

    Thumbs up

    Check out JFrame's
    public void setDefaultCloseOperation(int operation)

    To make the JFrame behave the same as a Frame instance, use setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE).

    This is the "disable the button" solution, but not the "remove the button" solution.

    As they suggested, you could extend Window and define your own bahavior. Heck, you might even extend JFrame and define your own behavior and look.

Posting Permissions

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



Click Here to Expand Forum to Full Width