Well I'm making a simple app to prank my dad on april fools day, where he goes on his comp, and it don't work. It's called BlackScreen (pretty self explanatory)
Well I tried System.Windows.Forms.Cursor.Hide() and it didn't work, can anyone help???
Import java#awt#Toolkit
Import java#awt#Graphics2D
PublicSub Form_Load()
Dim myToolkit As Toolkit
myToolkit = Toolkit.getDefaultToolkit
' get the smallest valid cursor size
Dim myDim As Dimension
myDim = myToolkit.getBestCursorSize(1, 1)
' create a new image of that size with an alpha channel
Dim cursorImg As BufferedImage
cursorImg = New BufferedImage (myDim.width,myDim.height, BufferedImage.TYPE_INT_ARGB)
' get a Graphics2D objectto draw to the image
Dim g2d As Graphics2D
g2d = cursorImg.createGraphics()
' set the background 'color' with 0 alpha and clear the image
g2d.setBackground(New Color(0.0, 0.0, 0.0, 0.0))
g2d.clearRect(0,0,myDim.width,myDim.height)
' dispose the Graphics2D object
g2d.dispose()
' now create your cursor using that transparent image
Dim hiddenCursor As Cursor
hiddenCursor = myToolkit.createCustomCursor(cursorImg, New Point(0,0), "hiddenCursor")
' use the hidden Cursor
Parent.setCursor( hiddenCursor )
EndSub
import javax.swing.*;
import java.awt.*;
import java.awt.image.*;
publicclass BlackScreen extends JFrame {
public BlackScreen() {
Toolkit toolkit = Toolkit.getDefaultToolkit();
// get the smallest valid cursor size
Dimension dim = toolkit.getBestCursorSize(1, 1);
// create a new image of that size with an alpha channel
BufferedImage cursorImg = new BufferedImage(dim.width, dim.height, BufferedImage.TYPE_INT_ARGB);
// get a Graphics2D objectto draw to the image
Graphics2D g2d = cursorImg.createGraphics();
// set the background 'color' with 0 alpha and clear the image
g2d.setBackground(new Color(0.0f, 0.0f, 0.0f, 0.0f));
g2d.clearRect(0, 0, dim.width, dim.height);
// dispose the Graphics2D object
g2d.dispose();
// now create your cursor using that transparent image
Cursor hiddenCursor = toolkit.createCustomCursor(cursorImg, new Point(0,0), "hiddenCursor");
// use the hidden Cursor
this.setCursor( hiddenCursor );
// sets background color to back
this.setBackground(Color.black);
// shows only the part in the window, not the frame around it
this.setUndecorated(true);
// sets the size to full screen
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(this);
}
public void paint(Graphics g){}
publicstatic void main(String[] args) {
BlackScreen window = new BlackScreen();
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setVisible(true);
}
}