wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Help with Java2D gradient bug. I have to finish this before I can collect my paycheck Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Help with Java2D gradient bug. I have to finish this before I can collect my paycheck" Watch "Help with Java2D gradient bug. I have to finish this before I can collect my paycheck" New topic
Author

Help with Java2D gradient bug. I have to finish this before I can collect my paycheck

Nicholas Turner
Ranch Hand

Joined: May 24, 2003
Posts: 126
I have this code
GradientPaint gp2 = new GradientPaint(0,0,Color.white,100,100,Color.black,false);
Rectangle2D r2 = new Rectangle(200,30,100, 100);
g2.setPaint(gp2);
g2.fill(r2);
if draw this its a square of white but if i change the false to true to acylic draw just fine. what gives i need a horizontal gradient from dark to light.
thanks,
nick
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Match up the paint coordinates to your rectangle coordinates...



-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with Java2D gradient bug. I have to finish this before I can collect my paycheck