![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Nov 2005
Posts: 35
Rep Power: 0
![]() |
Getting size of user's screen
Does anyone know how to get the size of a user's screen?
I'm implementing a SWT application, and I'd like to know the size so that I can calculate the mid-point of the screen, and use that info so some windows display in the center of the screen. |
|
|
|
|
|
#2 |
|
Expert Programmer
|
import java.awt.*;
...
Toolkit toolkit = java.awt.Toolkit.getDefaultToolkit();
Dimension screenSize = toolkit.getScreenSize();
System.out.println("Your screen's width is: " + screenSize.width +
" pixels, and its height is " + screenSize.height +
" pixels."); |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|