Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

full size of the screen(urgent)

 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai, my problem is ,I wish to display a frame/window as windows screen. i.e. the full size of the screen.How to get the size of the screen i.e. the monitor used.My window/frame should be displayed as full screen as windows Explorer.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if your class extends JFrame,JWindow,Frame or any other container
use
Dimension d = getToolkit().getScreenSize();
otherwise ,
([frameinstance]).getToolkit().getScreenSize();
u can also get the screenResolution using
getToolkit().getScreenRevolution();
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
There is no need for ur application to extend any class to get the toolkit object. U can get the default toolkit kit by a static method getDefaultToolKit()in java.awt.Toolkit class.
U can check ur screen size with the following piece of code:
import java.awt.*;
public class ScreenSize {
public static void main(String str[])
{
Dimension dim = (Toolkit.getDefaultToolkit()).getScreenSize();
System.out.println("Your screen size is... width: "+ dim.width +" ; height: "+dim.height);
System.exit(0);
}
}
Hope this solves ur problem.
fazal.
 
The longest recorded flight time of a chicken is 13 seconds. But that was done without this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!