![]() |
The Java Developers Almanac 1.4Order this book from Amazon. |
e603. Getting the Available Screen Sizes, Refresh Rates, and Number of ColorsThis example demonstrates how to retrieve all available combinations of screen size, refresh rate, or number of colors for the default screen device. See also e605 Setting the Screen Size, Refresh Rate, or Number of Colors.// Determine if the display mode can be changed GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice gs = ge.getDefaultScreenDevice(); DisplayMode[] dmodes = gs.getDisplayModes(); for (int i=0; i<dmodes.length; i++) { int screenWidth = dmodes[i].getWidth(); int screenHeight = dmodes[i].getHeight(); int bitDepth = dmodes[i].getBitDepth(); int refreshRate = dmodes[i].getRefreshRate(); }
e599. Centering a Frame, Window, or Dialog on the Screen e600. Getting the Number of Screens e601. Enabling Full-Screen Mode e602. Double-Buffering in Full-Screen Mode e604. Getting the Current Screen Refresh Rate and Number of Colors e605. Setting the Screen Size, Refresh Rate, or Number of Colors
© 2002 Addison-Wesley. |