Windowed to Full-screen takes 3 attempts

I'm working on a program, and one of the features I want is to be able to toggle between Full-screen and Windowed modes. I've searched these forums (and google) and saw a lot of the bug issues with full-screen implementations were from JDK 1.4, but haven't found if those bugs still exist. I also haven't found anyone that's encountering quite the same problem I'm having, which is:
When changing the window (JFrame) from windowed mode to full-screen, it does a minimize-maximize loop 3 times before it finally goes full-screen.
I thought it might've been related to the many other parts of the code I had written to handle this (namely key events for global hotkeys), but in the following demo which is a watered-down version of what I'm doing, I still get the same problem. Only difference between this and the actual program is the actual program uses an input-action mapping instead of a button.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ToggleTest extends JFrame implements ActionListener {
    private GraphicsDevice graphicsDevice;
    private DisplayMode origDisplayMode;
    private JButton myToggleButton;
    private boolean isFullScreen = false;
    public static void main(String[] args) {
        new ToggleTest();
    public ToggleTest() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JPanel tmp = new JPanel();
        GraphicsDevice[] devices = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
        graphicsDevice = devices[0];
        origDisplayMode = graphicsDevice.getDisplayMode();
        JLabel myLabel = new JLabel("Test fullscreen");
        tmp.add(myLabel);
        myToggleButton = new JButton("Toggle");
        myToggleButton.addActionListener(this);
        tmp.add(myToggleButton);
        getContentPane().add(tmp);
        setSize(800,600);
        setVisible(true);
     * Toggles the screen between full-screen and windowed.
     * Implemented as a method for re-usability with code
     * that doesn't trigger action commands.
    private void toggle() {
        if(isFullScreen) {
            //Set to windowed mode
            dispose();
            setUndecorated(false);
            setResizable(true);
            graphicsDevice.setFullScreenWindow(null);
            setSize(800,600);
            setLocationRelativeTo(null);
            setVisible(true);
            validate();
        } else {
            //set fullscreen mode
            dispose();
            setUndecorated(true);
            setResizable(false);
            graphicsDevice.setFullScreenWindow(this);
            setVisible(true);
            validate();
        isFullScreen = !isFullScreen;
    public void actionPerformed(ActionEvent e) {
        if(e.getSource() == myToggleButton) {
            toggle();
}I tried messing with the graphicsDevice.setDisplayMode method, but in examples I've seen, it made the whole screen go black and to the specified resolution of the supplied display mode. I'd rather keep the native resolution regardless of being in full-screen or windowed mode, and instead of having the setDisplayMode(origDisplayMode) in both the windowed and full-screen declarations, I just removed it (with no seemingly ill effects).
I also tried removing the setFullScreenWindow(this) and just resized the JFrame to the current resolution, removed the decorations, removed the ability to resize it, and set it at the upper left corner, and this was a step closer to what I wanted. There were no minimize-maximize incidents, however the start bar was still on top. Reading the javadoc said if fullscreen mode wasn't supported that it would simulate it (which could be the case as the computer I'm testing it on has integrated graphics).
Any help would be appreciated.

That would be nice.
Would also be nice to have the visualizer full screen on the secondary screen and leave the pimary screen alone.
Suggestions here -> http://www.apple.com/feedback/itunesapp.html

Similar Messages

  • Is it possible to set a finder window to full screen mode,..

    ... like mail, itunes and other apps? and if not, why not?
    I have to say it took me a bit to get used to Lion, I began complaining all day until I decided to take some time to learn it, and now I like it very much, I see the advantages over 10.6.
    But still, there are some things I don't know about, and the window of opportunity to take time to learn more has closed. And I don't know when it'll open again.
    So, that's why I have joined the community, because now I'm trying to use everthing on full-screen mode, and as I was setting my desktops to work on a project in which I will be needing a lot of finder windows open with a lot of items each, I instantly asked myself:
    Is it possible to set the finder windows to full screen? because I don't see any buttons.
    Thanks 4 Your Time
    R.D.B.

    Thanks Don Archibald,
    Yeah, that's what I'm doing at the moment. But I thought it would be nice to have the little full screen button just to press it so.
    Besides, I'm still figuring out the finder windows' behaviour. I discovered that if you open a folder from a window that has the toolbar, the new folder would also open with a toolbar, even if you already had it set it up with just the status bar.
    And one thing that still enervates me is that if you have a window with two items, and you press the green button to fit the borders up tight, instead of leavin' the 2 items in a horizontal arrangement, it moves one to the bottom and puts a slider. Arrgh.
    Another thing I haven't understood is why one folder I have on the dock sometimes opens with a column layout instead of the icon layout I have arranged for it before. Totally random 4 now, can't find the why.
    Anyway... I'm going to order some lapel pins about 2 flags I designed for two embassies. Anyone know a good place for doing that?

  • How to open a window in full screen mode using lf_fpm_navigation?

    Hi Guys
    For the following applications
    ESS Application: HAP_START_PAGE_POWL_UI_ESS
    MSS Application: HAP_START_PAGE_POWL_UI_MSS
    When the user clicks on the appraisal document name, a seperate window(not full screen) is generated to display the Appraisal docuemnt.
    The code is as follows:
    COMP: HAP_START_PAGE_POWL_UI
    Object : COMPONENTCONTROLLER
    Method: FOLLOWUP_POWL
    Generate the URL to be called.
        CALL METHOD cl_wd_utilities=>construct_wd_url
          EXPORTING
            application_name = 'HAP_MAIN_DOCUMENT'
            in_parameters    = lt_parameters
          IMPORTING
            out_local_url    = l_url.
        wd_this->url = l_url.
        wd_this->display_document( ).
    In Method: DISPLAY_DOCUMENT
    lv_alias = 'EMPLOYEE_DOCUMENT_UI_OBN'.
    use FPM navigation
        ls_nav_key-key1 = 'HAP'.
        ls_nav_key-key2 = 'HAP_GENERIC_UI'.
        lr_fpm_navigation ?= lr_fpm->get_navigation( is_key = ls_nav_key iv_instance_sharing = abap_false ).
        CALL METHOD lr_fpm_navigation->get_key_from_alias
          EXPORTING
            iv_alias = lv_alias
          RECEIVING
            rv_key   = lv_key.
        lr_fpm_navigation->modify_parameters(
             EXPORTING
               id_target_key            = lv_key
               it_application_parameter = lt_appl_param
               it_business_parameter    = lt_business_param    ).
        lr_fpm_navigation->navigate( lv_key ).
    Any idea how to open this window in full screen?
    Highly appreciate your help.
    Thank and Regards
    Pramod

    Hi Pramod,
    This FPM navigation is achieved using settings made in Launchapd Customizing ( LPD_CUST ).
    a) Execute Tran LPD_CUST
    b) Go to Role HAP - Double Click to open it.
    c) Open the second folder on the LHS menu - there you will find 2 entries
    d) Click on second entry - in the entry setting you can see that it is configured for WD Application  - HAP_MAIN_DOCUMENT
    e) Click on button Show Advanced Parameters
    f) There you will find a input box named as Window Features - here you can specify window features like
    height=700,width=1100,position=center,menu=no,status=no,location=no,menubar=no,status=no,toolbar=no
    save the settings come out and test ur app again.
    change the height and width and other features as per ur req.
    Regards
    Manas Dua

  • How do I maximize a window to full screen with one click?

    How do I maximize a window to full screen with one click? Lion 10.7.4.

    If it is a full sceen App, some are some aren't, just click the arrow icon in the upper right hand corner.

  • Safari window to full screen.

    Yes, a simple user question. How to get my Safari window to full screen?

    Drag window's upper left-hand corner to the screen's upper left-hand corner, click and drag bottom right-hand corner resize triangle, and drag to the screen's lower right-hand corner. Why anyone would want to do that is beyond me, but that's it. AFAIK, there's no command shortcut that does it.

  • Adobe Camera Raw window-Only full screen?

    I use Elements 7.0.  In an attempt to improve my photography, I’ve been concentrating on getting as close to a proper exposure in camera using zone system etc.  To further get close to the appropriate exposure after the shot is taken, I’ve begun to shoot in raw.  I’ve bought a couple of books, videos etc. and I’m getting the basics down fairly well.
    I have one basic question.  I’ve searched help both in Elements and within this forum and I can’t find anything that addresses my question.
    When I select a nef image (Nikon D90) in the Organizer and go to “Edit” and then “Full Edit”, the Adobe Camera Raw box opens up in full screen with the selected image displayed.  No part of the desktop is displayed, including the taskbar.
    Is there a way to open up ACR that is not full screen?  I’m so new that I still need to refer to help to figure out what certain sliders do.  I have a 25.5 diagonal monitor, so I have the screen real estate to have a fairly large ACR window while at the same time displaying a help screen.
    Thank you for your input.

    Not sure if this will help, but on my ACR to the right of the Preview checkbox there is a window-double-arrow symbol that toggles full-screen mode in ACR so even if ACR started up in full-screen you could unmaximize it and then resize it somewhat smaller.  I don't know how to start it up non-maximized in the scenario you describe because I don't use that scenario and my ACR starts up in whatever mode I last closed it, full-screen or not.

  • Going full screen takes other screen to black.

    This new feature, in Yosemite, automatically takes my other screen to black, when I go to full screen on one screen.  How do I turn this off?
    Thanks.
    MJ

    Hello Lucio,
    The issue you have reported is a known issue with Adobe Reader 7. These full screen issues have been fixed in Adobe Reader 8.1.2 (the current latest version) where the window manager decorations are not shown in full screen mode.
    Adobe Reader 8.1.2 has a large number of new features and bug fixes so I would recommend that you upgrade to that. Refer http://blogs.adobe.com/acroread/2008/02/adobe_reader_812_for_linux_and.html for more details.
    Also, if you want to know about future release announcements, stay tuned to the official blog for Adobe Reader on Unix at http://blogs.adobe.com/acroread.
    Hope this helps.
    Gaurav

  • Document windows open full screen

    Hi,
    Trying to avoid using the application frame as I don't like the way it stays open and visible when all Dreamweaver documents are closed (even if DW is in the background.)  So I have Application Frame (under Window menu) deselected...but everytime I open an html page to edit it opens the full width of the screen.  Anyway to set Dreamweaver to remember how wide windows were previously and have them open to that width which I set?
    Thanks,
    Rick

    Rick Lupert wrote:
    It seems strange though that Dreamweaver would assume I want to see a web page full screen...
    Dreamweaver CS6 introduced the Application Frame to bring it into line with other Creative Suite programs. Some Mac users like it. Others loathe it with passion. If you don't like the way Dreamweaver now works, submit a feature request as I suggested earlier.
    However, I have discovered a way to get the Mac version of Dreamweaver CS6 to open files at a smaller size. Whether it suits your preferred workflow is a different matter.
    Turn on Application Frame and resize Dreamweaver so that it doesn't fill your monitor. Go to the Dreamweaver menu, and select Preferences. In the General category, deselect the option to open documents in tabs.
    Now when you open a document, it will be floating, and will be only large enough to fit in the resized Application Frame. You won't be able to access other programs or files behind the Application Frame unless you minimize Dreamweaver. But if you locate the Application Frame away from other documents that you might want to access, it will give you freedom to switch between programs and keep the size of the Document window more manageable.
    Of course, it's not exactly what you want, but it might make your workflow a little easier.
    By the way, this is a user-to-user forum, not Adobe support. So, if you want Adobe to take notice of your requirements, use the form I suggested earlier.

  • Open new Finder windows in full screen mode by default

    I'd like for new finder windows to open full-screen by default.
    I have found that, if I have no finder windows open, opening a new finder window always defaults to a non-full-screen window.
    Is there a way to fix this?

    System Preferences > General
    Uncheck the box beside “Close windows when quitting an application”.

  • 6.0.1 update lost default window sizing and all windows open full screen now, why and how do I get my original window sizes back?

    After updating Firefox to version 6.0.1, all browser windows open in full screen size. I need new browser windows to open in their original default size since I use a website for work that opens multiple browser windows.
    I used to be able to fix this problem by renaming my localstore.rdf file in my profile and then restarting Firefox but this does not seem to work in this last update.
    This appears to be a recurring problem for Firefox and it's extremely frustrating.

    Safe mode disables the installed '''Extensions''', themes ('''Appearance''') and '''Plugins''' in '''Tools''' ('''Alt''' + '''T''') > '''Add-ons'''. So it could be that an extension is causing it. You can try to isolate it starting with script blockers and similar extensions and '''Disable''' or '''Remove''' it.
    Please also note that safe mode also disables hardware acceleration: '''Tools''' > '''Options''' > '''Advanced''' > '''General''': '''Use hardware acceleration when possible'''.
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [http://support.mozilla.com/en-US/kb/Uninstalling+add-ons Uninstalling Add-ons]
    [http://kb.mozillazine.org/Uninstalling_toolbars Uninstalling Toolbars]

  • 'Pop-up to confirm' window in full screen mode

    Hi Guys
    In a SAP standard WDA application on clicking a link the application calls a pop-up(create_popup_to_confirm) window centered on the screen. I need to open the pop upwindow in full-screen mode. Changing/increasing size is not acceptable. Is this possible for pop-up window? If so , can you please help?
    Highly appreciate your help.
    Thanks
    Pramod

    hi,
    I tested with parameters window_height and window_width of method create_pop_up_to_confirm and they seem to be working. I tested it on Netweaver 7.02 Release ( Maybe this feature is enabled ).
    yeah Manas .. it was with Netweaver 7.01 only they r not working .. search  the SAP online help
    Also if you have to increase the height and widht of rootelement then you have to call method create_window to call an already existing view as Pop Up
    thats fine ..
    regards,
    amit

  • Opening a window in full screen?

    Hi,
    One thing that really frustrates me is that i can't find a way to open a window program in full screen mode. I always have to manually set the window to the right place since the green button with the plus on the top left corner never really helps. So is there secret button that i don't know about that should be able to do this?
    Thanks.

    You can only do full screen on Mac OS X Lion but you can hide the dock and drag the window from the bottom right hand corner but it will still have the menu bar, How ever if you have a dual monitor setup you can use it on full screen on the second screen that does not have the menu bar or the dock

  • Minimizing compose windows in full-screen mail under Yosemite

    How do you minimise the compose window when mail is in full-screen mode? Before Yosemite you could click on the full-screen button in the top bar, and get mail out of full screen. That was a lousy solution, but it was working. Now it's not possible anymore. So how do you do this?
    This is a seriously annoying bug.
    Thanks!

    I am also having this issue. However, it is not consistent. I installed Lion a week ago and it started off working fine. Only in the last couple days has it started doing this.
    Running the first aluminum unibody MacBook from 2008, 2.4 GHz Intel Core 2 Duo Processor, 2GB 1067 MHz DDR3 RAM, 500GB WD Scorpio Blue SATA HD, everything else stock.

  • Premier Elements 11 screen refresh when window not full screen

    Hi,
    Have following spec pc:
    Pentium 4 3.6Ghz 2Gb Ram with NVidia GTS450 latest display drivers and windows XP service pack 3.
    When running Premier elements in not full screen mode moving the window leaves window trails behind and screen does not refresh. In full screen things are ok?.
    What can be causing this and is there anything that can be done to resolve this apart from upgrading my pc etc.
    Thanks.

    Welcome to the forum.
    I have the same, or very similar GUI display issues with PrE 11 on an older laptop, running XP-Pro SP3 and an nVidia GeForce 8800M GTX w/ 512MB VRAM. Unfortunately, for that chip and on XP-Pro, the latest video driver is from back in 2011 (IIRC), and no new one in sight.
    I feel that the only solution will be to update the OS to Win7 (allowing a newer video driver from nVidia), or replacement of the laptop (which I am doing).
    PrE 4.0, PrPro CS 2, AE CS 2, and other, older Adobe programs, all work perfectly, but PrE 11 has display issues. To me, this means that the newer version's GUI interfaces more closely with the video driver, than the other programs.
    Even for a company, like nVidia, the XP OS route is now a deadend.
    Sorry for the bad news, but know that you are not alone.
    Good luck,
    Hunt

  • Video podcast window only full-screen

    Dear Common Wisdom:
    I just upgraded to the new iTunes 9.0.
    I used to be able to resize the window of my video playing podcasts so I can listen to them or watch them in the corner of my monitor while doing other work, but now it only runs in full-screen mode.
    What gives?
    How can I adjust my window size?
    Thanks!
    Kostas

    Not sure if this will help, but on my ACR to the right of the Preview checkbox there is a window-double-arrow symbol that toggles full-screen mode in ACR so even if ACR started up in full-screen you could unmaximize it and then resize it somewhat smaller.  I don't know how to start it up non-maximized in the scenario you describe because I don't use that scenario and my ACR starts up in whatever mode I last closed it, full-screen or not.

Maybe you are looking for

  • Message Split: File to Multiple IDOC Types

    Hi, I'm attempting to perform a multi-mapping using BPM where I have File -> XI -> IDOC. The result will be 3 DIFFERENT IDOC types, but depending on the payload of the file, not all will be created. I have followed the steps in this weblog: https://w

  • How to retreive this file in SQL*Plus

    If I upload files which name is KOREAN, name of files is invisible. I dont't know cause of this problem. How is keeping korean name of file from breaking? Also, answer how to retreive this file in SQL*Plus Thanks silverbell

  • Errors in custom page which calls seeded OA Page

    Hi Team, In Custom OA Page one link is der like Applicant home page. whenever click the link it should open seeded page. The link is having one event and capturing that event in CO PFR and calling the seeded page. but i am getting the following error

  • Query about the events in ALV List

    Hi, When does the events being triggered in the ALV? Whta is its behavior? Thanks a lot!

  • I can not download Mozilla,my computer says retry only...

    I am trying to download Mozilla to my other laptop... It already works on one laptop but not my main unit.. IT WILL NOT DOWNLOAD AT ALL.. Just keeps saying retry..