Guest User

Untitled

a guest
Jan 15th, 2019
59
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5.  
  6. import java.awt.*;
  7. import java.awt.event.*;
  8. import javax.swing.*;
  9.  
  10. public class ReactionExperiment implements MouseListener, ActionListener {
  11. JFrame window;
  12. JPanel reactionPanel;
  13. JPanel bottomPanel;
  14. JButton startButton;
  15.  
  16. public ReactionExperiment(){
  17. buildGUI();
  18. reactionPanel.addMouseListener(this);
  19. window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  20. window.setVisible( true );
  21. }
  22.  
  23. public void buildGUI(){
  24. window = new JFrame("Reaction Experiment");
  25. reactionPanel = new ReactionPanel();
  26. bottomPanel = new JPanel();
  27. startButton = new JButton("Start");
  28. bottomPanel.setBackground(Color.LIGHT_GRAY);
  29.  
  30. window.add(reactionPanel, BorderLayout.CENTER);
  31. window.add(bottomPanel, BorderLayout.SOUTH);
  32. bottomPanel.add(startButton, BorderLayout.EAST);
  33. window.setSize(1000,600);
  34. }
  35.  
  36. public void startTest(){
  37.  
  38. }
  39.  
  40. public void nextTest(){
  41.  
  42. }
  43.  
  44. public void showYellow(){
  45.  
  46. }
  47.  
  48. public void showRed(){
  49.  
  50. }
  51.  
  52. public void stopTest(){
  53.  
  54. }
  55.  
  56. public void actionPerformed(ActionEvent e){
  57. if(e.getActionCommand().equals("Start")){
  58. reactionPanel.setSmallCircle(Color.YELLOW);
  59. }
  60. }
  61.  
  62. public void mousePressed(MouseEvent e){
  63.  
  64. }
  65.  
  66. public void mouseClicked(MouseEvent e){ }
  67. public void mouseReleased(MouseEvent e){ }
  68. public void mouseExited( MouseEvent e) { }
  69. public void mouseEntered( MouseEvent e) { }
  70.  
  71. public static void main(String[] args) {
  72. new ReactionExperiment();
  73. }
  74. }
RAW Paste Data