Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Internet Explorer 8 "Change Zoom Level" Function and Applets

843807Jun 2 2010 — edited Jun 11 2010
Setup:

MS Windows Vista or Windows 7
JRE 1.6.0_20
Internet Explorer 8

I have a web-page that contains a Java Applet which is made up of a mixture of Swing and AWT controls. The applet is surrounded by other HTML elements.

In Internet Explorer 8, there is a option on the toolbar that allows the user to "Change Zoom Level". This causes all HTML elements in the current page to resize to the new zoom value whilst their reported size values stay the same (e.g. before the zoom-in the clientWidth of a div might be 500px and after zoom-in it still reports as being 500px). I believe Microsoft call this DPI Scaling.

When I change zoom level (e.g. from 100% to 125%) all the HTML elements resize, and the actual HTML applet object also resizes (you can see its border using the IE8 developer Tools). However, the content of the applet, the swing/AWT controls, do not resize or re-paint. I put a ComponentListener on the Applet but the componentResized method does not appear to get fired when switching zoom levels (possibly because it does not think the size has changed).

I've done some searching but there doesn't seem to be much info out there about this (or I'm using the wrong key words!!).

So, can anyone point me to information about how I should code my Applet so that it can respond when the user selects the Change Zoom Level option in Internet Explorer 8? Is there any facility built into the applet/Swing/AWT classes (or parent classes) that would respond to a change in the DPI/zoom? I believe that Firefox has a similar zoom facility if that helps.

Cheers
Rich
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 9 2010
Added on Jun 2 2010
2 comments
413 views