hai everybody, All Operating Systems are supporting different screen resolutions.How can i make my window even(same size) for all resolutions?.What are the best possible ways?.I checked System.getproperties().but that method does not include resolution.how can i adjust? Welcome to all solutions and tricks.. basha
I am not 100% sure I understand what you are trying to do. But look at the following methods: Tookit.getDefaultToolkit().getScreenSize - returns Dimension So then when you set the size of your Frame you can do: setSize(Dimension.width, Dimension.height) If you need to place your frame in the middle of the screen you can do setLocation( (screen.width)-frameWidth)/2, (screen.height)-frameHeight)/2 ) If you need to actually control the Resolution of the Desktop, say change it from 800x600 to 1024x768, you can't with pure JAVA. If you want the Frame to change it's actual width and height with different Resolutions so that it appears to take up the same amount of desktop area, then use the getScreenSize method and then do some calculations when setting the size of your Frame accordingly.
posted 17 years ago
If you want the Frame to change it's actual width and height with different Resolutions so that it appears to take up the same amount of desktop area, then use the getScreenSize method and then do some calculations when setting the size of your Frame accordingly.
this is what i really wanted.i expected utility method for this purpose.but it was not there.is'nt it?. a method like 'fixSizeForAllResolutions()' can be a good utility method.because most of the applicaions having GUI and java supports cross-platform. thanks for ur reply anyhow it helped me. wishing u a good day.. basha
We find this kind of rampant individuality very disturbing. But not this tiny ad: