Results 1 to 2 of 2
  1. #1
    valery is offline Member
    Join Date
    Jul 2007
    Rep Power

    Default How to close a JFrame

    When I offer a prompt to close a window (JFrame), and the user chooses No or Cancel, I am using the following:

    Java Code:

    but the window disappears, and a blank square overlays the main window and buttons.
    I don't want that
    Do you have any ideas to solve this?

  2. #2
    gabriel is offline Member
    Join Date
    Jul 2007
    Rep Power


    Try revalidate() or invalidate()/validate() + repaint() on your main window.

Similar Threads

  1. close a frame..
    By tajinvillage in forum New To Java
    Replies: 5
    Last Post: 04-27-2008, 11:22 PM
  2. Frame close operation
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-21-2007, 09:39 AM
  3. How to close JDBC Connection
    By Heather in forum JDBC
    Replies: 2
    Last Post: 07-15-2007, 02:07 PM
  4. Close a JDialog Programmatically
    By Marcus in forum Advanced Java
    Replies: 1
    Last Post: 07-06-2007, 05:06 PM
  5. What could be causing the browser to close?
    By Marcus in forum Java Applets
    Replies: 2
    Last Post: 07-04-2007, 08:26 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