Question
JAVA program I have this in my code but i dont know what it references or means. it has an error that i cant resolve
JAVA program
I have this in my code but i dont know what it references or means. it has an error that i cant resolve does anyone know how i can fix this? thanks
//here is the entire class
package com.paycheck.controller;
import com.paycheck.entity.Employee; import com.paycheck.entity.Paycheck; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.DatePicker; import javafx.scene.control.TextField; import javafx.scene.text.Font; import javafx.stage.FileChooser;
import java.io.*; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.List;
public class Controller {
@FXML public Button openBtnId;
@FXML public Button printPaycheckId;
@FXML public TextField nameId;
@FXML public DatePicker dateOfBirthId;
@FXML public TextField addressId;
@FXML public TextField yearsOfExperience;
@FXML public TextField welcomeId;
private Employee employee;
public void printPaycheckBtnAction(ActionEvent event) { if(employee != null) { FileChooser fileChooser = new FileChooser(); fileChooser.setTitle("Save Paycheck"); fileChooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("Text Files", "*.txt")); File file = fileChooser.showSaveDialog(null); if(file != null){ SaveFile(employee.toString(), file); } System.out.println(employee.toString()); } }
private void SaveFile(String content, File file){ try { FileWriter fileWriter = new FileWriter(file); fileWriter.write(content); fileWriter.close(); } catch (IOException ex) { } }
public void openBtnAction(ActionEvent actionEvent) { if (nameId.getText().isEmpty() || addressId.getText().isEmpty() || yearsOfExperience.getText().isEmpty()) { welcomeId.setFont(new Font("System", 15)); welcomeId.setText("Please input all fields"); return; }
FileChooser fileChooser = new FileChooser(); fileChooser.setTitle("Open Resource File"); fileChooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("Text Files", "*.txt")); File selectedFile = fileChooser.showOpenDialog(null); if (selectedFile != null) {
welcomeId.setFont(new Font("System", 23)); welcomeId.setText("Welcome!");
List
}
private List
try (BufferedReader br = new BufferedReader(new FileReader(file))) { String line; while ((line = br.readLine()) != null) { list.add(line); } } catch (IOException e) { e.printStackTrace(); } return list; }
private int findWage(List wage = Integer.parseInt(list.get(i).substring(list.get(i).indexOf('$'), list.get(i).length()).replaceAll("[^0-9]", "").trim()); break; } else { from = Integer.parseInt(list.get(i).substring(0, list.get(i).indexOf('')).trim()); to = Integer.parseInt(list.get(i).substring(list.get(i).indexOf('') + 1, list.get(i).indexOf('$')).trim()); } if ((experience >= from && experience }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started