Results 1 to 7 of 7
- 05-18-2011, 04:40 AM #1
Member
- Join Date
- May 2011
- Posts
- 4
- Rep Power
- 0
Hide taskbar and make window full screen
I would like to be able to make my application go completely full screen when it is run. This means that the windows taskbar/startbar should not be viewable and the window buttons (minimize, maximize, close) should also not be available. I want to keep employees from exiting out of the application and/or clicking on anything in the start bar. My current code looks like:
Java Code:public void start() { try { PlasticXPLookAndFeel.setMyCurrentTheme(new ExperienceBlue()); UIManager.setLookAndFeel(new PlasticXPLookAndFeel()); //UIManager.setLookAndFeel(new javax.swing.plaf.nimbus.NimbusLookAndFeel()); UIManager.put("ComboBox.is3DEnabled", Boolean.FALSE); } catch (Exception e) { } rootView = RootView.getInstance(); TransparentPanel panel = new TransparentPanel(new BorderLayout()); panel.setOpaque(true); panel.add(rootView); posWindow.setContentPane(panel); posWindow.setSize(ApplicationConfig.getPreferences().getInt("wwidth", 900), ApplicationConfig.getPreferences().getInt("wheight", 650)); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); posWindow.setLocation(ApplicationConfig.getPreferences().getInt("wlocx", ((screenSize.width - posWindow.getWidth()) >> 1)), ApplicationConfig.getPreferences().getInt("wlocy", ((screenSize.height - posWindow.getHeight()) >> 1))); posWindow.setMinimumSize(new Dimension(800, 600)); posWindow.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); posWindow.setVisible(true); initDatabase(); }
- 05-18-2011, 05:09 AM #2
Senior Member
- Join Date
- Mar 2011
- Posts
- 261
- Rep Power
- 3
What's the error/problem?
- 05-18-2011, 05:11 AM #3
Member
- Join Date
- May 2011
- Posts
- 4
- Rep Power
- 0
No error, just want to be able to hide the taskbar and the minimize/maximize/close buttons.
I added:
to get rid of the frame buttons (minimize/maximize/close buttons) and now I need to figure out how to hide the taskbar, this way the program is effectively showing full screen.Java Code:posWindow.setUndecorated(true);
Current code is as follows:
Java Code:private Application() { applicationIcon = new ImageIcon(getClass().getResource("/icons/icon.png")); posWindow = new PosWindow(); //Get rid of minimize,maximize,close buttons posWindow.setUndecorated(true); posWindow.setGlassPaneVisible(true); posWindow.setTitle(getTitle()); posWindow.setIconImage(applicationIcon.getImage()); posWindow.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { shutdownPOS(); } }); } public void start() { try { PlasticXPLookAndFeel.setMyCurrentTheme(new ExperienceBlue()); UIManager.setLookAndFeel(new PlasticXPLookAndFeel()); //UIManager.setLookAndFeel(new javax.swing.plaf.nimbus.NimbusLookAndFeel()); UIManager.put("ComboBox.is3DEnabled", Boolean.FALSE); } catch (Exception e) { } rootView = RootView.getInstance(); TransparentPanel panel = new TransparentPanel(new BorderLayout()); panel.setOpaque(true); panel.add(rootView); posWindow.setContentPane(panel); posWindow.setSize(ApplicationConfig.getPreferences().getInt("wwidth", 900), ApplicationConfig.getPreferences().getInt("wheight", 650)); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); posWindow.setLocation(ApplicationConfig.getPreferences().getInt("wlocx", ((screenSize.width - posWindow.getWidth()) >> 1)), ApplicationConfig.getPreferences().getInt("wlocy", ((screenSize.height - posWindow.getHeight()) >> 1))); posWindow.setMinimumSize(new Dimension(800, 600)); posWindow.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); posWindow.setVisible(true); initDatabase(); }
- 05-18-2011, 05:38 AM #4
- 05-18-2011, 06:39 AM #5
Member
- Join Date
- May 2011
- Posts
- 4
- Rep Power
- 0
Thanks, that seems to work except it causes 1 problem now:
I have a shutdown button that displays an 'are you sure?' type message.
When I click the 'shutdown' button now, the entire application minimizes into the taskbar. Once I click on its icon in the taskbar to bring it back up, the shutdown verification message is displayed.Java Code:public void shutdownPOS() { int option = JOptionPane.showOptionDialog(getPosWindow(), com.floreantpos.POSConstants.SURE_SHUTDOWN_, com.floreantpos.POSConstants.CONFIRM_SHUTDOWN, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null); if(option != JOptionPane.YES_OPTION) { return; } int width = posWindow.getWidth(); int height = posWindow.getHeight(); ApplicationConfig.getPreferences().putInt("wwidth", width); ApplicationConfig.getPreferences().putInt("wheight", height); Point locationOnScreen = posWindow.getLocationOnScreen(); ApplicationConfig.getPreferences().putInt("wlocx", locationOnScreen.x); ApplicationConfig.getPreferences().putInt("wlocy", locationOnScreen.y); System.exit(0); }
Any idea why the entire application is minimizing?
My current code for the window looks like:
Please help!Java Code:private Application() { applicationIcon = new ImageIcon(getClass().getResource("/icons/icon.png")); posWindow = new PosWindow(); //Get rid of minimize,maximize,close buttons posWindow.setUndecorated(true); posWindow.setResizable(false); GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(posWindow); //Delete //posWindow.setVisible(true); //delete posWindow.setGlassPaneVisible(true); posWindow.setTitle(getTitle()); posWindow.setIconImage(applicationIcon.getImage()); posWindow.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { shutdownPOS(); } }); } public void start() { try { PlasticXPLookAndFeel.setMyCurrentTheme(new ExperienceBlue()); UIManager.setLookAndFeel(new PlasticXPLookAndFeel()); //UIManager.setLookAndFeel(new javax.swing.plaf.nimbus.NimbusLookAndFeel()); UIManager.put("ComboBox.is3DEnabled", Boolean.FALSE); } catch (Exception e) { } rootView = RootView.getInstance(); TransparentPanel panel = new TransparentPanel(new BorderLayout()); panel.setOpaque(true); panel.add(rootView); posWindow.setContentPane(panel); posWindow.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); posWindow.setVisible(true); initDatabase(); }
- 05-18-2011, 07:05 AM #6
Well, there's a reason behind the word exclusive in the description of the API.
Exit full screen mode before you attempt to show the dialog.
db
- 05-18-2011, 04:48 PM #7
Member
- Join Date
- May 2011
- Posts
- 4
- Rep Power
- 0
db: So there is no other way to accomplish this full screen task besides this API? Unfortunately the open source application that I am customizing uses far too many dialogs, and using this full screen method makes the application unusable.
Is it better that I just hide the taskbar an then increase the size of the window? If so, how would this be accomplished, and small examples would be very much appreciated!
Similar Threads
-
How to hide/disable Java application showing on taskbar?
By chyrl in forum Advanced JavaReplies: 7Last Post: 08-19-2010, 01:56 PM -
Full Screen window over toolbar
By vmcg in forum AWT / SwingReplies: 3Last Post: 07-10-2010, 03:43 AM -
Full-Screen Window is not supporting KeyListener
By AnOdeToCode in forum Java 2DReplies: 1Last Post: 02-13-2009, 08:08 PM -
XTerm window appearing in full screen swing app
By clarose in forum AWT / SwingReplies: 1Last Post: 11-17-2008, 10:56 PM -
Hide Object in the Taskbar when Frame is down to Tray
By hannehomuth in forum Advanced JavaReplies: 2Last Post: 07-12-2008, 06:54 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks