Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #3911
| From | "Rexx Magnus" <rexx.magnus@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: Window close & non-re |
| Message-ID | <op.ufgx4vvtp9vcmo@macmini.local> (permalink) |
| Newsgroups | comp.lang.java.gui |
| References | <op.ufguv0z0p9vcmo@macmini.local> |
| Date | 2011-04-27 15:47 +0000 |
| Organization | TDS.net |
To: comp.lang.java.gui
On Wed, 06 Aug 2008 14:10:38 +0100, Rexx Magnus <trashcan@uk2.net> wrote:
>
> 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();
>
Right, managed to sort this out:
this.getFrame().setResizable(false);
this.getFrame().setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
this.getFrame().addWindowListener(new Closer());
In just after the initComponents(); line and added my Closer() routine
elsewhere. One problem remains now though, when you close the window via
the close button, this works - except if you're on a Mac and exit via the
Quit menu (system menu, not one in the frame) it bypasses the routine.
---
* 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 | Next — Previous in thread | Next in thread | Find similar | Unroll 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