java help

Aramil of Elixia (772)
so im trying to make a virtual iphone but i dont know how to convert the current size to inches (im not even sure what measurements im using for this i think its pixels.) this is the code im using:
1
2
JLabel textLabel = new JLabel("I'm a label in the window",SwingConstants.CENTER);
textLabel.setPreferredSize(new Dimension(450, 250));


and i need it to be 4.5 inches tall by 2.25 inches wide
naraku9333 (919)
Maybe multiply the size in inches by the DPI of the screen?
Aramil of Elixia (772)
whats dpi?
naraku9333 (919)
Dots per inch
Aramil of Elixia (772)
so what do i need to multiply by to get the dpi?
Topic archived. No new replies allowed.