This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


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.
 
Have you checked out Aspose?
 
subject: Help with Java2D gradient bug. I have to finish this before I can collect my paycheck
 
It's not a secret anymore!