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


Groups > comp.lang.java.programmer > #18471

Re: How to stop a jframe from being moved

From Eric Sosman <esosman@ieee-dot-org.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: How to stop a jframe from being moved
Date 2012-08-31 10:47 -0400
Organization A noiseless patient Spider
Message-ID <k1qipu$vgc$1@dont-email.me> (permalink)
References <8bfe7cf1-4511-49f7-8637-e1241c945d67@googlegroups.com>

Show all headers | View raw


On 8/31/2012 10:06 AM, clusardi2k@aol.com wrote:
> How can I prevent/stop a jframe from being moved on the monitor.

     What a horrible idea!

     There are lots of ways.  A few of the more sensible:

     - Turn off the monitor.

     - Uninstall the drivers for all user interaction devices.

     - Turn off the computer.

     - Electrocute the user.

     A few of the less sensible:

     - Use a javax.swing.Timer to forcibly reposition the JFrame
       every delta-T milliseconds, thus negating the user's attempt
       to move it.  (For extra credit, play a sound clip of a
       maniacal laugh.)

     - See if there's a way to listen for window movement events,
       and forcibly reposition when/if they occur.  Doesn't look
       like WindowListener will do this, but maybe you can hack
       up some weird combination of WindowFocusListener and
       MouseAdapter to get the notification you need, possibly
       using the JFrame's glass pane.

     - Maybe if you suppress the window decorations there won't
       be a "move window" handle.

     - Maybe using full-screen exclusive mode would help with some
       of the approaches mentioned above.

> Thank you,

     Two words you're unlikely to hear from your users.

     The single most important reason to have a windowing system in
the first place is to allow multiple applications to share display
space and input devices.  When you say "*My* application always
owns this chunk of screen real estate," you are also saying "*My*
application's need for that bit of screen is greater than that
of any other application, *even those I've never imagined.*"  The
ancient Greeks called this attitude "ὕβρις," and displaying ὕβρις
was an excellent way to get yourself punished by the dwellers
on Olympus ...

-- 
Eric Sosman
esosman@ieee-dot-org.invalid

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to stop a jframe from being moved clusardi2k@aol.com - 2012-08-31 07:06 -0700
  Re: How to stop a jframe from being moved Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-08-31 10:47 -0400
    Re: How to stop a jframe from being moved Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-08-31 17:26 +0000
  Re: How to stop a jframe from being moved clusardi2k@aol.com - 2012-08-31 07:57 -0700
  Re: How to stop a jframe from being moved clusardi2k@aol.com - 2012-08-31 08:01 -0700

csiph-web