Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6207064

GraphicsDevice.setFullScreenWindow spec needs to say what happens if already in full screen mode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 6
    • client-libs
    • None
    • 2d
    • beta
    • generic
    • generic
    • Verified

      The spec of GraphicsDevice.setFullScreenWindow is silent about the method behavior when other window is in full-screen mode already. The spec states: "Windows cannot overlap the full-screen window." However calling this method for other (non full-screen) window returns current full-screen window to windowed mode and enters the second one to full-screen instead. This behavior is not described in the spec.

      Code below illustrates current behavior: it shows initially blue full-screen window and then yellow one (blue is returned to windowd mode):
      =================== Test44.java ===========================
      import java.awt.*;

      public class Test44 {

          public static void main(String[] argv) {
              Test44 t = new Test44();
              t.go();
          }
          public void go() {
              GraphicsDevice gd = GraphicsEnvironment.
                  getLocalGraphicsEnvironment().
                  getDefaultScreenDevice();
          
              Window w1 = new Window(new Frame("one"));
              w1.setSize(200, 200);
              w1.setBackground(Color.blue);
              gd.setFullScreenWindow(w1);
              try {
                  Thread.sleep(3000);
              } catch (InterruptedException ie) {
              }

          
              Window w2 = new Window(new Frame("two"));
              w2.setBackground(Color.yellow);
              gd.setFullScreenWindow(w2);

              try {
                  Thread.sleep(3000);
              } catch (InterruptedException ie) {
              }
              System.exit(0);
          }
      }
      ==========================================
      ###@###.### 2004-12-10 13:44:56 GMT

            chaasesunw Chet Haase (Inactive)
            mchernyssunw Michael Chernyshov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: