Get number of screen


*********************************************************************
COMPLETE SOURCE CODE FOR : GetNumbersOfScreenInJava.java
*********************************************************************


import java.awt.GraphicsEnvironment;
import java.awt.GraphicsDevice;

public class GetNumbersOfScreenInJava
{
public static void main(String[]args)
{
GraphicsEnvironment myGraphicsEnvironment=GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[]storeAllScreen=myGraphicsEnvironment.getScreenDevices();

System.out.println("THE NUMBERS OF SCREEN IN MY COMPUTER IS : "+storeAllScreen.length);
}
}


*********************************************************************
JUST COMPILE AND EXECUTE IT
*********************************************************************

Get screen size


********************************************************************
COMPLETE SOURCE CODE FOR : GetScreenSize.java
********************************************************************


import java.awt.Toolkit;
import java.awt.Dimension;

public class GetScreenSize
{
public static void main(String[]args)
{
Dimension dim=Toolkit.getDefaultToolkit().getScreenSize();
System.out.println("YOUR SCREEN WIDTH : "+dim.width+" PIXELS");
System.out.println("YOUR SCREEN HEIGHT : "+dim.height+" PIXELS");
}
}


********************************************************************
JUST COMPILE AND EXECUTE IT
********************************************************************

Change cursor for a component


*********************************************************************
COMPLETE SOURCE CODE FOR : HowToChangeComponentCursor.java
*********************************************************************


import java.awt.Frame;
import java.awt.Component;
import java.awt.Cursor;

import java.awt.event.WindowListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class HowToChangeComponentCursor
{
public static void main(String[]args)
{
WindowListener wl=new WindowAdapter()
{
public void windowClosing(WindowEvent evt)
{
System.exit(0);
}
};

Frame a=new Frame("HOVER YOUR CURSOR IN THIS FRAME");
a.addWindowListener(wl);

//METHOD setCursor WILL SET NEW CURSOR FOR COMPONENT
a.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));

a.setSize(800,600);
a.setVisible(true);
}
}


*********************************************************************
JUST COMPILE AND EXECUTE IT
*********************************************************************
Related Posts Plugin for WordPress, Blogger...

I Also Can Create T-Shirt Logo For You