All pastes #247982 Raw Edit

SkareCrow

public java v1 · immutable
#247982 ·published 2006-11-14 01:23 UTC
rendered paste body
import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.util.*;public class Bored extends JFrame implements MouseListener {	public Random rnd = new Random();	public Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();	public Bored() {		setTitle("Muhahha I am bored!");		setSize(400, 300);		setLocationRelativeTo(null);		setResizable(false);		setVisible(true);		Random xRand = new Random();		addMouseListener(this);		addWindowListener(new WindowAdapter() {			public void windowClosing(WindowEvent e) {				main(new String[0]);			}		});	}	public void mouseEntered(MouseEvent e) {		setLocation(rnd.nextInt(screen.width), rnd.nextInt(screen.height));	}	public void mouseExited(MouseEvent e) { }	public void mouseReleased(MouseEvent e) { }	public void mousePressed(MouseEvent e) { }	public void mouseClicked(MouseEvent e) { }	public static void main(String args[]) {		JFrame.setDefaultLookAndFeelDecorated(true);		SwingUtilities.invokeLater(new Runnable() {			public void run() {				new Bored();			}		});	}}