Fullscreen mode does not hide taskbar
I tested fullscreen mode, I think it works correctly:
import java.awt.*; import java.awt.event.*; public class FullScreenTest { GraphicsDevice device; public FullScreenTest(){ GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); device = ge.getDefaultScreenDevice(); GraphicsConfiguration gc = device.getDefaultConfiguration(); try{ final Frame frame = new Frame(gc); frame.setUndecorated(true); frame.setSize(100, 100); Button button = new Button("Change"); button.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ Window window = device.getFullScreenWindow(); device.setFullScreenWindow((window != null) ? null : frame); } }); MenuBar mb = new MenuBar(); mb.add(new Menu("Test")); frame.setMenuBar(mb); frame.add(button); frame.setVisible(true); device.setFullScreenWindow(frame); }catch(Exception ex){ ex.printStackTrace(); device.setFullScreenWindow(null); System.exit(0); } } public static void main(String[] args){ FullScreenTest test = new FullScreenTest(); } }
Can you post a sample program which can reproduce the problem, please.
Thanks, freebeans.
I see now the reason why my fullscreen does not work.
I use the code device.setFullScreenWindow(frame); frame.setVisible(true);
While your code is frame.setVisible(true); device.setFullScreenWindow(frame);
Both work in a Windows XP system, but there is a difference on Windows Mobile system. Anyway, I know how to implement the fullscreen now on Windows Mobile system, thanks again.
Thank you.
Fixed.
GraphicsDevice.setFullScreenWindow does not hide the taskbar, which cannot give the application full control on the screen.
According to the following link from Mircosoft: http://msdn.microsoft.com/en-us/library/aa458871.aspx The fullscreen window (no start icon, no taskbar) is supported by Windows Mobile.