Yeah, g2d is an instance of Graphics2D. You can get one by overriding paintComponent and casting the Graphics Object, which is actually a Graphics2D Object. And it fills whatever you want, you just...
Type: Posts; User: KevinWorkman
Yeah, g2d is an instance of Graphics2D. You can get one by overriding paintComponent and casting the Graphics Object, which is actually a Graphics2D Object. And it fills whatever you want, you just...
You'll want something more like:
LinearGradientPaint gradient = new LinearGradientPaint(start, end, fractions, colors);
g2d.setPaint(gradient);
g2d.fillRect(0, 0, getWidth(), getHeight());...
What Norm said.
Threading is certainly one way to go, but I'm not sure I'd recommend it to a beginner.
Think about it this way: all of the stuff going on in a game is not happening at the same time, it's just...