Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I get fullscreen (desktop mode) working on a mac?



Hi Satya,

On 4. nov.. 2009, at 09.58, Satyaprasad Mylavarapu wrote:

The problem is, I am unable to display the frame on top of Apple Menubar and Dock.

There is the Java "full-screen exclusive" API, but I'm not sure if that fits your needs ("desktop mode"). You could at least have a look: 

http://java.sun.com/docs/books/tutorial/extra/fullscreen/exclusivemode.html

I've used the following code with success under Java 6 on OS X 10.5:

        JFrame frame = ...

        GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice device = environment.getDefaultScreenDevice();
        
        if (!device.isFullScreenSupported()) {
    // Out of luck (but I've never seen this happen on OS X)
        }
        else {
            frame.setUndecorated(true);
            device.setFullScreenWindow(frame);
        }


As an alternative, using JNI/Rococoa you can hide the menu bar (with the side effect of also hiding the Dock) using NSMenu.setMenuBarVisible(false). 




Regards,

-- 
Harald K



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >How do I get fullscreen (desktop mode) working on a mac? (From: "Satyaprasad Mylavarapu" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.