0

I'm trying to make a desktop widget using Java, basically what it is, a clock that looks like the Sense Clock Widget from HTC android phones.

Everything is set, clock works and I have a background and clock hour/minute images. The only thing I need is to make the JFrame background transparent. The JFrame is undecorated and can be moved around by its content, just like any widget should act.

I need to figure out how to make the ugly JFrame background from grey to transparent but keep the contents opaque.

TT.
  • 15,428
  • 6
  • 44
  • 84
xR34P3Rx
  • 377
  • 9
  • 27

1 Answers1

1

frame.setBackground(new Color(0,0,0,0));

The frame is transparent but the content is visible.

image of result

Cy Rossignol
  • 15,367
  • 3
  • 52
  • 79
Albert
  • 26
  • 3