Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3906

Window close & non-resiza

From "Rexx Magnus" <rexx.magnus@THRWHITE.remove-dii-this>
Subject Window close & non-resiza
Message-ID <op.ufguv0z0p9vcmo@macmini.local> (permalink)
Newsgroups comp.lang.java.gui
Date 2011-04-27 15:47 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui

I've been hunting on google rather fruitlessly, trying to find out how to  
make a window non-resizable after creating a desktop application in  
Netbeans 6.1. The properties dialog for the frame don't have one that  
refers to the resizable property, so that's no use. I'm not sure how or  
where to put code to set it to non-resizable (if it's possible)

I'm also trying to find out how to catch the Window Close event so that I  
can save my settings to a file.
I can't find an events menu option that refers to it.

The code that usually comes up for a GUI is something like:
-------------------
public class DesktopApplication1View extends FrameView {

     public DesktopApplication1View(SingleFrameApplication app) {
         super(app);

         initComponents();

	//status bar code etc. (don't use this)

      }

	//about box code here - something else I don't use
	//along with all the other gui generated code.
}
-------------------

Then you've got the code that actually calls the applicationview:
-------------------
package desktopapplication1;

import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;

/**
  * The main class of the application.
  */
public class DesktopApplication1 extends SingleFrameApplication {

     /**
      * At startup create and show the main frame of the application.
      */
     @Override protected void startup() {
         show(new DesktopApplication1View(this));
     }

     /**
      * This method is to initialize the specified window by injecting  
resources.
      * Windows shown in our application come fully initialized from the GUI
      * builder, so this additional configuration is not needed.
      */
     @Override protected void configureWindow(java.awt.Window root) {
     }

     /**
      * A convenient static getter for the application instance.
      * @return the instance of DesktopApplication1
      */
     public static DesktopApplication1 getApplication() {
         return Application.getInstance(DesktopApplication1.class);
     }

     /**
      * Main method launching the application.
      */
     public static void main(String[] args) {
         launch(DesktopApplication1.class, args);
     }
}
-----------------

Obviously my application has all of the code it needs and is working,  
except for the irritating fact that the window is resizable (and needs to  
act more like a dialog or tool, rather than an editor window!) and I'm  
unable to catch the close event so that I can save my data.

Any help would be appreciated!

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Window close & non-resiza "Rexx Magnus" <rexx.magnus@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000
  Re: Window close & non-re "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000
    Re: Window close & non-re "Rexx Magnus" <rexx.magnus@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000
  Re: Window close & non-re "Rexx Magnus" <rexx.magnus@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000
    Re: Window close & non-re "Rexx Magnus" <rexx.magnus@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000
      Re: Window close & non-re "tar" <tar@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000
    Re: Window close & non-re "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000

csiph-web