• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 913
  • Last Modified:

Using java web start, using jre 1.5, my java app runs fullscreen, exact same code with jrk 1.6 it won't, does windowed instead

My java app won't run fullscreen with jre 1.6 even though same code runs fullscreen with java 1.5. I am launching with java web start.
I have both 1.5 and 1.6 jre's installed on my computer
In my php generated jnlp file, with version set to 1.5+ or 1.6
  <resources>
    <j2se version="1.6"/>
it runs windowed.
with version set to 1.5
  <resources>
    <j2se version="1.5"/>
it has no problem running fullscreen.

Here is my java code that attempts to set fullscreen mode:
            
            out("Getting local Graphics Environment...");
            GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
            out("Getting default screen device...");
            device = env.getDefaultScreenDevice();
            out("Getting default configuration...");
            graphicsConfig = device.getDefaultConfiguration();
            /* Make sure full screen mode is supported by this device */
            if (screenMode == FULLSCREEN)
            {
                  out("screenMode is fullScreen so attempting to run full screen, otherwise will run in windowed mode...");
                  // Save user display mode to restore to upon exit.
                  // Hook, not sure if this is working
                  out("Getting display mode...");
                  originalDisplayMode = device.getDisplayMode();
                  
                  out("Checking if device.isFullScreenSupported...");
                  if (!device.isFullScreenSupported())
                  {
                        screenMode = WINDOWED;
                        out("Fullscreen mode is not supported, continuing in windowed mode.");
                  }
            }
            /* don't go to fullscreen for debugging */
            if (screenMode == FULLSCREEN)
            {
                  out("Setting full screen mode...");
                  frame = new Frame(graphicsConfig);
                  frame.setUndecorated(true);

                  try
                  {
                        device.setFullScreenWindow((Frame)frame);
                  } catch (Exception e)
                  {
                        e.printStackTrace();
                  }
                  out("Full screen mode now set.");
                  if (device.isDisplayChangeSupported()) {
                        DisplayMode dm = new DisplayMode(WIDTH, HEIGHT, 32, 0);
                        if (isDisplayModeAvailable(dm, device))
                        {
                              out("Setting display mode..." + dm.toString());
                              device.setDisplayMode(dm);
                        } else
                        {
                              out("Requested display mode is not available: Height: "
                                          + dm.getHeight() + " Width: " + dm.getWidth() + " Bit depth: "
                                          + dm.getBitDepth());
                        }
                  } else
                  {
                        out("Display change not supported");
                  }
            }

Here is java console output when running with java 1.5, despite the security access exception, it still runs fullscreen:

RGInfo.sysout: screenMode is fullScreen so attempting to run full screen, otherwise will run in windowed mode...
RGInfo.sysout: Getting display mode...
RGInfo.sysout: Checking if device.isFullScreenSupported...
RGInfo.sysout: Setting full screen mode...
java.security.AccessControlException: access denied (java.awt.AWTPermission fullScreenExclusive)
      at java.security.AccessControlContext.checkPermission(Unknown Source)
      at java.security.AccessController.checkPermission(Unknown Source)
      at java.lang.SecurityManager.checkPermission(Unknown Source)
      at sun.awt.Win32GraphicsDevice.setFullScreenWindow(Unknown Source)
      at system.Rainglen.init(Rainglen.java:310)
      at demostory.RGDemoStory.init(RGDemoStory.java:104)
      at system.Rainglen.run(Rainglen.java:438)
      at demostory.RGDemoStory.main(RGDemoStory.java:70)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at com.sun.javaws.Launcher.executeApplication(Unknown Source)
      at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
      at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
      at com.sun.javaws.Launcher.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
RGInfo.sysout: Full screen mode now set.

Here is java console output when running with java 1.6:

RGInfo.sysout: Getting local Graphics Environment...
RGInfo.sysout: Getting default screen device...
RGInfo.sysout: Getting default configuration...
RGInfo.sysout: screenMode is fullScreen so attempting to run full screen, otherwise will run in windowed mode...
RGInfo.sysout: Getting display mode...
RGInfo.sysout: Checking if device.isFullScreenSupported...
RGInfo.sysout: Fullscreen mode is not supported, continuing in windowed mode.
RGInfo.sysout: Running in windowed mode...

my jars are signed.

Solution to running fullscreen under java 1.6 will be very much appreciated, my app has significant benefits being fullscreen, most notably, kids can't play around on the desktop. :)
0
rainglen
Asked:
rainglen
  • 5
  • 2
3 Solutions
 
CEHJCommented:
What about the console output in 1.6?

Incidentally if you're getting security exceptions, then one of more jars has not been signed properly
0
 
CEHJCommented:
>>What about the console output in 1.6?

Forget that sorry - i see it. Is it possible for us to try this? I'm running 1.6
0
 
CEHJCommented:
>>when running with java 1.5, despite the security access exception, it still runs fullscreen:

Can you get any other window to overlap it when it does?
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
CEHJCommented:
FYI, your 'Story Demo using Java Web Start' runs without error on my machine in a maximized window (full screen not supported)
0
 
objectsCommented:
make sure u have granted security rights in your jnlp
0
 
objectsCommented:
 <security>
      <all-permissions/>
  </security>
0
 
rainglenAuthor Commented:
Thanks guys, the security permissions did it. I had a mental note to try that, and forgot about it. The permissions solved it and as an added bonus, it got rid of the security access exception when running under 1.5 as well. I had to assign points to CEHJ for going to the trouble of running it!

I am quite happy to have that solved, now on to see about running under Vista, would help if I actually had Vista... :)
0
 
CEHJCommented:
:-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now