package numbers;




import java.awt.Font;

import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;

@SuppressWarnings("restriction")
public class PiCalc extends Application {

	private GridPane gridPane;
	private Scene scene;
	private TextArea result;
	
	private int LIMIT = 50;
	
	public static void main(String[] args) {
		
//		new PiCalc();
		Application.launch(args);
		
	}
	
	@Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Calculate Pi to n decimal places.");

		//Creating a GridPane container
		gridPane = new GridPane();
		gridPane.setPadding(new Insets(10, 10, 10, 10));
		gridPane.setVgap(5);
		gridPane.setHgap(5);
		gridPane.setAlignment(Pos.CENTER);
		
		//Defining the input text field
		final TextField input = new TextField();
		input.setPromptText("Choose integer n.");
		input.setPrefColumnCount(10);
		input.getText();
		GridPane.setConstraints(input, 0, 0);
		gridPane.getChildren().add(input);
		
		result = new TextArea();
		GridPane.setConstraints(result, 0, 3);
		gridPane.getChildren().add(result);

        
        Button run = new Button("Run...");
        run.setOnAction(new EventHandler<ActionEvent>() {
            @Override public void handle(ActionEvent e) {
    			int limit = Integer.parseInt(input.getText());
    			result.setText(input.getText());
            }
        });

		GridPane.setConstraints(run, 0, 1);
		gridPane.getChildren().add(run);

		
		scene = new Scene(gridPane, 300, 200);
        primaryStage.setScene(scene);
        primaryStage.show();
		gridPane.setVisible(true);

////		decimalPlaces = new JTextField();

		
//		north = new JPanel(new GridLayout(1, 3));
//		north.add(label);
//		decimalPlaces = new JTextField();
//		north.add(decimalPlaces);
//		run = new JButton("Run..");
//		
//		run.addActionListener(this);
//		
//		
//		frame.add(north, BorderLayout.NORTH);
//		frame.add(new JScrollPane(result), BorderLayout.CENTER);
//
//		north.add(run, BorderLayout.SOUTH);
//		jFrame.setVisible(true);
	}

//	@Override
//	public void actionPerformed(ActionEvent e) {
//			int limit = Integer.parseInt(jDecimalPlaces.getText());
//			int i = 1;
//			boolean flag = false;
//			result.setText(jDecimalPlaces.getText());
//	}
}

@@ -15,2542 +15,103 @@
 s;%0A%0A
-%0A%0A%0Aimport java.awt.Font;%0A%0Aimport javafx.application.Application;%0Aimport javafx.event.ActionEvent;%0Aimport javafx.event.EventHandler;%0Aimport javafx.geometry.Insets;%0Aimport javafx.geometry.Pos;%0Aimport javafx.scene.Scene;%0Aimport javafx.scene.control.Button;%0Aimport javafx.scene.control.TextArea;%0Aimport javafx.scene.control.TextField;%0Aimport javafx.scene.layout.GridPane;%0Aimport javafx.stage.Stage;%0A%0A@SuppressWarnings(%22restriction%22)%0Apublic class PiCalc extends Application %7B%0A%0A%09private GridPane gridPane;%0A%09private Scene scene;%0A%09private TextArea result;%0A%09%0A%09private int LIMIT = 50;%0A%09%0A%09public static void main(String%5B%5D args) %7B%0A%09%09%0A//%09%09new PiCalc();%0A%09%09Application.launch(args);%0A%09%09%0A%09%7D%0A%09%0A%09@Override%0A    public void start(Stage primaryStage) throws Exception %7B%0A        primaryStage.setTitle(%22Calculate Pi to n decimal places.%22);%0A%0A%09%09//Creating a GridPane container%0A%09%09gridPane = new GridPane();%0A%09%09gridPane.setPadding(new Insets(10, 10, 10, 10));%0A%09%09gridPane.setVgap(5);%0A%09%09gridPane.setHgap(5);%0A%09%09gridPane.setAlignment(Pos.CENTER);%0A%09%09%0A%09%09//Defining the input text field%0A%09%09final TextField input = new TextField();%0A%09%09input.setPromptText(%22Choose integer n.%22);%0A%09%09input.setPrefColumnCount(10);%0A%09%09input.getText();%0A%09%09GridPane.setConstraints(input, 0, 0);%0A%09%09gridPane.getChildren().add(input);%0A%09%09%0A%09%09result = new TextArea();%0A%09%09GridPane.setConstraints(result, 0, 3);%0A%09%09gridPane.getChildren().add(result);%0A%0A        %0A        Button run = new Button(%22Run...%22);%0A        run.setOnAction(new EventHandler%3CActionEvent%3E() %7B%0A            @Override public void handle(ActionEvent e) %7B%0A    %09%09%09int limit = Integer.parseInt(input.getText());%0A    %09%09%09result.setText(input.getText());%0A            %7D%0A        %7D);%0A%0A%09%09GridPane.setConstraints(run, 0, 1);%0A%09%09gridPane.getChildren().add(run);%0A%0A%09%09%0A%09%09scene = new Scene(gridPane, 300, 200);%0A        primaryStage.setScene(scene);%0A        primaryStage.show();%0A%09%09gridPane.setVisible(true);%0A%0A////%09%09decimalPlaces = new JTextField();%0A%0A%09%09%0A//%09%09north = new JPanel(new GridLayout(1, 3));%0A//%09%09north.add(label);%0A//%09%09decimalPlaces = new JTextField();%0A//%09%09north.add(decimalPlaces);%0A//%09%09run = new JButton(%22Run..%22);%0A//%09%09%0A//%09%09run.addActionListener(this);%0A//%09%09%0A//%09%09%0A//%09%09frame.add(north, BorderLayout.NORTH);%0A//%09%09frame.add(new JScrollPane(result), BorderLayout.CENTER);%0A//%0A//%09%09north.add(run, BorderLayout.SOUTH);%0A//%09%09jFrame.setVisible(true);%0A%09%7D%0A%0A//%09@Override%0A//%09public void actionPerformed(ActionEvent e) %7B%0A//%09%09%09int limit = Integer.parseInt(jDecimalPlaces.getText());%0A//%09%09%09int i = 1;%0A//%09%09%09boolean flag = false;%0A//%09%09%09result.setText(jDecimalPlaces.getText());%0A//%09%7D
+public class PiCalc  %7B%0A%0A%09%0A%09public static void main(String%5B%5D args) %7B%0A%09%09%0A%09%09%0A%09%7D%0A%09%0A%0A%09// use scanner%0A
 %0A%7D%0A

remove javafx