I need help to go from fullscreen to window mode.

I recently started programming very simple java games, when I get stuck I ask for help or find free code on the internet.
I'm currently using free code to run a JFrame in full screen exclusive mode.
I cannot figure out how to go from full screen exclusive mode back to regular window mode.
here is the code I'm using
   private final boolean initialiseFullScreen() {
        setUndecorated(true);
        setIgnoreRepaint(true);
        setResizable(false);
        graphicsDevice = GraphicsEnvironment.
                getLocalGraphicsEnvironment().getDefaultScreenDevice();
        // Check to see if FSEM is supported and if the target display mode is
        // available and if the desired buffer strategy can be created.
        if (graphicsDevice.isFullScreenSupported()) {
            graphicsDevice.setFullScreenWindow(this);
            if (setDisplayMode(screenWidth, screenHeight, screenColorDepth)) {
                if (setBufferStrategy()) {
                    return true;
        return false;
    private final boolean setDisplayMode(
            int screenWidth, int screenHeight, int screenColorDepth) {
        if (graphicsDevice.isDisplayChangeSupported() == false) {
            return false;
        boolean displayModeAvailable = false;
        DisplayMode[] displayModes = graphicsDevice.getDisplayModes();
        for (DisplayMode mode : displayModes) {
            if (screenWidth == mode.getWidth() && screenHeight == mode.getHeight()
                    && screenColorDepth == mode.getBitDepth()) {
                displayModeAvailable = true;
        if (displayModeAvailable == false) {
            return false;
        DisplayMode targetDisplayMode =
                new DisplayMode(screenWidth, screenHeight,
                    screenColorDepth, DisplayMode.REFRESH_RATE_UNKNOWN);
        try {
            graphicsDevice.setDisplayMode(targetDisplayMode);
        } catch (IllegalArgumentException exception) {
            return false;
        return true;
    private final boolean setBufferStrategy() {
        try {
            // If this process is not running from the event dispatch thread
            // (which is desirable) then make use of invoke and wait to avoid
            // a potential deadlock situation. This may be an unncessary
            // precaution in Java 1.6
            if (EventQueue.isDispatchThread() == false) {
                EventQueue.invokeAndWait(new Runnable() {
                    public void run() {
                        createBufferStrategy(FSEM_NUM_PAGE_BUFFERS);
            } else {
                createBufferStrategy(FSEM_NUM_PAGE_BUFFERS);
            // Sleep for a short interval to provide adequate time for the buffer
            // strategy to be created.
            Thread.sleep(500);
        } catch (Exception exception) {
            return false;
        // Store the created buffered strategy for use within the render cycle
        bufferStrategy = getBufferStrategy();
        return true;
    }

Create a new method that does the opposite initialiseFullScreen().
Start with:
setUndecorated(false);
setIgnoreRepaint(false);
setResizable(true);Then call methods on the graphicsDevice to return to windowed mode.
Look at what the methods used do:
[http://java.sun.com/j2se/1.4.2/docs/api/java/awt/GraphicsDevice.html#setFullScreenWindow(java.awt.Window)|http://java.sun.com/j2se/1.4.2/docs/api/java/awt/GraphicsDevice.html#setFullScreenWindow(java.awt.Window)]
According to the docs, setFullscreenWindow can enter fullscreen, but also leave fullscreen with:
setFullscreenWindow(null);

Similar Messages

  • Need Help Converting iPod from Mac to Windows

    Hi, I have a 3rd Gen iPod and I just gave it to my friend who has a windows xp machine. I had a Mac OS 10.3.9 system. When he plugged the iPod into his windows, it told him that it needed to be configured to windows and that he should connect it to a power adapter. When he did this, the iPod just gave an icon resembling the plug that connects to the bottom of the iPod. Now his iPod won't turn on and when plugged into his computer, it says that there has been a malfunction and his computer does not recognize the USB device. Any suggestions on how to fix this?

    That generation iPod requires a combo USB/Firewire cable. It simply won't work with USB alone. It also needs to be re-formated for Windows and that can be done within iTunes. Along with that cable, he will need the A/C power adapter.

  • TS1389 I need help removing UAC from itunes..

    I need help removing UAC from itunes so it will not allow me to open itunes. Everything I have read from other comments that you shouldn't turn off your user account control. I just to be able to open itunes. Can anyone help me with this problem?? Greg, ogrady612@yahoo,com

    I had this problem too but you do not need UAC to be turned on.
    Click on start and search for 'uac' in the search box at the bottom and click on 'Change User Account Control Settings' when it comes up. Move the slider to the bottom when the window appears and save the changes and your done!
    It's worked for me and my uac has been off for months without causing me any problems!
    Hope this helped

  • Need help coping project from one computer to another.

    I need help coping project from one computer to another.  I loaded all video on computer 1, copied events and project folder to computer 2.  I was told I only needed to copy the project folder back to computer 1 since the events folder is already there.   I copied project folder back to computer 1 but the files wont open.  I dont have computer 2 available. 
    Please help!!!

    Hi
    No that's not the way to do it - iMovie gets confused and in some cases the problems might be un-repairable.
    You've got several problems
    • iMovie'08 - CAN NOT MOVE PROJCTS - You NEED iMovie'09 or iMovie'11 - I see no other working solution
    • Never MOVE or alter any folder named
    iMovie Projects - or -
    iMovie Events
    on DeskTop/Finder - This might be very harmful
    • Moving (Projects) and Events - HAS TO be done within the iMovie Application.
    You've got an Evets window and here You can view Your Events in two ways - Yearly - or - Yearly per Hard disk
    Here You can move within this "window" to another location
    • Projects - NO they do not contain Your full movie - only a document on howto use the material in Event folder
    and there might be worse if You added Photos from iPhoto and Audio from iTunes/Garageband - then You have
    to get this over to the second Mac too, to be able to continue editing.
    So to move Your projects to another Mac You need
    • iMovie'09 or 11
    • an external hard disk -
    MUST BE Mac OS Extended formatted - as UNIX/DOS/FAT32/Mac OS Exchange will not work for VIDEO
    Should be a FireWire one - as UBS/UBS2 performs badly when used for video
    • Then move/copy over within Project resp Events window in iMovie Application
    Hopefully I've been not to confusing or badly structured to be followed.
    Yours Bengt W

  • I need help removing CS3 from Windows 7 so I can reinstall

    I need help removing CS3 from Windows 7 so I can reinstall

    Before trying to remove try re-installing CS3 right on top of the current install.  Often re-installing Photoshop on top of itself fixes the install.  If it does be sure to apply the cs3 updates.
    Download Adobe CS4 and CS3 Free Trials Here (incl. After Effects) | ProDesignTools
    your product key can be retrieved from here https://www.adobe.com/account/my-products-services.html
    use these links for the updates.
    Adobe - Photoshop : For Macintosh
    Adobe - Photoshop : For Windows

  • Please i need help with switch from the us store to malaysian store how i can switch

    Please i need help with switch from the us store to malaysian store how i can switch

    Click here and follow the instructions to change the iTunes Store country.
    (82303)

  • I need help getting past the installation error "windows cannot fint TEMP file"

    I need help getting past the installation error "windows cannot find TEMP file"

    Seems like some who have tried two devices on the JMICRON IDE port have had trouble. Try without the hard drive and see if you get that error. If that is the case I would try a PATA to SATA converter for your hard drive and connect it to one of the Intel SATA Ports.
    http://www.newegg.com/Product/Product.aspx?Item=N82E16812107112
    http://www.amazon.com/ADDONICS-IDE-SERIAL-CONVERTER-ADIDESA/dp/B000090169
    http://www.compusa.com/products/product_info.asp?product_code=339900#ts
    http://www.xpcgear.com/ide2sata.html
    http://www.ubuyitdirect.com/-p-1045.html?currency=USD
    http://www.satasite.com/sata-ide-converter.htm
    http://www.pcgears.com/default.aspx?oid=187150
     

  • Option to choose from fullscreen or windowed

    Hi,
    I am wondering how I can make a index page where you have two options, to open the page I am making in fullscreen or windowed mode. And then most preferably that it saves (or tries to save) a cookie or something on the viewers computer so that each time he goes back he doesn't have to choose how to view it.
    So, how do I do this? Links to tutorials or anything would be great.

    That shouldn't be a problem as they won't have any conflicting names between each other, and OS X doesn't come with any versions of Franklin Gothic, though MS Office 2008 and 2011 do.
    Testing with the various versions I have, the older Type 1 PostScript version of this typeface does conflict with the Office 2011 font (regular face). So it's possible you have a font conflict, though Font Book should warn you of that.
    You could try resetting Font Book. Not always the reason, but a damaged FB database causes problems like this. Such as fonts you are told are active don't show up in all apps, or any of them.
    Close all running apps. Restart your Mac and immediately hold down the Shift key when you hear the startup chime to boot into Safe Mode. Keep holding the Shift key until you see a progress bar towards the bottom of the screen. You can let go of the Shift key at that point.
    OS X asks you to log in (you will get this screen on a Safe Mode boot even if your Mac is set to automatically log in). Let the Mac finish booting to the desktop and then restart normally. This will clear Font Book's database and the cache files of the user account you logged into in Safe Mode.

  • Need help in migration from Layer2 to layer3

    HI Guys
    Need u r help in migration from layer2 switched network to layer3.
    here is the setup there are 9 sites connected with a 10gig backbone in a ring.each site has a 6513 but at the data centre site we having two 6513.we are having a combination of voice and data vlans.at present all the sites are connected with layer2 trunks.all the trunks are teminated at the core ie datacentre site.so how should i procedd and what are the advantages of it ie migration.
    Thanks
    Mahmood

    For this migration you first need to assign IP addresses to your connections between switches. This could be /30 (or /31, if supported) subnets. You should also consider running some dynamic routing protocol such as OSPF between switches.
    Hope this helps.

  • I DESPERATLY NEED HELP TRANSFERING SONGS FROM IPOD TO ITUNES LIBRARY

    hi my computer crashed downstairs and i need help moving all my songs from my ipod to my itunes library, on the other computer...will someone please help me?

    Hello Markatkis,
    Make sure your not connecting it to more than one PC. A new iPOd is set to "Auto Update" by default. With this setting all you do is plug the iPOd into the PC and iTUnes automaticly opens, loads all the songs it has listed in iTunes to the iPod, and after its done, ejects the iPOd.
    If you connect it to another PC tho with iTUnes on it you usually get a promtp that in short says "iPOd library linked to another PC, do you want to link to this one" if you click yes, it wipes the iPOd clean and loads only whats on that PC.
    Since your new to all of this a great place for you may be the "iPod 101" site. It will show you all the bacis ropes of using your iPOd, using iTUnes, and using them both together. http://www.apple.com/support/ipod101/

  • Desperately needs help burning DVD from iPhoto

    I am using iPhoto 6.0.6. I desperately need help burning a DVD of a slide show that I created for my daughter's wedding.
    I put several songs together by opening them and then combining them using QuickTime Pro. I imported the audio into iTunes and created a slide show using iPhoto. The slide show is perfect! The slides are finally in sink with the music just as I want them! But I don't know how to burn the slide show as a DVD.
    I tried exporting the video from iPhoto to my computer, but at the end of the export, I get this message: please note that the music included in the slideshow can only be played on authorized machines. And when I try to play the video (after the export), most of the music on the video cannot be heard. When I try to authorize my machine, I am told that it's already authorized.
    If someone would send detailed instructions on how to proceed, I would greatly appreciate it.
    Greg

    Is your problem the DRM audio tracks you purchased from iTunes store?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 6 and 7 libraries and Tiger and Leopard. Just put the application in the Dock and click on it whenever you want to backup the dB file. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    Note: There's now an Automator backup application for iPhoto 5 that will work with Tiger or Leopard.

  • I need help restoring data from my time machine.

    1)  On the time machine, where do I find the TRASH file that is located on the dock in my desktop?  I'd like to restore that to a prior date but can't find it.
    2)   I DID A VERY BAD THING & need help to get back to where I was before.   I wanted to delete files that were taking up lots of space.  My OTHER section  was using 160G.  I downloaded OmniDiskSweep and found that 120G was being used by my virtual machine (I run Quicken in Windows, through VMware).  I started to delete files that were called Snapshots assuming these were the snapshots that the program regularly takes of my files. Apparently they were not. I also deleted the program Windows XP Professional because that was never used.  When I try to open VM or quicken program, it says it is missing a particular snapshot, i.e. Snapshot 11104.  I deleted about 20 of these. I left all the other files that said Windows XP Home Edition.  But now it shows that I only have the Professional Edition, even though that's what I deleted.  I'm trying to restore from Time Machine and it looks like the information is not there - I've tried various different backups and nothing seems to have the information I need.  The earliest back up I have is from 5/7 when I started time machine on a new external 1TB HD.  Would that have the information I need since it's the very first back up?  Please Help.

    I am assuming it's real data because it's taking up storage on my HD.  It falls in the category "other" and the total of this section is 160G. Here is a snapshot of the virtual machine.
    I also took a shot of the VM snapshots & it tells how much space is being taken up by the snapshots.
    I've now changed the number of snapshots taken down to 12 (didn't know I had this option) & I can delete alot of the 21 snapshots that have already been saved.  I have no idea how much of the HD was set aside for the VM because someone else installed it for me 5 years ago.  I've had enough problems with it over the years that I've wanted to switch to Quicken for Mac or find another financial program to use. I've upgraded the VM 2x over the years, but didn't want to spend $100 for Version 5.   I understand the concept of a VM but that's about all.
    I did do the disk cleanup in Windows on the C drive.  I deleted 700 MB of temporary files and then compressed 4G of data down to 2G.  While the cleanup was progressing it said that the C drive was 30.99G and 78% of it was free.  That just doesn't make sense to me.  It recommended a defrag, so I did that also.
    I'm pretty sure it's real data because I recently had to switch from a 320G external HD for TM, to a 1T HD.  One TM backup was over 300G which I found to be excessive because I basically use my computer for mail, some word processing, and my financial data.
    Thanks again for all your help. I really appreciate it.

  • I need help please, upgrading from OS 10.6.8...

    Please help me - I'm such a technophobe!! I need help upgrading from OS 10.6.8... I get part way through the process and get a box saying "The link needs to be opened with an application" and I don't know what to do next...

    The only way to upgrade from 10.6.8 (which is high as Snow Leopard goes) is to obtain Lion or Mountain Lion from the Online Apple Store or Yosemite from the Mac App Store.
    The requirements for Lion are:
    Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7, or Xeon processor
    2GB of memory
    OS X v10.6.6 or later (v10.6.8 recommended)
    7GB of available space
    Lion is available in the Online Apple Store ($19.99). Mountain Lion (10.8.x) is also available there at the same price (though it's reported to have been removed from sale in some countries so may well cease to be available generally) but there seems little point as the system requirements are the same for Yosemite (10.10.x) - which is free - unless you need to run specific software which will run on Mountain Lion only. Mavericks (10.9.x) is no longer available.
    The requirements for Mountain Lion and Yosemite are:
    OS X v10.6.8 or later
    2GB of memory
    8GB of available space
      and the supported models are:
    iMac (Mid 2007 or newer)
    MacBook (Late 2008 Aluminum, or Early 2009 or newer)
    MacBook Pro (Mid/Late 2007 or newer)
    Xserve (Early 2009)
    MacBook Air (Late 2008 or newer)
    Mac mini (Early 2009 or newer)
    Mac Pro (Early 2008 or newer)
    Yosemite is available from the Mac App Store (in Applications). Mountain Lion can be obtained the Online Apple Store.
      You should be aware that PPC programs (such as AppleWorks) will not run on Lion or above; and some other applications may not be compatible - there is a useful compatibility checklist at http://roaringapps.com/apps:table

  • Need Help:Reading Data from RU payroll cluster for table GRREC

    Hi...
    I need help on how to read data from RU cluster table for table GRREC for the employee & run date and get the value from structure PC292 .
    Please let me know about the includes and the import and export statements to be used.
    Thanks in advance,
    RAVI.

    Hi,
    Here goes pseudocode
    Includes:
    include: rpppxd00    ,
                rpppxd10     ,
                rpc2cd09     , 
                rpc2rx02_ce , "if ldb pnp_ce is used else use the same include with out _ce
                rpc2rx29      ,  
                rpc2rx39      ,
                rpppxm00    ,
                rpc2ruu0_ce ,
    Declare:
    DATA : i_rgdir   LIKE pc261        OCCURS 0 WITH HEADER LINE     ,
               i_result  TYPE pay99_result OCCURS 0 WITH HEADER LINE ,
               i_grrec   LIKE  pc292           OCCURS 0 WITH HEADER LINE .
    start-of-selection:
    GET pernr.
    Get the RGDIR VALUE for the current PERNR & selected Molga
    get rgdir data TABLES i_rgdir
                          USING pernr-pernr
                                     p_molga " parameter
    CD-KEY-PERNR = PERNR-PERNR.
    RP-IMP-C2-CU.
    i_rgdir [] = rgdir[].
      LOOP AT i_rgdir WHERE fpbeg  LE  pn-endda
                        AND fpend  GE  pn-begda
                        AND srtza  EQ 'A'
                        AND void   NE   'V'.
      get_result_tabs   TABLES i_result
                                   USING 'RU'    "  US cluster
                                         pernr-pernr
                                         i_rgdir-seqnr
          RX-KEY-PERNR = PERNR-PERNR.
          UNPACK i_RGDIR-SEQNR TO RX-KEY-SEQNO.
          RP-IMP-C2-RU.
      i_grrec[] = i_result-inter-grrec[].
      LOOP AT i_grrec.
      case i_grrec.
      use wage types required here and pass the data to output table.
      endcase.
      endloop.
      endloop
    end-of-selction.

  • Need help on emailing  from java

    I need help on how to send an Email from a java application.
    Can any body help me by providing correct code for that?
    Thanks!

    It worked.Thanks!So, are you gonna award the Dukes to prometheuzz or are you donating them to the forum pickle jar?
    db

Maybe you are looking for

  • Can 2 iPhones be synced to the same computer?

    I have had an iPhone 3G for the past 2 years, and just bought an iPhone4. Can I give the 3G to my wife and sync both iPhones to the same iTunes library on ONE computer? Or need she sync to her own iTunes library on her laptop? We have the same Contac

  • NTFS junction points in file adapter

    As for my system (NW70 SPS14), file adapter can't resolve symbolic links when configured as NFS/sender. So I have D:\very\big\level\of\deep\some\directory and D:\dsfs pointed at it using JP. In RWB I can see following error message: Configured source

  • Mac 2.0 Mini, 1GB, only 1280x800 with ACD 30"???

    I know it technically isn't supported, but the head genius at Regent Street was sure it would work at the reduced resolution of 1920x1200 with my ACD. As it turns out, the highest resolution that the Mini reports is 1280x800 regardless of how many co

  • Issue with IE images after FP Update

    Good afternoon and thanks for reading. I have a few machines (so far) which are having issues displaying some images through Internet Explorer following the FP update.  The images show up as a white box with a red "X". If the user account(s) have Adm

  • PC to MacBook Pro Changes Photo Colors

    I have a photo biz and have switched from a PC using Adobe Elements to a MacBook Pro using Adobe Photoshop CS2. The colors popped on my PC, and they look flat when I post the pics to my site using the MacBook Pro. Help! I need to post these pics ASAP