Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Detecting screen resolution change
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting screen resolution change



Thanks guys, seems like I'll have to use some kind of a Timer.
The solution from Bino doesnt work, there are no eny event
notifications, when Im changing the screen resolutiuon, at least on
Win XP. And we gotta to support this too :(

Sergiy

2010/7/15 Bino George <email@hidden>:
> Hi Sergiy,
>                    You can the following on all JVMs derived from Oracles
> code (including Apple) :
> import java.awt.GraphicsEnvironment;
> import sun.awt.DisplayChangedListener;
> import sun.java2d.SunGraphicsEnvironment;
>
> public class TestDisplayListener {
>
> public static void main(String[] args) {
> GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
> if (ge instanceof SunGraphicsEnvironment) {
> SunGraphicsEnvironment sge = (SunGraphicsEnvironment) ge;
> sge.addDisplayChangedListener(new DisplayChangedListener() {
> public void displayChanged() {
> System.out.println("displayChanged");
> }
> public void paletteChanged() {
> }
> });
> }
> Regards,
> Bino George,
> Java Runtime Engineer,
> Apple Inc.
> On Jul 14, 2010, at 4:11 AM, Scott Palmer wrote:
>
> On 2010-07-14, at 5:38 AM, Sergiy Michka wrote:
>
> Hey,
>
> anyone knows a way how to detect user screen resolution change in an
>
> java application?
>
>
> You could always poll the GraphicsConfiguration with a timer.  Other than
> that, I expect you need to hook into some native code if you want to get
> notifications.
>
> Scott _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Java-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Java-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>



--
vi is [[13~^[[15~^[[15~^[[19~^[[18~^ a
muk[^[[29~^[[34~^[[26~^[[32~^ch better editor than this emacs. I know
I^[[14~'ll get flamed for this but the truth has to be
said. ^[[D^[[D^[[D^[[D ^[[D^[^[[D^[[D^[[B^
exit ^X^C quit :x :wq dang it :w:w:w :x ^C^C^Z^D
 -- seen on alt.religion.emacs
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Detecting screen resolution change (From: Sergiy Michka <email@hidden>)
 >Re: Detecting screen resolution change (From: Scott Palmer <email@hidden>)
 >Re: Detecting screen resolution change (From: Bino George <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.