Enter text, push button, pie chart displays (broken) Why is the pie chart not displaying? Also, is it actually throwing an exception?
===

import java.awt.*;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.util.Scanner;

import javax.swing.*;

import javax.swing.border.TitledBorder;



public class PieChart extends JFrame {



    private JTextField jtfParticipation = new JTextField();

    private JTextField jtfProjects = new JTextField();

    private JTextField jtfQuizzes = new JTextField();

    private JTextField jtfFinalExam = new JTextField();

    private JButton jbtCreatePieChart = new JButton("Create Pie Chart");



    public PieChart() {



        // Text panel

        JPanel panel1 = new JPanel(new GridLayout(8, 0));

        panel1.setBorder(new TitledBorder("Input percentages:"));



        // A font to change from the default Plain font to Arial font

        Font arialFont = new Font("Arial", Font.PLAIN, 12);

        JLabel jlblParticipation = new JLabel("Participation %");

        JLabel jlblProjects = new JLabel("Projects %");

        JLabel jlblQuizzes = new JLabel("Quizzes %");

        JLabel jlblFinalExam = new JLabel("Final Exam %");



        // The labels use the new font

        jlblParticipation.setFont(arialFont);

        jlblProjects.setFont(arialFont);

        jlblQuizzes.setFont(arialFont);

        jlblFinalExam.setFont(arialFont);



        // Adds the objects to the panel

        panel1.add(jlblParticipation);

        panel1.add(jtfParticipation);

        panel1.add(jlblProjects);

        panel1.add(jtfProjects);

        panel1.add(jlblQuizzes);

        panel1.add(jtfQuizzes);

        panel1.add(jlblFinalExam);

        panel1.add(jtfFinalExam);



        // Assigns the text panel and the button to one panel

        JPanel panel2 = new JPanel(new BorderLayout());

        panel2.add(panel1, BorderLayout.CENTER);

        panel2.add(jbtCreatePieChart, BorderLayout.SOUTH);



        add(panel2, BorderLayout.WEST);


        jbtCreatePieChart.addActionListener(new ButtonListener());

    }



    class ButtonListener implements ActionListener {



        @Override

        public void actionPerformed(ActionEvent e) {



            // Adds the Pie Chart Graphic to the panel

            JPanel panel3 = new JPanel(new BorderLayout());

            panel3.add(new PieChartGraphic());



            // Adds the panel to the frame

            add(panel3, BorderLayout.EAST);


        }

    }



    class PieChartGraphic extends JPanel {



        @Override

        protected void paintComponent(Graphics slice) {



            super.paintComponent(slice);



            int xCenter = getWidth() / 2;

            int yCenter = getHeight() / 2;

            int radius = (int) (Math.min(getWidth(), getHeight()) * 0.4);

            int x = xCenter - radius;

            int y = yCenter - radius;



            double inputIsDouble;

            int inputIsInt;


            int currentAngle = 0;

            int availablePercentage = 100;

            inputIsDouble = userInput(jtfProjects.getText(), availablePercentage);

            inputIsInt = (int) (inputIsDouble * 3.6);

            // Sets the color of the filled

            slice.setColor(Color.RED);

            // Sets the start point and size of the angle

            slice.fillArc(x, y, 2 * radius, 2 * radius, currentAngle, inputIsInt);


            currentAngle += inputIsInt;

            availablePercentage -= inputIsDouble;


            inputIsDouble = userInput(jtfParticipation.getText(), availablePercentage);

            inputIsInt = (int) (inputIsDouble * 3.6);

            slice.setColor(Color.GREEN);

            slice.fillArc(x, y, 2 * radius, 2 * radius, currentAngle, inputIsInt);


            currentAngle += inputIsInt;

            availablePercentage -= inputIsDouble;


            inputIsDouble = userInput(jtfQuizzes.getText(), availablePercentage);

            inputIsInt = (int) (inputIsDouble * 3.6);

            slice.setColor(Color.BLUE);

            slice.fillArc(x, y, 2 * radius, 2 * radius, currentAngle, inputIsInt);


            currentAngle += inputIsInt;

            availablePercentage -= inputIsDouble;


            inputIsDouble = userInput(jtfFinalExam.getText(), availablePercentage);

            inputIsInt = (int) (inputIsDouble * 3.6);

            slice.setColor(Color.WHITE);

            slice.fillArc(x, y, 2 * radius, 2 * radius, currentAngle, inputIsInt);

            currentAngle += inputIsInt;

            availablePercentage -= inputIsDouble;



            // Places the text strings

            slice.setColor(Color.BLACK);

            slice.drawString("Participation - " + jtfParticipation.getText() + "%", 203, 20);

            slice.drawString("Projects - " + jtfProjects.getText() + "%", 20, 20);

            slice.drawString("Quizzes -- " + jtfQuizzes.getText() + "%", 20, 236);

            slice.drawString("Final - " + jtfFinalExam.getText() + "%", 203, 236);

        }

    }



    // Verifies if the text entered in the text field is actually a double.

    // This portion is unfinished as of right now.  The error message needs tweaking

    // to display correctly. Please ignore the error message portion for now and

    // please focus just on if it actually validates that the text can be converted

    // to a double and if not will throw an exception.


    public static double userInput(String inputIsString, int availablePercentage) {



        boolean loopAgain = true;

        double inputIsDouble = 0;



        do {

            Scanner inputIsNull = new Scanner(System.in);

            inputIsString = inputIsNull.nextLine();

            try {

                inputIsDouble = new Double(inputIsString).doubleValue();

                if (inputIsDouble > availablePercentage || inputIsDouble < 1) {

                    System.out.print("\"" + inputIsString + "\" is not : ");

                    for (int a = 1; a < availablePercentage; a++) {

                        System.out.print(a + ",");

                    }

                    System.out.println("\b or " + availablePercentage + ".");

                    System.out.println("Input a valid choice");

                } else {

                    loopAgain = false;

                }

            } catch (NumberFormatException z) {

                System.out.print("\"" + inputIsString + "\" is not ");

                for (int a = 1; a < availablePercentage; a++) {

                    System.out.print(a + ",");

                }

                System.out.println("\b or " + availablePercentage + ".");

                System.out.println("Input a valid choice");

            }

        } while (loopAgain);



        return inputIsDouble;

    }



    public static void main(String[] args) {

        PieChart frame = new PieChart();

        frame.setTitle("CMIS Pie Chart");

        frame.setSize(486, 294);

        frame.setLocationRelativeTo(null);

        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        frame.setResizable(false);

        frame.setVisible(true);

    }

}