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

doesn't draw anything

 
Bobby Marvikuan
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there!
Can anyone help me to understand why my code does not working please it should draw a rectangle in the JFrame but ... it does not and I am stupid because I don't see why. so here is the code.


 
Maneesh Godbole
Saloon Keeper
Posts: 10968
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out http://www.coderanch.com/how-to/java/BackgroundImageOnJPanel
You can use the same approach to have your custom painting instead of the image
 
Bobby Marvikuan
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:Check out http://www.coderanch.com/how-to/java/BackgroundImageOnJPanel
You can use the same approach to have your custom painting instead of the image

OK thanks I see the point but if I want to add on my square smth. like JLabel will I able to do that if I am using this method with an image?
 
Maneesh Godbole
Saloon Keeper
Posts: 10968
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Custom painting for containers does not interfere with their ability to add children or lay them out properly.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic