我想使用 JavaFX 显示 .txt 报告文件中的数据。在我的代码中,我尝试使用标签和 Vbox 在 GUI 中以多种格式显示信息到场景。但是,我将结果输出为 GUI 而不是控制台,结果很糟糕。我试图研究我的问题,但找不到解决问题所需的信息。
这是我需要使用 JavaFX 显示为 GUI 应用程序的报告:
这是我的代码作为 GUI 显示的内容:
这是我的源代码:
package sample;
public class CustomerSale {
// Details of reports
private String zipCodeExtension;
private int customerNumber;
private String customerName;
private int purchaseDate;
private String make;
private int purchasePrice;
private int yearOfVehicle;
private int satisfactionRating;
// Create constructor argument
public CustomerSale(String zipCodeExtension, int customerNumber, String customerName,
int purchaseDate, String make, int purchasePrice,
int yearOfVehicle, int satisfactionRating) {
this.zipCodeExtension = zipCodeExtension;
this.customerNumber …Run Code Online (Sandbox Code Playgroud)