Question: Instructions Create a JavaFx program that displays a single Stage GUI allowing information about Person class to be entered in textfields. Start with a Label

Instructions

Create a JavaFx program that displays a single Stage GUI allowing information about Person class to be entered in textfields.

Start with a Label stating First Name and pair it with a TextField allowing user to enter name.

Repeat for Last Name, Id and City

Add two Buttons at the bottom - Save and Cancel

The GUI won't actually do anything yet, but will look like a form for entering a new Person.

GIVEN FILE BELOW:

import java.io.Serializable;

/** * ITEC 3150 - Homework 2 Person Class - This is the object we will read and * write to file * * @author cjohns25 * */ public class Person implements Serializable { public String firstName; public String lastName; public int idNum; public String city;

/** * Default constructor used to create empty attributes */ public Person() { firstName = ""; lastName = ""; idNum = 0; city = ""; }

/** * @param firstName * @param lastName * @param idNum * @param city */ public Person(String firstName, String lastName, int idNum, String city) { this.firstName = firstName; this.lastName = lastName; this.idNum = idNum; this.city = city; }

/* * (non-Javadoc) * * @see java.lang.Object#toString() */ @Override public String toString() { return "Person [firstName=" + firstName + ", lastName=" + lastName + ", idNum=" + idNum + ", city=" + city + "]"; }

/** * @return the firstName */ public String getFirstName() { return firstName; }

/** * @param firstName * the firstName to set */ public void setFirstName(String firstName) { this.firstName = firstName; }

/** * @return the lastName */ public String getLastName() { return lastName; }

/** * @param lastName * the lastName to set */ public void setLastName(String lastName) { this.lastName = lastName; }

/** * @return the idNum */ public int getIdNum() { return idNum; }

/** * @param idNum * the idNum to set */ public void setIdNum(int idNum) { this.idNum = idNum; }

/** * @return the city */ public String getCity() { return city; }

/** * @param city * the city to set */ public void setCity(String city) { this.city = city; }

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!