• Post Reply Bookmark Topic Watch Topic
  • New Topic

Drawing a Bitmap on JFrame

 
Siamak Saarmann
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I am trying to show a bitmap on a JFrame (actually I am going to work on Image Processing algorithems and then draw results).

Can someone please tell me :

1- How can I draw on this JFrame (on content pane)?

2- Show me a sample code for showing a Bitmap?

Thank you for your help in advance.

Regards,
Mac

My code (choose file, ...) is as follows:

 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course you can draw on a JFrame but using a separate graphic component gives you more flexibility, more options. And its easier.
 
Siamak Saarmann
Ranch Hand
Posts: 78
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Craig, thank you for your help and your time. regards, mac
 
JeanFrancois Lucas
Greenhorn
Posts: 1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Craig, thank you for your example. I kept many days surfing the web to find a simple answer to this "windows bmp problem" and found nothing (& got a headacke & faught with my children).
When I saw the bmp image displayed on my computer (java 1.6.0_24) I could not believe it, and checked different other ones before being convinced.
I was so pleased that I did an effort to register on javaranch to tell you that!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!