Q.2.4 When the Process Report menu item is clicked, capture the selected agent location,

estate agent name, property price, and commission percentage, and display the estate
agent report. The commission is calculated by multiplying the property price by the
commission percentage.Q.2.5 When the Save Report menu item is clicked, save the estate agent report to a text file
named report.txt.Q.2.6 When clicking the Clear Menu item, set the text fields and text area to the default
state.
Q.2.7 Make use of a class named EstateAgent that contains methods to calculate the estate
agent commission and validate the data. Only valid data should be captured in the
application; the validation rules are:
VALIDATION RULE
Agent Location It cannot be empty.
Agent Name It cannot be empty.
Property Price Cannot be less than or equal to zero (0)
Commission Percentage Cannot be less than or equal to zero (0)
The EstateAgent class must implement an IEstateAgent interface that contains the
following:
public interface IEstateAgent {
double CalculateCommission(String propertyPrice, String agentCommission);
boolean ValidateData(Data dataToValidate);..IN JAVA

Here is a possible implementation of the EstateAgent class that implements the IEstateAgent interface:

```java
public class EstateAgent implements IEstateAgent {

@Override
public double CalculateCommission(String propertyPrice, String agentCommission) {
double price = Double.parseDouble(propertyPrice);
double commission = Double.parseDouble(agentCommission);

return price * commission / 100;
}

@Override
public boolean ValidateData(Data dataToValidate) {
if (dataToValidate.getAgentLocation().isEmpty() || dataToValidate.getAgentName().isEmpty() || dataToValidate.getPropertyPrice() <= 0 || dataToValidate.getCommissionPercentage() <= 0) {
return false;
}

return true;
}

}
```

Here is a possible implementation of the Data class that holds the data to be validated:

```java
public class Data {
private String agentLocation;
private String agentName;
private double propertyPrice;
private double commissionPercentage;

// constructor, getters and setters

public String getAgentLocation() {
return agentLocation;
}

public void setAgentLocation(String agentLocation) {
this.agentLocation = agentLocation;
}

public String getAgentName() {
return agentName;
}

public void setAgentName(String agentName) {
this.agentName = agentName;
}

public double getPropertyPrice() {
return propertyPrice;
}

public void setPropertyPrice(double propertyPrice) {
this.propertyPrice = propertyPrice;
}

public double getCommissionPercentage() {
return commissionPercentage;
}

public void setCommissionPercentage(double commissionPercentage) {
this.commissionPercentage = commissionPercentage;
}
}
```

Note: This is just a possible implementation and may need to be adapted to fit into your existing code structure.