• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

conversion of pixel to millimeter

 
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello friends, sir, madam

I want to set ruler/scale on my panel. This ruler is calibrated in millimeters(mm). I guess java has not provided any standard component to draw ruler. So I am trying to draw the ruler. I am thinking of drawing lines after each mm. For this I might need, after how much pixels should I draw that 1mm line ? This actually depends on screen resoltuion. I dont know whether my approach is right or not.

Please comment on this or if possible suggest some alternative solution. Please help.

Waiting for your replies

Thanks and Regards
Rohit.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at

java.awt.Toolkit.getScreenResolution()

Get the toolkit from your component, *do not* use the default toolkit - the latter doesn't work well if you have more than one display.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And take a look at http://java.sun.com/products/jfc/tsc/articles/text/tabs/
 
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic