File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Soft Skills this week in the Jobs Discussion 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.
 
jQuery in Action, 2nd edition
 
subject: Help with Java2D gradient bug. I have to finish this before I can collect my paycheck