Jeremy Craig
Jeremy Craig

Reputation: 33

Create a frame with only a visible border to select screen area

I would like to create a frame with only a visible border which is resizable by the user. This application should be able to work as an applet. It should draw a rectangle on the screen which is resizable by the user, upon which it calculates the coordinates of the rectangle on the screen.

https://i.sstatic.net/IpAnS.jpg

enter image description here

The frame should be similar to what you see in http://www.screenr.com/record.

The first problem I am facing is in making the frame invisible with only the borders being visible.

The second problem is that I need to be able to access my desktop contents through the frame (as shown in the diagram), but with standard frames you cannot access anything behind the frame.

Upvotes: 0

Views: 990

Answers (1)

Andrew Thompson
Andrew Thompson

Reputation: 168825

You might use a variant of the code shown on How to get the x and y of a program window in Java?. It obatins a single point, so you'd need to alter it to gain two points (to construct a Rectangle).

This application should be able to work as an applet.

The applet will need to be digitally signed (by you) and trusted (by the user, when prompted) in order to gain screenshots.

Upvotes: 1

Related Questions