File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why doesn't paint

 
Fernando hiar
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

What is wrong with my code!?!?!??!? Why doesn´t paint?!?!?!



I´m using active rendering, thanks...
 
Paul Clapham
Sheriff
Pie
Posts: 20205
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something passes your method a Graphics object. You cast it to Graphics2D. So far so good.

Then you load an image from somewhere, somehow. Then you create a new Graphics2D object and draw the image on it. You never display this Graphics2D object to the user, and you never do anything with the Graphics object which was passed to the method.
 
Maneesh Godbole
Saloon Keeper
Posts: 10976
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In addition to what Paul said,

Is any piece of your code, calling this method? If all it does is paint(!) why create a new method? The usual recommended way of custom painting is overriding the paintComponent method.
More on custom painting here http://docs.oracle.com/javase/tutorial/uiswing/painting/
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic