How can I make Swing Faster?

I am developing a WW2 Hexagon shaped Strategy Game using java (1.402b06) which currently looks like this ->

http://web.telia.com/~u26115661/screenshot.jpg

I use Swing and have problems with performance and graphic flashing. The performance problems is that the JScrolPane is slow and varying when it scrolls the map. The graphics flickering is that sometimes the contents of one Panel flashes by in the wrong Panel seemingly a problem with repainting several Panels simultaneously.

If I use a newer JVM, will it solve any of the problems?

How are you drawing the map? This is the code you need to improve, not Swing itself.

Never bother with any of the ScrollPane type stuff from Swing/AWT for scrolling games or maps - just create yourself some kind of drawing surface (ideally a Canvas or Window and an attached BufferStratergy) and do the scrolling yourself. Dead simple and much more efficent than Swing ever will be.

Also, I’ll guess you’re drawing your hexes with Graphics2D line and shape filling operations - try and avoid them. Instead create a few images for the hexes you’ll need and just use drawImage as this is much faster.

I’ll go further.

SWING isnt intended for rapidly changign displays such as games.

If you really want game quality performance your going to need to go lower level.