private void initComponents() {
        this.setTitle("SortWare");
        
        panelArea2 = new GUI.Visuals.VisualizationPanel(playArea2Graph);
        panelArea2Lbl = new javax.swing.JLabel("Sort2");
        panelArea1 = new GUI.Visuals.VisualizationPanel(playArea1Graph);
        panelArea1Lbl = new javax.swing.JLabel("Sort1");
        
        txtDisplayBoxPanel1 = new GUI.Text.TextPanel();
        txtDisplayBoxPanel2 = new GUI.Text.TextPanel();
                               
        menuBar = new javax.swing.JMenuBar();
        fileMenuButton = new javax.swing.JMenu();
        setupMenuItem = new javax.swing.JMenuItem();
        exitMenuItem = new javax.swing.JMenuItem();
        helpMenuButton = new javax.swing.JMenu();
        helpMenuItem = new javax.swing.JMenuItem();
        aboutMenuItem = new javax.swing.JMenuItem();        
        
        gotoBeginButton = new javax.swing.JButton("<<<");
        backwardPassButton = new javax.swing.JButton("<<");
        backwardButton = new javax.swing.JButton("<");
        playPauseButton = new javax.swing.JButton("Play");
        fowardButton = new javax.swing.JButton(">");
        fowardPassButton = new javax.swing.JButton(">>");
        gotoEndButton = new javax.swing.JButton(">>>");
        helpButton = new javax.swing.JButton("Help");
        setupButton = new javax.swing.JButton("Setup");
        exitButton = new javax.swing.JButton("Exit");

        speedSliderlbl = new javax.swing.JLabel("Speed");
        speedSlider = new javax.swing.JSlider(JSlider.HORIZONTAL, 0, 100, 20);   
        
        fileMenuButton.setText("File");
        setupMenuItem.setText("Setup");
        fileMenuButton.add(setupMenuItem);
        exitMenuItem.setText("Exit");
        fileMenuButton.add(exitMenuItem);
        menuBar.add(fileMenuButton);
        
        helpMenuButton.setText("Help");
        helpMenuItem.setText("Help");
        helpMenuButton.add(helpMenuItem);
        aboutMenuItem.setText("About");
        helpMenuButton.add(aboutMenuItem);
        menuBar.add(helpMenuButton);
        
        setJMenuBar(menuBar);     
        
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        panelArea1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout panelArea1Layout = new javax.swing.GroupLayout(panelArea1);
        panelArea1.setLayout(panelArea1Layout);
        panelArea1Layout.setHorizontalGroup(
            panelArea1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 378, Short.MAX_VALUE)
        );
        panelArea1Layout.setVerticalGroup(
            panelArea1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 264, Short.MAX_VALUE)
        );

        panelArea2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout panelArea2Layout = new javax.swing.GroupLayout(panelArea2);
        panelArea2.setLayout(panelArea2Layout);
        panelArea2Layout.setHorizontalGroup(
            panelArea2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 364, Short.MAX_VALUE)
        );
        panelArea2Layout.setVerticalGroup(
            panelArea2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 264, Short.MAX_VALUE)
        );

        txtDisplayBoxPanel1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        javax.swing.GroupLayout txtDisplayBoxPanel1Layout = new javax.swing.GroupLayout(txtDisplayBoxPanel1);
        txtDisplayBoxPanel1.setLayout(txtDisplayBoxPanel1Layout);
        txtDisplayBoxPanel1Layout.setHorizontalGroup(
            txtDisplayBoxPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 376, Short.MAX_VALUE)
        );
        txtDisplayBoxPanel1Layout.setVerticalGroup(
            txtDisplayBoxPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 81, Short.MAX_VALUE)
        );

        txtDisplayBoxPanel2.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        javax.swing.GroupLayout txtDisplayBoxPanel2Layout = new javax.swing.GroupLayout(txtDisplayBoxPanel2);
        txtDisplayBoxPanel2.setLayout(txtDisplayBoxPanel2Layout);
        txtDisplayBoxPanel2Layout.setHorizontalGroup(
            txtDisplayBoxPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 395, Short.MAX_VALUE)
        );
        txtDisplayBoxPanel2Layout.setVerticalGroup(
            txtDisplayBoxPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 81, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(509, 509, 509)
                                .addComponent(panelArea2Lbl))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(160, 160, 160)
                                .addComponent(panelArea1Lbl))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(panelArea1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(txtDisplayBoxPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                                .addGap(26, 26, 26)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(txtDisplayBoxPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(panelArea2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(193, 193, 193)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(speedSliderlbl)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(speedSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(gotoBeginButton)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(backwardPassButton)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(backwardButton)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(playPauseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(fowardButton)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(fowardPassButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(gotoEndButton)))
                .addContainerGap(16, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(48, 48, 48)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(panelArea2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(panelArea1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(panelArea1Lbl)
                    .addComponent(panelArea2Lbl))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtDisplayBoxPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDisplayBoxPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(35, 35, 35)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(gotoBeginButton)
                    .addComponent(backwardPassButton)
                    .addComponent(backwardButton)
                    .addComponent(playPauseButton)
                    .addComponent(fowardButton)
                    .addComponent(fowardPassButton)
                    .addComponent(gotoEndButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(speedSliderlbl)
                    .addComponent(speedSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(24, 24, 24))
        );

        pack();
        
        //Action performed when user selects exit from menu bar
        exitMenuItem.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                System.exit(0);
            }
        });
        
        //Action performed when user selects setup from menu bar
        //See comments on gotoSetup() function
        setupMenuItem.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                gotoSetup();
            }
        });
        
        //Action performed when user selects about from menu bar
        //See comments on gotoAbout() function
        aboutMenuItem.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                gotoAbout();
            }
        });
        
        //Action performed when user clicks '<<<' button
        //See comments on gotoFirst() function
        gotoBeginButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                if (isPlaying){
                    gotoPlayPause();
                }
                gotoFirst();
            }
        });
        
        //Action performed when user clicks '<<' button
        //See comments on gotoPrevious() function
        backwardButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                if (isPlaying){
                    gotoPlayPause();
                }                
                gotoPrevious();
            }
        });
        
        //Action performed when user clicks 'PlayPause' button
        //See comments on gotoPlayPause() function
        playPauseButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                gotoPlayPause();
            }
        });

        //Action performed when user clicks slides speed slider
        //See comments on gotoPlayPause() function
        //Allows speed to be updated immediately
        speedSlider.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
                JSlider source = (JSlider)e.getSource();
                if (!source.getValueIsAdjusting()) {
                    gotoPlayPause();
                    gotoPlayPause();
                }
            }
        });        
        
        //Action performed when user clicks '>>' button
        //See comments on gotoNext() function
        fowardButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                if (isPlaying){
                    gotoPlayPause();
                }                
                gotoNext();
            }
        });
        
        //Action performed when user clicks '>>>' button
        //See comments on gotoLast() function
        gotoEndButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                if (isPlaying){
                    gotoPlayPause();
                }                
                gotoLast();
            }
        });
        
        //Action performed when user selects help from menu bar
        //See comments on gotoHelp() function
        helpMenuItem.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {              
                gotoHelp();
            }
        });
        
        //Action performed when user clicks '>>' button
        //See comments on gotoFowardPass() function
        fowardPassButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                if (isPlaying){
                    gotoPlayPause();
                }                
                gotoFowardPass();
            }
        });
        
        //Action performed when user clicks '<<' button
        //See comments on gotoBackwardPass() function
        backwardPassButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                if (isPlaying){
                    gotoPlayPause();
                }                
                gotoBackwardPass();
            }
        });
        
        
        //Centers Window
        //-Quy
        setLocationRelativeTo(null);
        
	}