0

I have the following simple question. Is it possible for someone to have two Java Swing application windows from which events could be captured?

I have the following scenario. I have an app which runs on a touch enabled device running Windows 7. Said app spawns another child JFrame. Now, if I click on the parent frame, I get the window's focus and I can perform actions. Doing the same on the child frame also does the same getting the focus from the parent.

What I want to do, is to be able to handle click events on both screens - that is don't block the other frame when someone is interacting with the other one.

Is there a way to do something like that?

James_D
  • 201,275
  • 16
  • 291
  • 322
akortex
  • 5,067
  • 2
  • 25
  • 57
  • See [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/q/9554636/418556) In this case, the 'child' frame should probably be a non-modal (non-blocking) `JDialog`. *"What I want to do, is to be able to handle click events on both screens"* Add a `MouseListener` to both and it should work even as described. I don't think I understand either the situation, the requirement, or both. For better help sooner, post a [MCVE] or [Short, Self Contained, Correct Example](http://www.sscce.org/). – Andrew Thompson Sep 25 '17 at 18:40
  • 1
    Answer this - can the OS actually do this? That is, can the OS have two windows with user focus at the same time? – MadProgrammer Sep 25 '17 at 20:56
  • @AndrewThompson my main concern is not handling click events on two screens. Maybe I did not phrase the question well enough, but what I want to achieve is to have concurrent usage (and thus event handling) on both screens. That is one user being able to use one screen at the same time as another user is using the other screen. – akortex Sep 26 '17 at 11:34
  • ..hmmmm. I think the comment of @MadProgrammer is the key to this. – Andrew Thompson Sep 26 '17 at 20:35

0 Answers0