Java Screen Viewer

This evening my friend Mauro asked me if I knew some software that would allow him to have a preview on its main display of what his secondary display was showing, as this secondary display is far from the main display.
I made my classic Google researches without getting many results.
Idea behind the software itself is simple, but all I found was licensed software, not free and not opensource.
I decided to try to implement it by myself, first with no success using C++ and QT 4.6(I’m not yet that good with QT), then switching to an implementation in Java, using multi-purpose class called ‘Robot’.

Here you can find a screenshot of my dual-monitor setup and  a screenshot of what the java app is capturing.

You can choose fps and how big the area that you want to preview has to be.

It loads simple parameters from a configuration file that must be on the same directory of the executable jar.

It also save configurations to that file

Windows has a contiguous area of desktop, also when you have a multi monitor setup: depending on how you’ve placed the monitor in the Screen configuration setting, you can easily find the correct values of configuration parameters that allow you, for example, to fully preview the secondary display.

Given a start position (x,y) and width and heigth of the preview rectangle, it captures only that pixels in that area.

In my example, my secondary monitor start showing pixels from coordinate (1280,0) within a rectangle of 800 by 600 pixels.


Full desktop screenshot

Java App screenshot

Source code and executable

[Be sure to have a java runtime environment installed, then lanch with ‘java – jar <xxxx>’ from your prompt/terminal o double-click gui mode]
[Netbeans project, 6.5.1]