Newsgroup: it.comp.java
Titolo: schermo intero

Come si fa a visualizzare un qualcosa a schermo intero??
Per schermo intero non intendo ingrandire al massimo una finestra, ma
intendo come quando si visualizza una presentazione power point!!!che non si
vede la barra di avvio.
Blood


Preso direttamente da Developing Games in Java:
Listing 2.1 SimpleScreenManager.java
import java.awt.*;
import javax.swing.JFrame;
/**
     The SimpleScreenManager class manages initializing and
     displaying full screen graphics modes.
*/
public class SimpleScreenManager {
     private GraphicsDevice device;
     /**
         Creates a new SimpleScreenManager object.
     */
     public SimpleScreenManager() {
         GraphicsEnvironment environment =
             GraphicsEnvironment.getLocalGraphicsEnvironment();
         device = environment.getDefaultScreenDevice();
     }
     /**
         Enters full screen mode and changes the display mode.
     */
     public void setFullScreen(DisplayMode displayMode,
         JFrame window)
     {
         window.setUndecorated(true);
         window.setResizable(false);
         device.setFullScreenWindow(window);
         if (displayMode != null &&
             device.isDisplayChangeSupported())
         {
             try {
                 device.setDisplayMode(displayMode);
             }
             catch (IllegalArgumentException ex) {
                 // ignore - illegal mode for this device
             }
         }
     }
     /**
         Returns the window currently used in full screen mode.
     */
     public Window getFullScreenWindow() {
         return device.getFullScreenWindow();
     }
     /**
         Restores the screen's display mode.
     */
     public void restoreScreen() {
         Window window = device.getFullScreenWindow();
         if (window != null) {
             window.dispose();
         }
         device.setFullScreenWindow(null);
     }
}
Listing 2.2 FullScreenTest.java
import java.awt.*;
import javax.swing.JFrame;
public class FullScreenTest extends JFrame {
     public static void main(String[] args) {
         DisplayMode displayMode;
         if (args.length == 3) {
             displayMode = new DisplayMode(
                 Integer.parseInt(args[0]),
                 Integer.parseInt(args[1]),
                 Integer.parseInt(args[2]),
                 DisplayMode.REFRESH_RATE_UNKNOWN);
         }
         else {
             displayMode = new DisplayMode(800, 600, 16,
                 DisplayMode.REFRESH_RATE_UNKNOWN);
         }
         FullScreenTest test = new FullScreenTest();
         test.run(displayMode);
     }
     private static final long DEMO_TIME = 5000;
     public void run(DisplayMode displayMode) {
         setBackground(Color.blue);
         setForeground(Color.white);
         setFont(new Font("Dialog", Font.PLAIN, 24));
         SimpleScreenManager screen = new SimpleScreenManager();
         try {
             screen.setFullScreen(displayMode, this);
             try {
                 Thread.sleep(DEMO_TIME);
             }
             catch (InterruptedException ex) { }
         }
         finally {
              screen.restoreScreen();
         }
     }
     public void paint(Graphics g) {
         g.drawString("Hello World!", 20, 50);
     }
}
Spero ti sia utile (-:
Asami.


Grazie mille.
Il codice l'hai trovato in un libro o su un sito??
Se è un sito, mi daresti il link!??!
Blood

 
http://brackeen.com/javagamebook/
Asami.