How can one get the screen resolution (width x height) in pixels?
I am using a JFrame and the java swing methods.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can get the screen size with the
Toolkit.getScreenSize()method.On a multi-monitor configuration you should use this :
If you want to get the screen resolution in DPI you’ll have to use the
getScreenResolution()method onToolkit.Resources :