How do I get the properties of an external window which is dragged by mouse? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How do I get the properties of an external window which is dragged by mouse?

Hi Ho, i want to create a grid where I can drag a window into it and the window should resize to the grid, when I drop it. The problem is that I don't know how I can get the position and the size from external window and how to set it. And I do not know how to recognize that you pull a window. I thought it would work with a DropTargetListener, but it only detects files.

13th Oct 2019, 1:24 PM
1337element
1337element - avatar
6 Answers
0
have you try getLocation on the jframe ? i cant test it rn.
13th Oct 2019, 1:35 PM
Taste
Taste - avatar
0
The window are not created by me. It is for example a open PDF or something else.
13th Oct 2019, 1:37 PM
1337element
1337element - avatar
0
so you dont have an access to jframe object ?
13th Oct 2019, 1:38 PM
Taste
Taste - avatar
0
Yeah correct.
13th Oct 2019, 1:39 PM
1337element
1337element - avatar
0
you cant, you'll need the object.
13th Oct 2019, 1:43 PM
Taste
Taste - avatar
0
Hm maybe I need new library to get the object from external window but I don't have experience with it. When you or someone else have an idea which library can do this would it be great.
13th Oct 2019, 1:55 PM
1337element
1337element - avatar