• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Event dispatch

 
Alex Wolf
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
like.... HHHEEEELLLLPPP

please...

tried implements AWTEventListener but eventDispatched never gets called...
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Alex Wolf
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gotcha. thanks for the info both of you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic