Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trapping events (JDK 1.2)

Status
Not open for further replies.

brownie124

Programmer
Sep 19, 2002
61
US
Hi,

I want to prevent my window from being iconified. I see that I can set up a window listener and implement the method
Code:
windowIconified()
. However, that is after the fact. I want to capture it before it happens and discard or consume the event. Or, better yet, prevent the event from ever being sent to the event queue.

How do I go about this.

Thanks,
- Brownie
 
Tried that. That only prevents you from grabbing the window edge and making it larger or smaller.
 
A "stupid" solution :

Code:
    f.addWindowListener(new WindowAdapter() {
       public void windowIconified(WindowEvent evt) {
         //System.out.println("Iconified");
         f.setState(Frame.NORMAL);
       }
    });
 
As of jdk1.4 you could use

f.setUndecorated(true);

(This method can only be called while the frame is not displayable).
 
Well, the Frame.NORMAL solution would definitely get a laugh. That is actually a good joke to play on somone.

I knew about the 1.4 setUndecorated() method. Believe me, my life would be so much easier if I could use the current version of the JDK.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top