1. //Main Class
  2.  
  3. public class main {
  4. public static void main(String args[]){
  5. javax.swing.SwingUtilities.invokeLater(new Runnable(){
  6. public void run(){
  7.  
  8.  
  9. Loader l = new Loader();
  10.  
  11. }
  12. });
  13. }
  14. }
  15.  
  16. // Loader Class
  17.  
  18. import java.awt.event.ActionEvent;
  19. import java.awt.BorderLayout;
  20. import java.awt.Container;
  21. import java.awt.Desktop.Action;
  22. import java.awt.FlowLayout;
  23. import java.awt.event.ActionListener;
  24. import java.io.File;
  25. import javax.swing.JButton;
  26. import javax.swing.JFileChooser;
  27. import javax.swing.JFrame;
  28. import javax.swing.JLabel;
  29. import javax.swing.JPanel;
  30.  
  31.  
  32. import java.awt.*;
  33.  
  34.  
  35. public class Loader {
  36.  
  37. /**
  38. *
  39. */
  40. private static final long serialVersionUID = 1L; //Gave a warning so we let Eclipse help us out. No idea what this means.
  41. // variables for our GUI
  42. private JLabel headLine;
  43. private JLabel file1;
  44. private JLabel file2;
  45. public static String file1Name = "init";
  46. public CharSequence file1Short;
  47. public CharSequence file2Short;
  48. public static String file2Name = "init";
  49. private JButton click;
  50. private JButton click2;
  51. public static File selectedFile1;
  52. public static File selectedFile2;
  53. private static int length;
  54.  
  55.  
  56.  
  57. public Loader(){
  58.  
  59.  
  60. JFrame mainFrame = new JFrame("Orchestration analyzer");
  61.  
  62. mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  63. Container contentPane = mainFrame.getContentPane();
  64. JPanel mainPanel = new JPanel();
  65. contentPane.add(mainPanel);
  66. JPanel lineStartPanel = new JPanel();
  67. contentPane.add(lineStartPanel,BorderLayout.LINE_START);
  68.  
  69.  
  70. click = (JButton) mainPanel.add(new JButton("Load Data"));
  71. click2 = (JButton) mainPanel.add(new JButton("Load Midi"));
  72.  
  73. mainFrame.pack();
  74. mainFrame.setVisible(true);
  75.  
  76.  
  77.  
  78. }
  79.  
  80.  
  81.  
  82. //Action Event Handler
  83. ActionListener actionListener = new ActionListener() {
  84. public void actionPerformed(ActionEvent actionEvent) {
  85. click = (JButton) actionEvent.getSource();
  86. if(actionEvent.getSource() == click){
  87. System.out.print("Button is working");
  88. }
  89.  
  90. }
  91. };
  92.  
  93. }