public void setwnd() {
   GraphicsDevice dev = getGraphicsConfiguration().getDevice();
   if (prefs == null) return;
   try {
     dev.setDisplayMode(prefs);
     dev.setFullScreenWindow(null);
     setVisible(false);
     dispose();
     setUndecorated(false);
     setVisible(true);
   } catch (Exception e) {
     throw (new RuntimeException(e));
   }
   prefs = null;
 }
 public void setfs() {
   GraphicsDevice dev = getGraphicsConfiguration().getDevice();
   if (prefs != null) return;
   prefs = dev.getDisplayMode();
   try {
     setVisible(false);
     dispose();
     setUndecorated(true);
     setVisible(true);
     dev.setFullScreenWindow(this);
     dev.setDisplayMode(fsmode);
     pack();
   } catch (Exception e) {
     throw (new RuntimeException(e));
   }
 }