Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Double always == 0! And a Javadoc issue! (Using NetBeans)

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    21
    My Mood
    Amused
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Double always == 0! And a Javadoc issue! (Using NetBeans)

    I cannot for the life of me figure out why headsPercentage and tailsPercentage always = 0! I've debugged step by step and totalNumberOfHead, totalNumberOfTails, and totalNumberOfTosses are never 0.
    So why are the percentages always 0!?

    Excerpt from JFrameSimulation.java

            //Calculating and storing the percentages
            double headsPercentage = 100 * (totalNumberOfHeads / totalNumberOfTosses);
            double tailsPercentage = 100 * (totalNumberOfTails / totalNumberOfTosses);
     
     
     
            //Setting the text
            jTextFieldNumTosses.setText(String.valueOf(totalNumberOfTosses));
            jTextFieldNumHeads.setText(String.valueOf(totalNumberOfHeads) + " ("
                    + Double.toString(headsPercentage) + "%)");
            jTextFieldNumTails.setText(String.valueOf(totalNumberOfTails) + " ("
                    + Double.toString(tailsPercentage) + "%)");


     
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
     
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
     
    /*
     * JFrameSimulation.java
     *
     * Created on Aug 9, 2011, 7:12:03 PM
     */
    /**
     * @author Cameron Faust
     * 
     * All credit for the images of the coin used in this program is given to the 
     * United States Government as they were screen captured from:
     * http://www.usmint.gov/mint_programs/ultrahigh/coin.html
     * 
     *  There are some deviations from the project PDF in several ways:
     * I used a JSlider rather than radio buttons because I felt that it was easier
     * and more simple to use and I also feel it looks more clean.
     * I also decided to base which image shows on whichever result has the higher
     * percentage of results so there is no  need for a current result text field.
     * If I will be docked for these changes please evaluate no further, let me know
     * and I will be glad to move closer to the guidelines.
     */
    public class JFrameSimulation extends javax.swing.JFrame {
     
        /* 
         * Creating and initializing the boolean value to track if were using a
         * custom value for the number of tosses to simulate.
         */
        boolean customValue = false;
        //Creating the tossSimulation variable.
        TossSimulation toss;
        //Creating the InputValidation variable.
        InputValidation validate;
        //Creating variables that store: Heads, Tails, and Number of Tosses
        int totalNumberOfTosses, totalNumberOfHeads, totalNumberOfTails;
     
        /** Creates new form JFrameSimulation */
        public JFrameSimulation() {
     
            initComponents();
     
            //Adding the change listener to the JSlider
            jSliderTosses.addChangeListener(tossesChanged);
     
            //Set jLabelCoinTails to invisible
            jLabelCoinTails.setVisible(false);
     
            //Sets the forms icon
            this.setIconImage(Toolkit.getDefaultToolkit().getImage("src/retroCoinIcon.png"));
     
            //centers the form at start
            setLocationRelativeTo(null);
     
            //Initializing the new instances of the 2 separate classes
            toss = new TossSimulation();
            validate = new InputValidation();
     
     
        }
        /**
         * This method listens for a change in jSliderTosses' value property and 
         * when the user moves the carat it gets its current value and updates 
         * the value displayed in jTextFieldTosses and if the user goes past 100
         * or all the way to the right it changes the text property of jLabelSlider
         * Note and also enables the user to enter a value into the jTextFieldTosses
         */
        ChangeListener tossesChanged = new ChangeListener() {
     
            @Override
            public void stateChanged(ChangeEvent e) {
                //Setting the source as the JSlider
                JSlider source = (JSlider) e.getSource();
                //Getting the value of the slider and saving it to the variable
                int numberOfTosses = (int) source.getValue();
                //Checking to see if a custom value is to be entered.
                if (numberOfTosses <= 100) {
                    jTextFieldTosses.setText(Integer.toString(numberOfTosses));
                    /*If the user is switching back to one of the predefined numbers
                     * Reset the JTextField's properties and the JLabels properties
                     */
                    if (jTextFieldTosses.isEditable() == true) {
                        jLabelSliderNote.setText("<HTML> <BODY> <div align=center> "
                                + "<P>Move the slider all the way to the right</P> "
                                + "<P>to enter a custom value.</P> </div> </BODY> </HTML>");
                        jTextFieldTosses.setEditable(false);
                        customValue = false;
                    }
                } else {
                    /* 
                     * Change the JLabel and the JTextFields properties to allow a 
                     * custom value to be entered and clear the JTextField
                     */
                    jTextFieldTosses.setText("");
                    jTextFieldTosses.setEditable(true);
                    jLabelSliderNote.setText("Please enter a custom value!");
                    customValue = true;
                }
     
            }
        };
     
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
         */
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
     
            jPanelSimulationControl = new javax.swing.JPanel();
            jSliderTosses = new javax.swing.JSlider();
            jPanelButtons = new javax.swing.JPanel();
            jButtonClear = new javax.swing.JButton();
            jButtonQuit = new javax.swing.JButton();
            jButtonPrint = new javax.swing.JButton();
            jButtonToss = new javax.swing.JButton();
            jPanelTosses = new javax.swing.JPanel();
            jTextFieldTosses = new javax.swing.JTextField();
            jLabelTosses = new javax.swing.JLabel();
            jLabelSliderNote = new javax.swing.JLabel();
            jPanelResults = new javax.swing.JPanel();
            jLabelCoinHeads = new javax.swing.JLabel();
            jLabelCoinTails = new javax.swing.JLabel();
            jPanelOutput = new javax.swing.JPanel();
            jTextFieldNumHeads = new javax.swing.JTextField();
            jLabelTotal = new javax.swing.JLabel();
            jLabelNumberOfHeads = new javax.swing.JLabel();
            jTextFieldNumTosses = new javax.swing.JTextField();
            jTextFieldNumTails = new javax.swing.JTextField();
            jLabelNumberOfTails = new javax.swing.JLabel();
            jMenuBarMain = new javax.swing.JMenuBar();
            jMenuFile = new javax.swing.JMenu();
            jMenuItemClear = new javax.swing.JMenuItem();
            jMenuItemPrint = new javax.swing.JMenuItem();
            jMenuItemQuit = new javax.swing.JMenuItem();
            jMenuSimulation = new javax.swing.JMenu();
            jMenuHelp = new javax.swing.JMenu();
            jMenuItemSplash = new javax.swing.JMenuItem();
            jMenuItemAbout = new javax.swing.JMenuItem();
     
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setTitle("Coin Toss Simulation");
            setResizable(false);
     
            jPanelSimulationControl.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Simulation Controls"));
     
            jSliderTosses.setMajorTickSpacing(10);
            jSliderTosses.setMaximum(101);
            jSliderTosses.setMinimum(1);
            jSliderTosses.setMinorTickSpacing(1);
            jSliderTosses.setPaintTicks(true);
            jSliderTosses.setSnapToTicks(true);
            jSliderTosses.setValue(1);
     
            jButtonClear.setText("Clear");
            jButtonClear.setPreferredSize(new java.awt.Dimension(100, 20));
            jButtonClear.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButtonClearActionPerformed(evt);
                }
            });
     
            jButtonQuit.setText("Quit");
            jButtonQuit.setPreferredSize(new java.awt.Dimension(100, 20));
            jButtonQuit.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButtonQuitActionPerformed(evt);
                }
            });
     
            jButtonPrint.setText("Print");
            jButtonPrint.setPreferredSize(new java.awt.Dimension(100, 20));
     
            jButtonToss.setText("Toss");
            jButtonToss.setPreferredSize(new java.awt.Dimension(100, 20));
            jButtonToss.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButtonTossActionPerformed(evt);
                }
            });
     
            javax.swing.GroupLayout jPanelButtonsLayout = new javax.swing.GroupLayout(jPanelButtons);
            jPanelButtons.setLayout(jPanelButtonsLayout);
            jPanelButtonsLayout.setHorizontalGroup(
                jPanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelButtonsLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jButtonPrint, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButtonToss, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jButtonQuit, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)
                        .addComponent(jButtonClear, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE))
                    .addContainerGap())
            );
            jPanelButtonsLayout.setVerticalGroup(
                jPanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelButtonsLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanelButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanelButtonsLayout.createSequentialGroup()
                            .addComponent(jButtonClear, javax.swing.GroupLayout.PREFERRED_SIZE, 20, Short.MAX_VALUE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButtonQuit, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanelButtonsLayout.createSequentialGroup()
                            .addComponent(jButtonToss, javax.swing.GroupLayout.PREFERRED_SIZE, 20, Short.MAX_VALUE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButtonPrint, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap())
            );
     
            jTextFieldTosses.setEditable(false);
            jTextFieldTosses.setText("1");
     
            jLabelTosses.setText("Number of Tosses:");
     
            jLabelSliderNote.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
            jLabelSliderNote.setText("<HTML>\n<BODY>\n<div align=center>\n<P>Move the slider all the way to the right</P>\n<P>to enter a custom value.</P>\n</div>\n</BODY>\n</HTML>");
     
            javax.swing.GroupLayout jPanelTossesLayout = new javax.swing.GroupLayout(jPanelTosses);
            jPanelTosses.setLayout(jPanelTossesLayout);
            jPanelTossesLayout.setHorizontalGroup(
                jPanelTossesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelTossesLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanelTossesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanelTossesLayout.createSequentialGroup()
                            .addComponent(jLabelTosses)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jTextFieldTosses, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(jLabelSliderNote, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap())
            );
            jPanelTossesLayout.setVerticalGroup(
                jPanelTossesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelTossesLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanelTossesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabelTosses)
                        .addComponent(jTextFieldTosses, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabelSliderNote, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap())
            );
     
            javax.swing.GroupLayout jPanelSimulationControlLayout = new javax.swing.GroupLayout(jPanelSimulationControl);
            jPanelSimulationControl.setLayout(jPanelSimulationControlLayout);
            jPanelSimulationControlLayout.setHorizontalGroup(
                jPanelSimulationControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelSimulationControlLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanelSimulationControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jSliderTosses, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanelSimulationControlLayout.createSequentialGroup()
                            .addComponent(jPanelButtons, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jPanelTosses, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap(14, Short.MAX_VALUE))
            );
            jPanelSimulationControlLayout.setVerticalGroup(
                jPanelSimulationControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelSimulationControlLayout.createSequentialGroup()
                    .addComponent(jSliderTosses, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanelSimulationControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jPanelTosses, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jPanelButtons, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap())
            );
     
            jPanelResults.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Results"));
     
            jLabelCoinHeads.setIcon(new javax.swing.ImageIcon(getClass().getResource("/coinHeads.png"))); // NOI18N
     
            jLabelCoinTails.setIcon(new javax.swing.ImageIcon(getClass().getResource("/coinTails.png"))); // NOI18N
     
            jTextFieldNumHeads.setEditable(false);
            jTextFieldNumHeads.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
            jTextFieldNumHeads.setText("0");
     
            jLabelTotal.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
            jLabelTotal.setText("Number of Tosses:");
     
            jLabelNumberOfHeads.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
            jLabelNumberOfHeads.setText("Number of Heads:");
     
            jTextFieldNumTosses.setEditable(false);
            jTextFieldNumTosses.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
            jTextFieldNumTosses.setText("0");
     
            jTextFieldNumTails.setEditable(false);
            jTextFieldNumTails.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
            jTextFieldNumTails.setText("0");
     
            jLabelNumberOfTails.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
            jLabelNumberOfTails.setText("Number of Tails:");
     
            javax.swing.GroupLayout jPanelOutputLayout = new javax.swing.GroupLayout(jPanelOutput);
            jPanelOutput.setLayout(jPanelOutputLayout);
            jPanelOutputLayout.setHorizontalGroup(
                jPanelOutputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelOutputLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanelOutputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabelNumberOfHeads)
                        .addComponent(jLabelNumberOfTails)
                        .addComponent(jLabelTotal))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE)
                    .addGroup(jPanelOutputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jTextFieldNumHeads, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jTextFieldNumTails, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jTextFieldNumTosses, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap())
            );
            jPanelOutputLayout.setVerticalGroup(
                jPanelOutputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelOutputLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanelOutputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                        .addComponent(jTextFieldNumHeads, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabelNumberOfHeads))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanelOutputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                        .addComponent(jTextFieldNumTails, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabelNumberOfTails))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanelOutputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                        .addComponent(jTextFieldNumTosses, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabelTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            );
     
            javax.swing.GroupLayout jPanelResultsLayout = new javax.swing.GroupLayout(jPanelResults);
            jPanelResults.setLayout(jPanelResultsLayout);
            jPanelResultsLayout.setHorizontalGroup(
                jPanelResultsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelResultsLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanelResultsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabelCoinHeads)
                        .addComponent(jLabelCoinTails))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jPanelOutput, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap())
            );
            jPanelResultsLayout.setVerticalGroup(
                jPanelResultsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanelResultsLayout.createSequentialGroup()
                    .addGroup(jPanelResultsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanelResultsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                            .addComponent(jPanelOutput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelCoinTails))
                        .addComponent(jLabelCoinHeads))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            );
     
            jMenuFile.setText("File");
     
            jMenuItemClear.setText("Clear");
            jMenuFile.add(jMenuItemClear);
     
            jMenuItemPrint.setText("Print");
            jMenuFile.add(jMenuItemPrint);
     
            jMenuItemQuit.setText("Quit");
            jMenuFile.add(jMenuItemQuit);
     
            jMenuBarMain.add(jMenuFile);
     
            jMenuSimulation.setText("Simulation");
            jMenuBarMain.add(jMenuSimulation);
     
            jMenuHelp.setText("Help");
     
            jMenuItemSplash.setText("Show Splash Screen");
            jMenuHelp.add(jMenuItemSplash);
     
            jMenuItemAbout.setText("About");
            jMenuHelp.add(jMenuItemAbout);
     
            jMenuBarMain.add(jMenuHelp);
     
            setJMenuBar(jMenuBarMain);
     
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jPanelSimulationControl, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanelResults, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap())
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jPanelSimulationControl, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jPanelResults, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            );
     
            pack();
        }// </editor-fold>
     
        private void jButtonTossActionPerformed(java.awt.event.ActionEvent evt) {                                            
     
            /*
             * If the custom value tracker is false then use the JSlider value
             * for the number of tosses to simulate.
             * 
             * If the custom value tracker is true AND the custom value is a
             * a valid number use the custom value from the JText field rather
             * than the Sliders value.
             */
            if (customValue == false) {
     
                //Store the current JSlider value in the variable
                int numberOfTosses = jSliderTosses.getValue();
     
                /*
                 * Simulate the number of tosses specified by the variable and store
                 * the number of tosses that resulted in heads.
                 */
                int numberOfHeads = toss.simulateTosses(numberOfTosses);
     
                //Calculate and store the number of tosses that resulted in tails
                int numberOfTails = numberOfTosses - numberOfHeads;
     
                //Adding these dynamic variables to the static total variables
                totalNumberOfHeads += numberOfHeads;
                totalNumberOfTails += numberOfTails;
                totalNumberOfTosses += numberOfTosses;
     
            } else if (customValue == true && validate.isNaN(jTextFieldTosses.getText()) == false) {
     
                //Creating the int to track the number of tosses to be simulated
                int numberOfTosses = Integer.parseInt(jTextFieldTosses.getText());
     
                //Creating the int to track the number of results that are heads
                int numberOfHeads = toss.simulateTosses(numberOfTosses);
     
                /*
                 * Adding the number of tails from this set of simulations 
                 */
                int numberOfTails = numberOfTosses - numberOfHeads;
     
                //Adding these dynamic variables to the static total variables
                totalNumberOfHeads += numberOfHeads;
                totalNumberOfTails += numberOfTails;
                totalNumberOfTosses += numberOfTosses;
     
     
            }
     
            /*
             * Here we create variables for the percentages, calculate the percentages
             * and then store them in doubles. Then we set the text of the results
             * text fields to the number of results for each outcome plus the percentage
             * of the outcome versus the other.
             */
     
    [COLOR="#FF0000"]        //Calculating and storing the percentages
            double headsPercentage = 100 * (totalNumberOfHeads / totalNumberOfTosses);
            double tailsPercentage = 100 * (totalNumberOfTails / totalNumberOfTosses);
     
     
     
            //Setting the text
            jTextFieldNumTosses.setText(String.valueOf(totalNumberOfTosses));
            jTextFieldNumHeads.setText(String.valueOf(totalNumberOfHeads) + " ("
                    + Double.toString(headsPercentage) + "%)");
            jTextFieldNumTails.setText(String.valueOf(totalNumberOfTails) + " ("
                    + Double.toString(tailsPercentage) + "%)");[/COLOR]
     
     
     
        }                                           
     
    private void jButtonClearActionPerformed(java.awt.event.ActionEvent evt) {
     
        //Clearing the variables
        totalNumberOfTosses = 0;
        totalNumberOfHeads = 0;
        totalNumberOfTails = 0;
     
        //Resetting the slider value
        jSliderTosses.setValue(1);
     
        //Setting the results text fields to "0"
        jTextFieldNumTosses.setText("0");
        jTextFieldNumHeads.setText("0");
        jTextFieldNumTails.setText("0");
     
        //Setting the heads coin as the only visible coin
        jLabelCoinHeads.setVisible(true);
        jLabelCoinTails.setVisible(false);
     
     
    }
        /**
         * Quit the program when the user clicks the quit button activates the hotkey
         * or clicks the quit menu item.
         */
    private void jButtonQuitActionPerformed(java.awt.event.ActionEvent evt) {
     
        //Quit
        System.exit(0);
     
    }
     
        /**
         * @param args the command line arguments
         */
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
     
                public void run() {
                    new JFrameSimulation().setVisible(true);
                }
            });
        }
        // Variables declaration - do not modify
        private javax.swing.JButton jButtonClear;
        private javax.swing.JButton jButtonPrint;
        private javax.swing.JButton jButtonQuit;
        private javax.swing.JButton jButtonToss;
        private javax.swing.JLabel jLabelCoinHeads;
        private javax.swing.JLabel jLabelCoinTails;
        private javax.swing.JLabel jLabelNumberOfHeads;
        private javax.swing.JLabel jLabelNumberOfTails;
        private javax.swing.JLabel jLabelSliderNote;
        private javax.swing.JLabel jLabelTosses;
        private javax.swing.JLabel jLabelTotal;
        private javax.swing.JMenuBar jMenuBarMain;
        private javax.swing.JMenu jMenuFile;
        private javax.swing.JMenu jMenuHelp;
        private javax.swing.JMenuItem jMenuItemAbout;
        private javax.swing.JMenuItem jMenuItemClear;
        private javax.swing.JMenuItem jMenuItemPrint;
        private javax.swing.JMenuItem jMenuItemQuit;
        private javax.swing.JMenuItem jMenuItemSplash;
        private javax.swing.JMenu jMenuSimulation;
        private javax.swing.JPanel jPanelButtons;
        private javax.swing.JPanel jPanelOutput;
        private javax.swing.JPanel jPanelResults;
        private javax.swing.JPanel jPanelSimulationControl;
        private javax.swing.JPanel jPanelTosses;
        private javax.swing.JSlider jSliderTosses;
        private javax.swing.JTextField jTextFieldNumHeads;
        private javax.swing.JTextField jTextFieldNumTails;
        private javax.swing.JTextField jTextFieldNumTosses;
        private javax.swing.JTextField jTextFieldTosses;
        // End of variables declaration
    }

     
    import java.util.*;
     
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    /**
     *
     * @author Cameron
     */
    public class TossSimulation {
     
        /*
         * This method randomly genrates X number of coin tosses depending on the 
         * number passed to the method and stores the results in the tossResults 
         * array as booleans. True (1) being heads, and False (0) being tails.
         * The method returns the integer heads which will be used to calculate 
         * the number of heads and tails (tails = numberOfTosses - heads) as well 
         * as display them.
         */
        public Integer simulateTosses(int numberOfTosses) {
     
            //Creating the integer to track the number of results for heads
            int heads = 0;
     
            //Creating the array used to store the results and giving it dimensions.
            Boolean[] tossResults;
            tossResults = new Boolean[numberOfTosses];
     
            //Creating a random number generator and initializing it.
            Random rand;
            rand = new Random();
     
            //Setting the Random number generators seed.
            rand.setSeed(System.currentTimeMillis());
     
            //Simulating the coin tosses.
            for (int W = 0; W < numberOfTosses; W++) {
     
                //Storing the result in the array at the correct index
                tossResults[W] = rand.nextBoolean();
     
            }
     
     
     
            //Go through the array 1 by 1 and add 1 to heads everytime a
            //value is true.
            for (int X = 0; X < numberOfTosses; X++) {
     
                //If the result is true (heads) add one to heads
                if (tossResults[X] == true) {
     
                    heads++; //Adding one to heads
     
                }
     
            }
            return heads; //Return heads to the caller
        }
    }

    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
     
    /**
     *
     * @author Cameron
     */
    public class InputValidation {
     
        /*
         * To change this template, choose Tools | Templates
         * and open the template in the editor.
         */
        /**
         *
         *This method checks if the string passed to the method is not a number
         *Web Page Used: http://www.javadb.com/validate-if-string-is-a-number
         */
        public boolean isNaN(String textField) {
     
            try {
                //try parsing the numbers
                Double.parseDouble(textField);
                Short.parseShort(textField);
     
                //If an error occurs catch it and return a bool of true meaning it is not a number
            } catch (NumberFormatException ex) {
     
                return true;
            }
            //Else if return false meaning no erros = it IS a number
            return false;
        }
    }

    Also when trying to generate the Javadoc files for this project I get:

    init:
    Created dir: J:\Java\CoinTossSim\dist\javadoc
    Warning: Leaving out empty argument '-windowtitle'
    J:\Java\CoinTossSim\nbproject\build-impl.xml:842: No source files and no packages have been specified.
    BUILD FAILED (total time: 0 seconds)

    Here is the XML file it points to with the line highlighted in red.

    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    *** GENERATED FROM project.xml - DO NOT EDIT  ***
    ***         EDIT ../build.xml INSTEAD         ***
     
    For the purpose of easier reading the script
    is divided into following sections:
     
      - initialization
      - compilation
      - jar
      - execution
      - debugging
      - javadoc
      - junit compilation
      - junit execution
      - junit debugging
      - applet
      - cleanup
     
            -->
    <project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="CoinTossSim-impl">
        <fail message="Please build using Ant 1.7.1 or higher.">
            <condition>
                <not>
                    <antversion atleast="1.7.1"/>
                </not>
            </condition>
        </fail>
        <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
        <!-- 
                    ======================
                    INITIALIZATION SECTION 
                    ======================
                -->
        <target name="-pre-init">
            <!-- Empty placeholder for easier customization. -->
            <!-- You can override this target in the ../build.xml file. -->
        </target>
        <target depends="-pre-init" name="-init-private">
            <property file="nbproject/private/config.properties"/>
            <property file="nbproject/private/configs/${config}.properties"/>
            <property file="nbproject/private/private.properties"/>
        </target>
        <target depends="-pre-init,-init-private" name="-init-user">
            <property file="${user.properties.file}"/>
            <!-- The two properties below are usually overridden -->
            <!-- by the active platform. Just a fallback. -->
            <property name="default.javac.source" value="1.4"/>
            <property name="default.javac.target" value="1.4"/>
        </target>
        <target depends="-pre-init,-init-private,-init-user" name="-init-project">
            <property file="nbproject/configs/${config}.properties"/>
            <property file="nbproject/project.properties"/>
        </target>
        <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
            <available file="${manifest.file}" property="manifest.available"/>
            <condition property="splashscreen.available">
                <and>
                    <not>
                        <equals arg1="${application.splash}" arg2="" trim="true"/>
                    </not>
                    <available file="${application.splash}"/>
                </and>
            </condition>
            <condition property="main.class.available">
                <and>
                    <isset property="main.class"/>
                    <not>
                        <equals arg1="${main.class}" arg2="" trim="true"/>
                    </not>
                </and>
            </condition>
            <condition property="manifest.available+main.class">
                <and>
                    <isset property="manifest.available"/>
                    <isset property="main.class.available"/>
                </and>
            </condition>
            <condition property="do.archive">
                <not>
                    <istrue value="${jar.archive.disabled}"/>
                </not>
            </condition>
            <condition property="do.mkdist">
                <and>
                    <isset property="do.archive"/>
                    <isset property="libs.CopyLibs.classpath"/>
                    <not>
                        <istrue value="${mkdist.disabled}"/>
                    </not>
                </and>
            </condition>
            <condition property="manifest.available+main.class+mkdist.available">
                <and>
                    <istrue value="${manifest.available+main.class}"/>
                    <isset property="do.mkdist"/>
                </and>
            </condition>
            <condition property="do.archive+manifest.available">
                <and>
                    <isset property="manifest.available"/>
                    <istrue value="${do.archive}"/>
                </and>
            </condition>
            <condition property="do.archive+main.class.available">
                <and>
                    <isset property="main.class.available"/>
                    <istrue value="${do.archive}"/>
                </and>
            </condition>
            <condition property="do.archive+splashscreen.available">
                <and>
                    <isset property="splashscreen.available"/>
                    <istrue value="${do.archive}"/>
                </and>
            </condition>
            <condition property="do.archive+manifest.available+main.class">
                <and>
                    <istrue value="${manifest.available+main.class}"/>
                    <istrue value="${do.archive}"/>
                </and>
            </condition>
            <condition property="manifest.available-mkdist.available">
                <or>
                    <istrue value="${manifest.available}"/>
                    <isset property="do.mkdist"/>
                </or>
            </condition>
            <condition property="manifest.available+main.class-mkdist.available">
                <or>
                    <istrue value="${manifest.available+main.class}"/>
                    <isset property="do.mkdist"/>
                </or>
            </condition>
            <condition property="have.tests">
                <or>
                    <available file="${test.src.dir}"/>
                </or>
            </condition>
            <condition property="have.sources">
                <or>
                    <available file="${src.dir}"/>
                </or>
            </condition>
            <condition property="netbeans.home+have.tests">
                <and>
                    <isset property="netbeans.home"/>
                    <isset property="have.tests"/>
                </and>
            </condition>
            <condition property="no.javadoc.preview">
                <and>
                    <isset property="javadoc.preview"/>
                    <isfalse value="${javadoc.preview}"/>
                </and>
            </condition>
            <property name="run.jvmargs" value=""/>
            <property name="javac.compilerargs" value=""/>
            <property name="work.dir" value="${basedir}"/>
            <condition property="no.deps">
                <and>
                    <istrue value="${no.dependencies}"/>
                </and>
            </condition>
            <property name="javac.debug" value="true"/>
            <property name="javadoc.preview" value="true"/>
            <property name="application.args" value=""/>
            <property name="source.encoding" value="${file.encoding}"/>
            <property name="runtime.encoding" value="${source.encoding}"/>
            <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
                <and>
                    <isset property="javadoc.encoding"/>
                    <not>
                        <equals arg1="${javadoc.encoding}" arg2=""/>
                    </not>
                </and>
            </condition>
            <property name="javadoc.encoding.used" value="${source.encoding}"/>
            <property name="includes" value="**"/>
            <property name="excludes" value=""/>
            <property name="do.depend" value="false"/>
            <condition property="do.depend.true">
                <istrue value="${do.depend}"/>
            </condition>
            <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
            <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
                <length length="0" string="${endorsed.classpath}" when="greater"/>
            </condition>
            <condition else="false" property="jdkBug6558476">
                <and>
                    <matches pattern="1\.[56]" string="${java.specification.version}"/>
                    <not>
                        <os family="unix"/>
                    </not>
                </and>
            </condition>
            <property name="javac.fork" value="${jdkBug6558476}"/>
            <property name="jar.index" value="false"/>
            <property name="jar.index.metainf" value="${jar.index}"/>
            <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
        </target>
        <target name="-post-init">
            <!-- Empty placeholder for easier customization. -->
            <!-- You can override this target in the ../build.xml file. -->
        </target>
        <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
            <fail unless="src.dir">Must set src.dir</fail>
            <fail unless="test.src.dir">Must set test.src.dir</fail>
            <fail unless="build.dir">Must set build.dir</fail>
            <fail unless="dist.dir">Must set dist.dir</fail>
            <fail unless="build.classes.dir">Must set build.classes.dir</fail>
            <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
            <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
            <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
            <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
            <fail unless="dist.jar">Must set dist.jar</fail>
        </target>
        <target name="-init-macrodef-property">
            <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
                <attribute name="name"/>
                <attribute name="value"/>
                <sequential>
                    <property name="@{name}" value="${@{value}}"/>
                </sequential>
            </macrodef>
        </target>
        <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
            <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
                <attribute default="${src.dir}" name="srcdir"/>
                <attribute default="${build.classes.dir}" name="destdir"/>
                <attribute default="${javac.classpath}" name="classpath"/>
                <attribute default="${javac.processorpath}" name="processorpath"/>
                <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
                <attribute default="${includes}" name="includes"/>
                <attribute default="${excludes}" name="excludes"/>
                <attribute default="${javac.debug}" name="debug"/>
                <attribute default="${empty.dir}" name="sourcepath"/>
                <attribute default="${empty.dir}" name="gensrcdir"/>
                <element name="customize" optional="true"/>
                <sequential>
                    <property location="${build.dir}/empty" name="empty.dir"/>
                    <mkdir dir="${empty.dir}"/>
                    <mkdir dir="@{apgeneratedsrcdir}"/>
                    <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
                        <src>
                            <dirset dir="@{gensrcdir}" erroronmissingdir="false">
                                <include name="*"/>
                            </dirset>
                        </src>
                        <classpath>
                            <path path="@{classpath}"/>
                        </classpath>
                        <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
                        <compilerarg line="${javac.compilerargs}"/>
                        <compilerarg value="-processorpath"/>
                        <compilerarg path="@{processorpath}:${empty.dir}"/>
                        <compilerarg line="${ap.processors.internal}"/>
                        <compilerarg line="${annotation.processing.processor.options}"/>
                        <compilerarg value="-s"/>
                        <compilerarg path="@{apgeneratedsrcdir}"/>
                        <compilerarg line="${ap.proc.none.internal}"/>
                        <customize/>
                    </javac>
                </sequential>
            </macrodef>
        </target>
        <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
            <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
                <attribute default="${src.dir}" name="srcdir"/>
                <attribute default="${build.classes.dir}" name="destdir"/>
                <attribute default="${javac.classpath}" name="classpath"/>
                <attribute default="${javac.processorpath}" name="processorpath"/>
                <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
                <attribute default="${includes}" name="includes"/>
                <attribute default="${excludes}" name="excludes"/>
                <attribute default="${javac.debug}" name="debug"/>
                <attribute default="${empty.dir}" name="sourcepath"/>
                <attribute default="${empty.dir}" name="gensrcdir"/>
                <element name="customize" optional="true"/>
                <sequential>
                    <property location="${build.dir}/empty" name="empty.dir"/>
                    <mkdir dir="${empty.dir}"/>
                    <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
                        <src>
                            <dirset dir="@{gensrcdir}" erroronmissingdir="false">
                                <include name="*"/>
                            </dirset>
                        </src>
                        <classpath>
                            <path path="@{classpath}"/>
                        </classpath>
                        <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
                        <compilerarg line="${javac.compilerargs}"/>
                        <customize/>
                    </javac>
                </sequential>
            </macrodef>
        </target>
        <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
            <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
                <attribute default="${src.dir}" name="srcdir"/>
                <attribute default="${build.classes.dir}" name="destdir"/>
                <attribute default="${javac.classpath}" name="classpath"/>
                <sequential>
                    <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
                        <classpath>
                            <path path="@{classpath}"/>
                        </classpath>
                    </depend>
                </sequential>
            </macrodef>
            <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
                <attribute default="${build.classes.dir}" name="destdir"/>
                <sequential>
                    <fail unless="javac.includes">Must set javac.includes</fail>
                    <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
                        <path>
                            <filelist dir="@{destdir}" files="${javac.includes}"/>
                        </path>
                        <globmapper from="*.java" to="*.class"/>
                    </pathconvert>
                    <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
                    <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
                    <delete>
                        <files includesfile="${javac.includesfile.binary}"/>
                    </delete>
                    <delete>
                        <fileset file="${javac.includesfile.binary}"/>
                    </delete>
                </sequential>
            </macrodef>
        </target>
        <target name="-init-macrodef-junit">
            <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
                <attribute default="${includes}" name="includes"/>
                <attribute default="${excludes}" name="excludes"/>
                <attribute default="**" name="testincludes"/>
                <sequential>
                    <property name="junit.forkmode" value="perTest"/>
                    <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
                        <batchtest todir="${build.test.results.dir}">
                            <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
                                <filename name="@{testincludes}"/>
                            </fileset>
                        </batchtest>
                        <classpath>
                            <path path="${run.test.classpath}"/>
                        </classpath>
                        <syspropertyset>
                            <propertyref prefix="test-sys-prop."/>
                            <mapper from="test-sys-prop.*" to="*" type="glob"/>
                        </syspropertyset>
                        <formatter type="brief" usefile="false"/>
                        <formatter type="xml"/>
                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
                        <jvmarg value="-ea"/>
                        <jvmarg line="${run.jvmargs}"/>
                    </junit>
                </sequential>
            </macrodef>
        </target>
        <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
        <target name="-profile-pre-init">
            <!-- Empty placeholder for easier customization. -->
            <!-- You can override this target in the ../build.xml file. -->
        </target>
        <target name="-profile-post-init">
            <!-- Empty placeholder for easier customization. -->
            <!-- You can override this target in the ../build.xml file. -->
        </target>
        <target name="-profile-init-macrodef-profile">
            <macrodef name="resolve">
                <attribute name="name"/>
                <attribute name="value"/>
                <sequential>
                    <property name="@{name}" value="${env.@{value}}"/>
                </sequential>
            </macrodef>
            <macrodef name="profile">
                <attribute default="${main.class}" name="classname"/>
                <element name="customize" optional="true"/>
                <sequential>
                    <property environment="env"/>
                    <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
                    <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
                        <jvmarg value="${profiler.info.jvmargs.agent}"/>
                        <jvmarg line="${profiler.info.jvmargs}"/>
                        <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
                        <arg line="${application.args}"/>
                        <classpath>
                            <path path="${run.classpath}"/>
                        </classpath>
                        <syspropertyset>
                            <propertyref prefix="run-sys-prop."/>
                            <mapper from="run-sys-prop.*" to="*" type="glob"/>
                        </syspropertyset>
                        <customize/>
                    </java>
                </sequential>
            </macrodef>
        </target>
        <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
            <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
            <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
        </target>
        <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
            <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
                <attribute default="${main.class}" name="name"/>
                <attribute default="${debug.classpath}" name="classpath"/>
                <attribute default="" name="stopclassname"/>
                <sequential>
                    <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
                        <classpath>
                            <path path="@{classpath}"/>
                        </classpath>
                    </nbjpdastart>
                </sequential>
            </macrodef>
            <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
                <attribute default="${build.classes.dir}" name="dir"/>
                <sequential>
                    <nbjpdareload>
                        <fileset dir="@{dir}" includes="${fix.classes}">
                            <include name="${fix.includes}*.class"/>
                        </fileset>
                    </nbjpdareload>
                </sequential>
            </macrodef>
        </target>
        <target name="-init-debug-args">
            <property name="version-output" value="java version &quot;${ant.java.version}"/>
            <condition property="have-jdk-older-than-1.4">
                <or>
                    <contains string="${version-output}" substring="java version &quot;1.0"/>
                    <contains string="${version-output}" substring="java version &quot;1.1"/>
                    <contains string="${version-output}" substring="java version &quot;1.2"/>
                    <contains string="${version-output}" substring="java version &quot;1.3"/>
                </or>
            </condition>
            <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
                <istrue value="${have-jdk-older-than-1.4}"/>
            </condition>
            <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
                <os family="windows"/>
            </condition>
            <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
                <isset property="debug.transport"/>
            </condition>
        </target>
        <target depends="-init-debug-args" name="-init-macrodef-debug">
            <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
                <attribute default="${main.class}" name="classname"/>
                <attribute default="${debug.classpath}" name="classpath"/>
                <element name="customize" optional="true"/>
                <sequential>
                    <java classname="@{classname}" dir="${work.dir}" fork="true">
                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
                        <jvmarg line="${debug-args-line}"/>
                        <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
                        <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
                        <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
                        <jvmarg line="${run.jvmargs}"/>
                        <classpath>
                            <path path="@{classpath}"/>
                        </classpath>
                        <syspropertyset>
                            <propertyref prefix="run-sys-prop."/>
                            <mapper from="run-sys-prop.*" to="*" type="glob"/>
                        </syspropertyset>
                        <customize/>
                    </java>
                </sequential>
            </macrodef>
        </target>
        <target name="-init-macrodef-java">
            <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
                <attribute default="${main.class}" name="classname"/>
                <attribute default="${run.classpath}" name="classpath"/>
                <element name="customize" optional="true"/>
                <sequential>
                    <java classname="@{classname}" dir="${work.dir}" fork="true">
                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
                        <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
                        <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
                        <jvmarg line="${run.jvmargs}"/>
                        <classpath>
                            <path path="@{classpath}"/>
                        </classpath>
                        <syspropertyset>
                            <propertyref prefix="run-sys-prop."/>
                            <mapper from="run-sys-prop.*" to="*" type="glob"/>
                        </syspropertyset>
                        <customize/>
                    </java>
                </sequential>
            </macrodef>
        </target>
        <target name="-init-macrodef-copylibs">
            <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
                <attribute default="${manifest.file}" name="manifest"/>
                <element name="customize" optional="true"/>
                <sequential>
                    <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
                    <pathconvert property="run.classpath.without.build.classes.dir">
                        <path path="${run.classpath}"/>
                        <map from="${build.classes.dir.resolved}" to=""/>
                    </pathconvert>
                    <pathconvert pathsep=" " property="jar.classpath">
                        <path path="${run.classpath.without.build.classes.dir}"/>
                        <chainedmapper>
                            <flattenmapper/>
                            <globmapper from="*" to="lib/*"/>
                        </chainedmapper>
                    </pathconvert>
                    <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
                    <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
                        <fileset dir="${build.classes.dir}"/>
                        <manifest>
                            <attribute name="Class-Path" value="${jar.classpath}"/>
                            <customize/>
                        </manifest>
                    </copylibs>
                </sequential>
            </macrodef>
        </target>
        <target name="-init-presetdef-jar">
            <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
                <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
                    <j2seproject1:fileset dir="${build.classes.dir}"/>
                </jar>
            </presetdef>
        </target>
        <target name="-init-ap-cmdline-properties">
            <property name="annotation.processing.enabled" value="true"/>
            <property name="annotation.processing.processors.list" value=""/>
            <property name="annotation.processing.processor.options" value=""/>
            <property name="annotation.processing.run.all.processors" value="true"/>
            <property name="javac.processorpath" value="${javac.classpath}"/>
            <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
            <condition property="ap.supported.internal" value="true">
                <not>
                    <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
                </not>
            </condition>
        </target>
        <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
            <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
                <isfalse value="${annotation.processing.run.all.processors}"/>
            </condition>
            <condition else="" property="ap.proc.none.internal" value="-proc:none">
                <isfalse value="${annotation.processing.enabled}"/>
            </condition>
        </target>
        <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
            <property name="ap.cmd.line.internal" value=""/>
        </target>
        <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
        <!--
                    ===================
                    COMPILATION SECTION
                    ===================
                -->
        <target name="-deps-jar-init" unless="built-jar.properties">
            <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
            <delete file="${built-jar.properties}" quiet="true"/>
        </target>
        <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
            <echo level="warn" message="Cycle detected: CoinTossSim was already built"/>
        </target>
        <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
            <mkdir dir="${build.dir}"/>
            <touch file="${built-jar.properties}" verbose="false"/>
            <property file="${built-jar.properties}" prefix="already.built.jar."/>
            <antcall target="-warn-already-built-jar"/>
            <propertyfile file="${built-jar.properties}">
                <entry key="${basedir}" value=""/>
            </propertyfile>
        </target>
        <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
        <target depends="init" name="-check-automatic-build">
            <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
        </target>
        <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
            <antcall target="clean"/>
        </target>
        <target depends="init,deps-jar" name="-pre-pre-compile">
            <mkdir dir="${build.classes.dir}"/>
        </target>
        <target name="-pre-compile">
            <!-- Empty placeholder for easier customization. -->
            <!-- You can override this target in the ../build.xml file. -->
        </target>
        <target if="do.depend.true" name="-compile-depend">
            <pathconvert property="build.generated.subdirs">
                <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
                    <include name="*"/>
                </dirset>
            </pathconvert>
            <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
        </target>
        <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
            <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
            <copy todir="${build.classes.dir}">
                <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
            </copy>
        </target>
        <target if="has.persistence.xml" name="-copy-persistence-xml">
            <mkdir dir="${build.classes.dir}/META-INF"/>
            <copy todir="${build.classes.dir}/META-INF">
                <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
            </copy>
        </target>
        <target name="-post-compile">
            <!-- Empty placeholder for easier customization. -->
            <!-- You can override this target in the ../build.xml file. -->
        </target>
        <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
        <target name="-pre-compile-single">
            <!-- Empty placeholder for easier customization. -->
            <!-- You can override this target in the ../build.xml file. -->
        </target>
        <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
            <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
            <j2seproject3:force-recompile/>
            <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
        </target>
        <target name="-post-compile-single">
            <!-- Empty placeholder for easier customization. -->
            <!-- You can override this target in the ../build.xml file. -->
        </target>
        <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
        <!--
                    ====================
                    JAR BUILDING SECTION
                    ====================
                -->
        <target depends="init" name="-pre-pre-jar">
            <dirname file="${dist.jar}" property="dist.jar.dir"/>
            <mkdir dir="${dist.jar.dir}"/>
        </target>
        <target name="-pre-jar">
            <!-- Empty placeholder for easier customization. -->
            <!-- You can override this target in the ../build.xml file. -->
        </target>
        <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
            <j2seproject1:jar/>
        </target>
        <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
            <j2seproject1:jar manifest="${manifest.file}"/>
        </target>
        <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
            <j2seproject1:jar manifest="${manifest.file}">
                <j2seproject1:manifest>
                    <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
                </j2seproject1:manifest>
            </j2seproject1:jar>
            <echo level="info">To run this application from the command line without Ant, try:</echo>
            <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
            <property location="${dist.jar}" name="dist.jar.resolved"/>
            <pathconvert property="run.classpath.with.dist.jar">
                <path path="${run.classpath}"/>
                <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
            </pathconvert>
            <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
        </target>
        <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
            <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
            <touch file="${tmp.manifest.file}" verbose="false"/>
        </target>
        <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
            <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
            <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
        </target>
        <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
            <manifest file="${tmp.manifest.file}" mode="update">
                <attribute name="Main-Class" value="${main.class}"/>
            </manifest>
        </target>
        <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
            <basename file="${application.splash}" property="splashscreen.basename"/>
            <mkdir dir="${build.classes.dir}/META-INF"/>
            <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
            <manifest file="${tmp.manifest.file}" mode="update">
                <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
            </manifest>
        </target>
        <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
            <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
            <echo level="info">To run this application from the command line without Ant, try:</echo>
            <property location="${dist.jar}" name="dist.jar.resolved"/>
            <echo level="info">java -jar "${dist.jar.resolved}"</echo>
        </target>
        <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
            <delete>
                <fileset file="${tmp.manifest.file}"/>
            </delete>
        </target>
        <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
        <target name="-post-jar">
            <!-- Empty placeholder for easier customization. -->
            <!-- You can override this target in the ../build.xml file. -->
        </target>
        <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
        <!--
                    =================
                    EXECUTION SECTION
                    =================
                -->
        <target depends="init,compile" description="Run a main class." name="run">
            <j2seproject1:java>
                <customize>
                    <arg line="${application.args}"/>
                </customize>
            </j2seproject1:java>
        </target>
        <target name="-do-not-recompile">
            <property name="javac.includes.binary" value=""/>
        </target>
        <target depends="init,compile-single" name="run-single">
            <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
            <j2seproject1:java classname="${run.class}"/>
        </target>
        <target depends="init,compile-test-single" name="run-test-with-main">
            <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
            <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
        </target>
        <!--
                    =================
                    DEBUGGING SECTION
                    =================
                -->
        <target depends="init" if="netbeans.home" name="-debug-start-debugger">
            <j2seproject1:nbjpdastart name="${debug.class}"/>
        </target>
        <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
            <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
        </target>
        <target depends="init,compile" name="-debug-start-debuggee">
            <j2seproject3:debug>
                <customize>
                    <arg line="${application.args}"/>
                </customize>
            </j2seproject3:debug>
        </target>
        <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
        <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
            <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
        </target>
        <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
        <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
            <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
            <j2seproject3:debug classname="${debug.class}"/>
        </target>
        <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
        <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
            <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
            <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
        </target>
        <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
        <target depends="init" name="-pre-debug-fix">
            <fail unless="fix.includes">Must set fix.includes</fail>
            <property name="javac.includes" value="${fix.includes}.java"/>
        </target>
        <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
            <j2seproject1:nbjpdareload/>
        </target>
        <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
        <!--
                    =================
                    PROFILING SECTION
                    =================
                -->
        <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
            <nbprofiledirect>
                <classpath>
                    <path path="${run.classpath}"/>
                </classpath>
            </nbprofiledirect>
            <profile/>
        </target>
        <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
            <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
            <nbprofiledirect>
                <classpath>
                    <path path="${run.classpath}"/>
                </classpath>
            </nbprofiledirect>
            <profile classname="${profile.class}"/>
        </target>
        <!--
                    =========================
                    APPLET PROFILING  SECTION
                    =========================
                -->
        <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
            <nbprofiledirect>
                <classpath>
                    <path path="${run.classpath}"/>
                </classpath>
            </nbprofiledirect>
            <profile classname="sun.applet.AppletViewer">
                <customize>
                    <arg value="${applet.url}"/>
                </customize>
            </profile>
        </target>
        <!--
                    =========================
                    TESTS PROFILING  SECTION
                    =========================
                -->
        <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
            <nbprofiledirect>
                <classpath>
                    <path path="${run.test.classpath}"/>
                </classpath>
            </nbprofiledirect>
            <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
                <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
                <jvmarg value="${profiler.info.jvmargs.agent}"/>
                <jvmarg line="${profiler.info.jvmargs}"/>
                <test name="${profile.class}"/>
                <classpath>
                    <path path="${run.test.classpath}"/>
                </classpath>
                <syspropertyset>
                    <propertyref prefix="test-sys-prop."/>
                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
                </syspropertyset>
                <formatter type="brief" usefile="false"/>
                <formatter type="xml"/>
            </junit>
        </target>
        <!--
                    ===============
                    JAVADOC SECTION
                    ===============
                -->
        <target depends="init" if="have.sources" name="-javadoc-build">
            <mkdir dir="${dist.javadoc.dir}"/>
    [COLOR="#FF0000"]        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">[/COLOR]
                <classpath>
                    <path path="${javac.classpath}"/>
                </classpath>
                <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
                    <filename name="**/*.java"/>
                </fileset>
                <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
                    <include name="**/*.java"/>
                    <!--<exclude name="*.java"/>-->
                </fileset>
            </javadoc>
            <copy todir="${dist.javadoc.dir}">
                <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
                    <filename name="**/doc-files/**"/>
                </fileset>
                <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
                    <include name="**/doc-files/**"/>
                </fileset>
            </copy>
        </target>
        <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
            <nbbrowse file="${dist.javadoc.dir}/index.html"/>
        </target>
        <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
        <!--
                    =========================
                    JUNIT COMPILATION SECTION
                    =========================
                -->
        <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
            <mkdir dir="${build.test.classes.dir}"/>
        </target>
        <target name="-pre-compile-test">
            <!-- Empty placeholder for easier customization. -->
            <!-- You can override this target in the ../build.xml file. -->
        </target>
        <target if="do.depend.true" name="-compile-test-depend">
            <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
        </target>
        <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
            <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
            <copy todir="${build.test.classes.dir}">
                <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
            </copy>
        </target>
        <target name="-post-compile-test">
            <!-- Empty placeholder for easier customization. -->
            <!-- You can override this target in the ../build.xml file. -->
        </target>
        <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
        <target name="-pre-compile-test-single">
            <!-- Empty placeholder for easier customization. -->
            <!-- You can override this target in the ../build.xml file. -->
        </target>
        <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
            <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
            <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
            <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
            <copy todir="${build.test.classes.dir}">
                <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
            </copy>
        </target>
        <target name="-post-compile-test-single">
            <!-- Empty placeholder for easier customization. -->
            <!-- You can override this target in the ../build.xml file. -->
        </target>
        <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
        <!--
                    =======================
                    JUNIT EXECUTION SECTION
                    =======================
                -->
        <target depends="init" if="have.tests" name="-pre-test-run">
            <mkdir dir="${build.test.results.dir}"/>
        </target>
        <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
            <j2seproject3:junit testincludes="**/*Test.java"/>
        </target>
        <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
            <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
        </target>
        <target depends="init" if="have.tests" name="test-report"/>
        <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
        <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
        <target depends="init" if="have.tests" name="-pre-test-run-single">
            <mkdir dir="${build.test.results.dir}"/>
        </target>
        <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
            <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
            <j2seproject3:junit excludes="" includes="${test.includes}"/>
        </target>
        <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
            <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
        </target>
        <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
        <!--
                    =======================
                    JUNIT DEBUGGING SECTION
                    =======================
                -->
        <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
            <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
            <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
            <delete file="${test.report.file}"/>
            <mkdir dir="${build.test.results.dir}"/>
            <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
                <customize>
                    <syspropertyset>
                        <propertyref prefix="test-sys-prop."/>
                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
                    </syspropertyset>
                    <arg value="${test.class}"/>
                    <arg value="showoutput=true"/>
                    <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
                    <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
                </customize>
            </j2seproject3:debug>
        </target>
        <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
            <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
        </target>
        <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
        <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
            <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
        </target>
        <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
        <!--
                    =========================
                    APPLET EXECUTION SECTION
                    =========================
                -->
        <target depends="init,compile-single" name="run-applet">
            <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
            <j2seproject1:java classname="sun.applet.AppletViewer">
                <customize>
                    <arg value="${applet.url}"/>
                </customize>
            </j2seproject1:java>
        </target>
        <!--
                    =========================
                    APPLET DEBUGGING  SECTION
                    =========================
                -->
        <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
            <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
            <j2seproject3:debug classname="sun.applet.AppletViewer">
                <customize>
                    <arg value="${applet.url}"/>
                </customize>
            </j2seproject3:debug>
        </target>
        <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
        <!--
                    ===============
                    CLEANUP SECTION
                    ===============
                -->
        <target name="-deps-clean-init" unless="built-clean.properties">
            <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
            <delete file="${built-clean.properties}" quiet="true"/>
        </target>
        <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
            <echo level="warn" message="Cycle detected: CoinTossSim was already built"/>
        </target>
        <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
            <mkdir dir="${build.dir}"/>
            <touch file="${built-clean.properties}" verbose="false"/>
            <property file="${built-clean.properties}" prefix="already.built.clean."/>
            <antcall target="-warn-already-built-clean"/>
            <propertyfile file="${built-clean.properties}">
                <entry key="${basedir}" value=""/>
            </propertyfile>
        </target>
        <target depends="init" name="-do-clean">
            <delete dir="${build.dir}"/>
            <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
        </target>
        <target name="-post-clean">
            <!-- Empty placeholder for easier customization. -->
            <!-- You can override this target in the ../build.xml file. -->
        </target>
        <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
        <target name="-check-call-dep">
            <property file="${call.built.properties}" prefix="already.built."/>
            <condition property="should.call.dep">
                <not>
                    <isset property="already.built.${call.subproject}"/>
                </not>
            </condition>
        </target>
        <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
            <ant antfile="${call.script}" inheritall="false" target="${call.target}">
                <propertyset>
                    <propertyref prefix="transfer."/>
                    <mapper from="transfer.*" to="*" type="glob"/>
                </propertyset>
            </ant>
        </target>
    </project>

    Any help is greatly appreciated!


  2. #2
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,512
    My Mood
    Grumpy
    Thanks
    0
    Thanked 165 Times in 156 Posts

    Default Re: Double always == 0! And a Javadoc issue! (Using NetBeans)

    Way too much code to wade through unless you can narrow it down.

    Are you sure you are not making the common mistake of doing integer division? 9 / 2 = 4 not 4.5 and if you are doing something like 4 / 5 then you will get 0 not 0.8.
    Improving the world one idiot at a time!

  3. The Following User Says Thank You to Junky For This Useful Post:

    CameronFaust (August 11th, 2011)

  4. #3
    Junior Member
    Join Date
    Aug 2011
    Posts
    21
    My Mood
    Amused
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Double always == 0! And a Javadoc issue! (Using NetBeans)

    Quote Originally Posted by Junky View Post
    Way too much code to wade through unless you can narrow it down.

    Are you sure you are not making the common mistake of doing integer division? 9 / 2 = 4 not 4.5 and if you are doing something like 4 / 5 then you will get 0 not 0.8.
    DOH! That would make sense!

    Actually: I fixed the problem by casting it before i set the variable so:

    double headsPercentage = 100 * ((double)totalNumberOfHeads / totalNumberOfTosses);
    double tailsPercentage = 100 * ((double)totalNumberOfTails / totalNumberOfTosses);
    Last edited by CameronFaust; August 11th, 2011 at 12:38 AM.

Similar Threads

  1. Ok to post Javadoc related beta invite?
    By innovasys in forum Member Introductions
    Replies: 2
    Last Post: July 14th, 2011, 08:59 AM
  2. [SOLVED] Read double from console without having to read a string and converting it to double.
    By Lord Voldemort in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: June 26th, 2011, 08:08 AM
  3. PLEASE HELP ME with double buffer
    By DouboC in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 10th, 2011, 04:32 PM
  4. How do you generate javadoc?
    By javapenguin in forum Java IDEs
    Replies: 15
    Last Post: November 27th, 2010, 08:12 PM
  5. string to double
    By wolfgar in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 13th, 2009, 10:47 PM