All pastes #557673 Raw Edit

TONY REN

public text v1 · immutable
·published 2007-06-11 02:01 UTC
rendered paste body
//William & Frank
//Jeopardy

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

class Jeopardy
{
	public static void main (String [] args)
	{
		game frame = new game();
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
}
class game extends JFrame implements MouseListener
{
	private JPanel pane;
	private int y;
	private int x;
	public game ()
	{
		super ("Jeopardy");
		addMouseListener(this);
		
		pane = (JPanel) getContentPane ();
		
		JLabel bg = new JLabel (new ImageIcon("Jeopardy.jpg"));
		JLabel highlight1 = new JLabel (new ImageIcon("Jeopardy start.jpg"));
		JLabel highlight2 = new JLabel (new ImageIcon("Jeopardy score.jpg"));
		JLabel highlight3 = new JLabel (new ImageIcon("Jeopardy instruction.jpg"));
		
		pane.add (bg);
		if (x > 169 && y > 266 && x < 273 && y < 294)
		{
			pane.add (highlight1);
			System.out.println ("whateveR");
		}
			
		setSize(700, 550);
		setLocationRelativeTo(null);
		setVisible(true);
	}
	public void mouseClicked (MouseEvent e)
	{
		x = e.getX();
		y = e.getY();
		System.out.println ("x: " + e.getX());
		System.out.println ("y: " + e.getY());
	}
	public void mousePressed (MouseEvent e)
	{
	}
	public void mouseReleased (MouseEvent e)
	{	
	}
	public void mouseEntered (MouseEvent e)
	{
	}
	public void mouseExited (MouseEvent e)
	{
	}
}