swing component on a cube?

I found the XTrans demo but the source is huge. Does anyone have a real simple example of placing a swing control on the side of a cube. Is this even recommended? or would I be better converting my component into OpenGL. It’s just a small health meter I want to render above some creatures in my game.

There are ways to do what you want (without the user interaction), but I would advice to use plain opengl in this case.

thanks for quick answer, it’s only a few polys I guess so I’ll take your advice :slight_smile:

You can render to a BufferedImage using SwingComponent.paintComponent(img.getGraphics(), …), convert that to a texture and then draw a rectangle with that texture. It scarcely takes any code, but it is slow. To get decent performance you’d need a cache, at which point you might as well have an image resource which you load and turn into a texture once. If you want to build that image resource from screenshots… then you need your head examined, because it’s likely to look out of place.