File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Event dispatch Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Event dispatch" Watch "Event dispatch" New topic
Author

Event dispatch

Alex Wolf
Greenhorn

Joined: Aug 24, 2004
Posts: 16
Hi,

I have a window that I want to keep in the back at all times behind all windows. It should ignore mouse clicks, or not ever get to be the front. infact the whole program should be in the background at all times.

how would i go about this?
i have tried adding a mouselistener with mouseClicked( MouseEvent e ) { JFrame.toBack(); }
but thats already too late... because then the window comes to the front and covers all running applications windows before it is sent back and its not what I want.

I think I want to somehow stop the EventDispatcher to not dispatch the event at all... but I need help.
Alex Wolf
Greenhorn

Joined: Aug 24, 2004
Posts: 16
like.... HHHEEEELLLLPPP

please...

tried implements AWTEventListener but eventDispatched never gets called...
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

If by "behind all windows" you mean behind all other applications, there's unfortunately nothing you can do in 100% Java. Events that bring applications to the front -- as opposed to moving individual windows within a single application -- are handled by the OS window system, not by the application.

Some OSs may have an API call that means "show this application on the desktop, but only show it in the very back", but there's no way to do that from Java itself.


[Jess in Action][AskingGoodQuestions]
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
This doesn't sound like a beginner question. In case that you need more help beyond Ernest's comments above, or if you have another similar question, you may want to visit the GUI forum where these kinds of issues are discussed. This particular forum discusses very general Java topics, so I think you will find more help there.

Keep Coding!

Layne


Java API Documentation
The Java Tutorial
Alex Wolf
Greenhorn

Joined: Aug 24, 2004
Posts: 16
gotcha. thanks for the info both of you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Event dispatch