Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Can't draw on JPanel

$
0
0
I want to add background image to my JApplet application. But it doesn't work. Background is still gray. I tried to use the same JPanel class with normal application and it works. Why with JApplet I can't do this task?

In JPanel I'm using paintComponent() method. If I for example change panel's colour in constructor, then everything works fine, but when I try to drawImage in paintComponent, program breaks.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>