Any Shape Applications

Dear All,

I’ve just added a new chapter to my Java Graphics and Gaming online book at

http://fivedots.coe.psu.ac.th/~ad/jg

The chapter’s called “Shapely Applications”, and is about
a way to make applications any shape you like. It’s chapter 4.5.

Comments appreciated.

  • Andrew

Looks good. The screenshot on focus gain was new to me. Nice idea :slight_smile:

The IFrame class from Michael Abernethy doesn’t do that trick (at least the version, I tried out some months ago didn’t).

Two suggestions:
-Point out (at the very beginning) that it takes screenshot via awt.robot and therefore it cannot be used in unsigned webstart applications. [Taking screenshots could be used for spying… well, theoretically at least.]

-Figure 4 (the layered view) looks a bit busy. You could use a simpler looking desktop there (eg a basically empty desktop with a landscape background) and/or you could make it 2 images. One the left side a desktop with the JFrame’s outlines and on the right side the 3 layers in a stacked side view.

And uhm… make that 3… heh. I think if I would google for something like that I would use the term “non rectangular windows” (or JFrame).

I hadn’t actually read the source. However, that wait piece is somewhat hacky. Slower cpus/graphic cards could require a longer delay. Well, the WindowListener has WindowClosed(WindowEvent e) and WindowClosing(WindowEvent e), but I’m not sure if they could help there.

Thanks for the comments.

Yes, the sleep period is a bit hacky.

As I understand it, there’s no way to discover when the application has actually disappeared from the screen.

  • Andrew