Java Utililty Methods Screen Number

List of utility methods to do Screen Number

  1. HOME
  2. Java
  3. S
  4. Screen Number

Description

The list of methods to do Screen Number are organized into topic(s).

Method

int getMonitorNumberAtLocation(Point pos)
get Monitor Number At Location
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice screenDevices[] = ge.getScreenDevices();
for (int i = 0; i < screenDevices.length; i++) {
 final GraphicsDevice device1 = screenDevices[i];
 GraphicsConfiguration gc = device1.getDefaultConfiguration();
 Rectangle screenBounds = gc.getBounds();
 if (screenBounds.contains(pos)) {
 return i;
...
int getNumberOfScreenDevices()
Returns number of screens in current machine
return GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices().length;
int getNumberOfScreens()
get Number Of Screens
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
try {
 GraphicsDevice[] gs = ge.getScreenDevices();
 return gs.length;
} catch (HeadlessException e) {
 return 0;
int getNumberOfScreens()
Returns the number of screens.
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gd = ge.getScreenDevices();
return gd.length;

AltStyle によって変換されたページ (->オリジナル) /