A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.oracle.com/en/java/javase/19/docs/api/java.desktop/java/awt/GraphicsDevice.html below:

GraphicsDevice (Java SE 19 & JDK 19)

public abstract class GraphicsDevice extends Object

The

GraphicsDevice

class describes the graphics devices that might be available in a particular graphics environment. These include screen and printer devices. Note that there can be many screens and many printers in an instance of

GraphicsEnvironment

. Each graphics device has one or more

GraphicsConfiguration

objects associated with it. These objects specify the different configurations in which the

GraphicsDevice

can be used.

In a multi-screen environment, the GraphicsConfiguration objects can be used to render components on multiple screens. The following code sample demonstrates how to create a JFrame object for each GraphicsConfiguration on each screen device in the GraphicsEnvironment:


   GraphicsEnvironment ge = GraphicsEnvironment.
   getLocalGraphicsEnvironment();
   GraphicsDevice[] gs = ge.getScreenDevices();
   for (int j = 0; j < gs.length; j++) {
      GraphicsDevice gd = gs[j];
      GraphicsConfiguration[] gc =
      gd.getConfigurations();
      for (int i=0; i < gc.length; i++) {
         JFrame f = new
         JFrame(gs[j].getDefaultConfiguration());
         Canvas c = new Canvas(gc[i]);
         Rectangle gcBounds = gc[i].getBounds();
         int xoffs = gcBounds.x;
         int yoffs = gcBounds.y;
         f.getContentPane().add(c);
         f.setLocation((i*50)+xoffs, (i*60)+yoffs);
         f.show();
      }
   }
 

For more information on full-screen exclusive mode API, see the Full-Screen Exclusive Mode API Tutorial.

See Also:

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4