Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- public class ReactionExperiment implements MouseListener, ActionListener {
- JFrame window;
- JPanel reactionPanel;
- JPanel bottomPanel;
- JButton startButton;
- public ReactionExperiment(){
- buildGUI();
- reactionPanel.addMouseListener(this);
- window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- window.setVisible( true );
- }
- public void buildGUI(){
- window = new JFrame("Reaction Experiment");
- reactionPanel = new ReactionPanel();
- bottomPanel = new JPanel();
- startButton = new JButton("Start");
- bottomPanel.setBackground(Color.LIGHT_GRAY);
- window.add(reactionPanel, BorderLayout.CENTER);
- window.add(bottomPanel, BorderLayout.SOUTH);
- bottomPanel.add(startButton, BorderLayout.EAST);
- window.setSize(1000,600);
- }
- public void startTest(){
- }
- public void nextTest(){
- }
- public void showYellow(){
- }
- public void showRed(){
- }
- public void stopTest(){
- }
- public void actionPerformed(ActionEvent e){
- if(e.getActionCommand().equals("Start")){
- reactionPanel.setSmallCircle(Color.YELLOW);
- }
- }
- public void mousePressed(MouseEvent e){
- }
- public void mouseClicked(MouseEvent e){ }
- public void mouseReleased(MouseEvent e){ }
- public void mouseExited( MouseEvent e) { }
- public void mouseEntered( MouseEvent e) { }
- public static void main(String[] args) {
- new ReactionExperiment();
- }
- }
Add Comment
Please, Sign In to add comment