File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Restore applet from full screen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Restore applet from full screen" Watch "Restore applet from full screen" New topic
Author

Restore applet from full screen

Jochem Gruter
Greenhorn

Joined: Aug 16, 2011
Posts: 9
Hi,

I've a java applet that runs in a browser. When pressing f11 in the applet then the applet will be full screen. I put the applet in a frame and set the frame full screen:

(this class extends the Applet class)


But when you press ESC it should be restore the screen from the full screen frame to the browser. I've tried everything to get it work but it won't If you press ESC now it will close full screen but the browser applet has a white screen.

Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4522
    
    5

When you add the Applet to the JFrame it is automatically removed from the frame (sharedOwnerFrame?) that the Java plugin creates for it in the browser.

Something like this might work, if this is a JApplet:
  • Assign the JApplet's contentPane to an instance field
  • Add the contentPane to the JFrame
  • Go full screen


  • Close full screen
  • Set the contentPane back to the JApplet


  • When trying this I would suggest you name the variable something other than contentPane so you don't inadvertently hide any similarly named variable in a superclass. I haven't checked whether that might happen, but its better to be safe.


    luck, db
    There are no new questions, but there may be new answers.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Restore applet from full screen
     
    Similar Threads
    nullPointerException found regarding Window
    Applet Changes With Respect To Resolution
    Size of Text Field
    Accessing JFrame contents
    JOptionPane buttons don't seem to work.