Results 1 to 6 of 6
  1. #1
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default Fullscreen on-top problem

    I was happy to find that the following code...

    Java Code:
        private void fullScreenActionPerformed(java.awt.event.ActionEvent evt) {                                           
            java.awt.GraphicsEnvironment ge = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment();
            java.awt.GraphicsDevice graphicsDevice = ge.getDefaultScreenDevice();
            graphicsDevice.setFullScreenWindow(this);
        }
    ...would make my frame go into true fullscreen mode... until I realised that my dialog windows get hidden underneath! I set all my dialogs to "Always on top" but even then they spawn under the fullscreen frame, which means I need to ALT+TAB to see them. How should I get around this?

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by ozzyman View Post
    ...would make my frame go into true fullscreen mode... until I realised that my dialog windows get hidden underneath! I set all my dialogs to "Always on top" but even then they spawn under the fullscreen frame, which means I need to ALT+TAB to see them. How should I get around this?
    Did you set the 'owner' or 'parent' of your JDialogs to be that full screen JFrame?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default

    I wonder if I have to setFocus my dialogs after I setVisible(true) them?

    EDIT:

    myDialog.requestFocus() didn't help
    Last edited by ozzyman; 04-13-2011 at 08:04 PM.

  4. #4
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default

    Oh, I was looking at that and thinking JosAh, thanks I'll give it a go!

  5. #5
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default

    So, netbeans gives a drop-down list of possible accessible parents to choose from, and the only one that seems like it could be the main GUI is the one named "Form". I set one dialog as you said, Form being the parent, but the problem persisted.

    I'm not sure if Form is the name of the parent, how can I check? When i check the properties of my main GUI, the name attribute is 'frame0'.

    EDIT:
    System.out.println(theDialog.getParent());
    output:
    javax.swing.SwingUtilities$SharedOwnerFrame(frame0 ,0,0,0x0,invalid,hidden,layout=java.awt.BorderLayo ut,title=,resizable,normal)
    Last edited by ozzyman; 04-13-2011 at 07:59 PM.

  6. #6
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default

    Okay, I just read this in the GraphicsDevice documentation:

    full screen mode is considered to be exclusive, which implies:

    •Windows cannot overlap the full-screen window. All other application windows will always appear beneath the full-screen window in the Z-order.
    •Input method windows are disabled. It is advisable to call Component.enableInputMethods(false) to make a component a non-client of the input method framework.
    :(

Similar Threads

  1. Setting JFrame to Fullscreen w/o Bar
    By Abion47 in forum AWT / Swing
    Replies: 0
    Last Post: 03-30-2011, 09:30 PM
  2. Embedding Applet into the center of fullscreen API
    By crikey in forum Advanced Java
    Replies: 3
    Last Post: 08-25-2010, 10:53 PM
  3. fullscreen
    By ashish9590 in forum AWT / Swing
    Replies: 0
    Last Post: 02-23-2010, 02:58 PM
  4. Fullscreen mode problems
    By devunion in forum AWT / Swing
    Replies: 1
    Last Post: 04-01-2009, 05:07 PM
  5. Setting JPanel to a fullscreen
    By hitmen in forum New To Java
    Replies: 3
    Last Post: 03-15-2009, 05:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •