Swing problems (original) (raw)
Hello everyone, just joined this community, been programming Java for a long time now but only sporadically. Most of my applets can be found here, if anyone's interested.
Anyway, I have a question. I've been working on updating my most successful applet, Resonata, to use Swing. I figured, seeing as the old AWT became officially deprecated - what - five years ago now, or something like that? - that it might be about time. I can't help but wonder if I'm wasting my time in a big way, though; I was never convinced of the advantages of so-called 'lightweight' components (I always felt they got that lightweight/heavyweight thing backwards), and it's proving to be a lot of hassle to make everything use the newer techniques.
My actual question though (and I hope you will forgive me if it's a stupid one) is that the Heck could be going wrong with my Swingified version of Resonata? The controls all work, which is nice, only they're largely invisible and I have no idea why. It looks as if something is getting constantly drawn on top of them, for some reason, but I can't see anything in my code that could explain it. Do I need to do something to JPanel, which I wouldn't have needed to do with a Panel, to say 'don't randomly paint the background colour over the top of your contents'? If I run the applet in appletviewer and then resize it so that the controls are outside of their original box, they become visible.
Ring any bells with anyone?