0

Essentially I want to do something like what MSI afterburner does with its FPS and temp monitor... I want to display text (or an image would be better) at the top level of my screen, regardless of what other programs or windows are open.

For example, if I am running a game in full-screen, and I want the time to be displayed in the top right corner of my screen, can I use some Class(es) to get that capability? If so, where should I look?

Thanks!

Dream Lane
  • 1,282
  • 5
  • 16
  • 27

3 Answers3

4

From Java 6 Update 10 and onward, Swing now has support for transparent windows and non-rectangular windows.

The Sun Developer Network has an article called How to Create Translucent and Shaped Windows which includes sample code and illustrative pictures to show what is now possible.

coobird
  • 159,216
  • 35
  • 211
  • 226
1

You can use SWT and tell the window you want it to stay on top, and you can disable the window borders and such if you want a custom window. The only problem is that 'the always on top' property isn't easily changable at runtime without some hacking with the API of whatever OS you're using.

Edit: the linked question also has SWT.ON_TOP code, and should hide the background. Happy days.

Community
  • 1
  • 1
Chris Dennett
  • 22,412
  • 8
  • 58
  • 84
1

One piece of the puzzle -- placing a Window on top (without SWT) is described here: "Always on Top" Windows with Java

Community
  • 1
  • 1
Dilum Ranatunga
  • 13,254
  • 3
  • 41
  • 52