Mailing Lists: Apple Mailing Lists

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

setFullScreenWindow Woes



I'm converting an application to use the setFullScreenWindow method to
display an application centered in a solid color background, with no menu bar or
dock. The code that follows works fine on Windows XP, JDK 1.4.2_03, but doesn't
draw anything on OS/X 10.3.3--the original frame vanishes, as it should, and
the menu bar becomes inactive, but nothing at all is drawn on the screen.

Does setFullScreenWindow work on OS/X? What do I need to change to get this
to function?

Mike Westerfield

---

GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gd = ge.getDefaultScreenDevice();
frame.setVisible(false);
frame.setMenuBar(null);
frame.getContentPane().removeAll();
frame.dispose();
frame.setUndecorated(true);
frame.setSize(screenSize);

JPanel presentationPanel = new JPanel();
presentationPanel.setLayout(null);
presentationPanel.setBackground(finalPresentationColor);
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(presentationPanel, BorderLayout.CENTER);

Dimension mainSize = getPreferredFrameSize(mainPanel);
mainPanel.setSize(mainSize);
presentationPanel.add(mainPanel);
mainPanel.setLocation(
(screenSize.width - mainSize.width)/2,
Math.max(menuButtonHeight,
(screenSize.height - mainSize.height)/2));

gd.setFullScreenWindow(frame);
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.




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.