Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

package javafxapplication5; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.chart.LineChart; import javafx.scene.chart.NumberAxis; import javafx.scene.chart.XYChart; import javafx.stage.Stage; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.Arrays; import javafx.collections.FXCollections; import

package javafxapplication5;

import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.chart.LineChart; import javafx.scene.chart.NumberAxis; import javafx.scene.chart.XYChart; import javafx.stage.Stage;

import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.Arrays; import javafx.collections.FXCollections; import javafx.scene.Group; import javafx.scene.chart.BarChart; import javafx.scene.chart.CategoryAxis; import javafx.scene.control.TextField; import javafx.scene.layout.FlowPane; import javafx.scene.layout.Pane;

/** * * @author User */ public class JavaFXApplication5 extends Application {

private static final int NUM_COLUMNS = 3; private static final int NUM_ROWS = 10;

private double[][] data; private double[] minValues; private double[] maxValues; private double[] avgValues;

public static void main(String[] args) { launch(args); }

@Override public void start(Stage primaryStage) throws Exception { TextField b = new TextField(); TextField b1 = new TextField(); TextField b3 = new TextField(); TextField b4 = new TextField(); TextField b5 = new TextField(); TextField b6 = new TextField(); TextField b7 = new TextField(); TextField b8 = new TextField(); TextField b9 = new TextField(); TextField b10 = new TextField(); TextField b11 = new TextField(); TextField b12 = new TextField(); TextField b13 = new TextField(); TextField b14 = new TextField(); TextField b15 = new TextField(); TextField b16 = new TextField(); TextField b17 = new TextField(); TextField b18 = new TextField(); TextField b19 = new TextField(); TextField b20 = new TextField(); TextField b21 = new TextField(); TextField b22 = new TextField(); { try (BufferedReader reader = new BufferedReader(new FileReader("C:\\Users\\User\\Documents\\NetBeansProjects\\JavaFXApplication5.txt"))) { String line = reader.readLine(); String[] values = line.split(","); b.setText(values[0]); b1.setText(values[1]); b3.setText(values[2]); b4.setText(values[3]); b5.setText(values[4]); b6.setText(values[5]); b7.setText(values[6]); b8.setText(values[7]); b9.setText(values[8]); b10.setText(values[9]); b11.setText(values[10]); b12.setText(values[11]); b13.setText(values[12]); b14.setText(values[13]); b15.setText(values[14]); b16.setText(values[15]); b17.setText(values[16]); b18.setText(values[17]); b19.setText(values[18]); b20.setText(values[19]); b21.setText(values[20]); b22.setText(values[21]);

} catch (IOException e) {

}

//Defining the x axis CategoryAxis xAxis = new CategoryAxis();

xAxis.setCategories(FXCollections.observableArrayList(Arrays.asList( "Slowest", "Average", "Fastest"))); xAxis.setLabel("category");

//Defining the y axis NumberAxis yAxis = new NumberAxis(); yAxis.setLabel("score"); BarChart BarChart = new BarChart<>(xAxis, yAxis); BarChart.setTitle("Singapore GP Top3 Drivers and Their racing times(in seconds)");

// Add data to chart for (int i = 0; i < 3; i++) { XYChart.Series series1 = new XYChart.Series(); series1.setName("Max"); series1.getData().add(new XYChart.Data("Slowest", 110)); series1.getData().add(new XYChart.Data("Average", 105)); series1.getData().add(new XYChart.Data("Fastest", 93)); XYChart.Series series2 = new XYChart.Series(); series2.setName("Perez"); series2.getData().add(new XYChart.Data("Slowest", 130)); series2.getData().add(new XYChart.Data("Average", 110)); series2.getData().add(new XYChart.Data("Fastest", 95)); XYChart.Series series3 = new XYChart.Series(); series3.setName("Carlos"); series3.getData().add(new XYChart.Data("Slowest", 130)); series3.getData().add(new XYChart.Data("Average", 110)); series3.getData().add(new XYChart.Data("Fastest", 95)); BarChart.getData().addAll(series1,series2,series3); } FlowPane pane = new FlowPane(); pane.getChildren().addAll(BarChart, b, b1,b3,b4,b5,b6,b7,b8); //, b, b1,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21,b22 // Show chart in window Scene scene = new Scene(pane, 1000, 1000); primaryStage.setTitle(""); primaryStage.setScene(scene); primaryStage.show(); }

}

}

I WANT HELP WITH UML DIAGRAM THATS ALL I NEED A UML DIAGRAM FOR THIS PROJECT

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB.NET Databases

Authors: Thearon Willis

1st Edition

1594864217, 978-1594864216

More Books

Students also viewed these Databases questions

Question

Explain in brief the functions and functioning of stock exchanges.

Answered: 1 week ago