• Post Reply Bookmark Topic Watch Topic
  • New Topic

Image icon problem

 
tony navaratnam
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently using an image icon on a jpanel as a canvas in a basic drawing package.The icon is of a image to be drawn on by the app.
Two sizes of icon are used. One larger if the user wishes to draw on the image at full scale and another if the user wishes to see the whole image without scrolling.
When setting the smaller (smaller than the jlabel used) icon i have found that the image is centred on the jlabel.

Is it possible to draw the icon at the origin of the jLabel it is intended for?
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you tried playing with label.setHorizontalAlignment()and label.setVerticalAlignment()?
 
tony navaratnam
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cheers to you sir.
fast and perfect,no problem any more
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!