removed child class, upgraded classpath
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre1.8.0_221"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre1.8.0_231"/>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ public class BillingSystem {
|
|||||||
@Override
|
@Override
|
||||||
public void keyTyped(KeyEvent e) {
|
public void keyTyped(KeyEvent e) {
|
||||||
|
|
||||||
Child_Billing OnlyNumbers = new Child_Billing();
|
Parent_Billing OnlyNumbers = new Parent_Billing();
|
||||||
try {
|
try {
|
||||||
OnlyNumbers.NumbersOnly(e);
|
OnlyNumbers.NumbersOnly(e);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
@@ -195,7 +195,7 @@ public class BillingSystem {
|
|||||||
textFieldTravel.addKeyListener(new KeyAdapter() {
|
textFieldTravel.addKeyListener(new KeyAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void keyTyped(KeyEvent e) {
|
public void keyTyped(KeyEvent e) {
|
||||||
Child_Billing OnlyNumbers = new Child_Billing();
|
Parent_Billing OnlyNumbers = new Parent_Billing();
|
||||||
try {
|
try {
|
||||||
OnlyNumbers.NumbersOnly(e);
|
OnlyNumbers.NumbersOnly(e);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
@@ -212,7 +212,7 @@ public class BillingSystem {
|
|||||||
textFieldPlastic.addKeyListener(new KeyAdapter() {
|
textFieldPlastic.addKeyListener(new KeyAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void keyTyped(KeyEvent e) {
|
public void keyTyped(KeyEvent e) {
|
||||||
Child_Billing OnlyNumbers = new Child_Billing();
|
Parent_Billing OnlyNumbers = new Parent_Billing();
|
||||||
try {
|
try {
|
||||||
OnlyNumbers.NumbersOnly(e);
|
OnlyNumbers.NumbersOnly(e);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
@@ -229,7 +229,7 @@ public class BillingSystem {
|
|||||||
textFieldCopper.addKeyListener(new KeyAdapter() {
|
textFieldCopper.addKeyListener(new KeyAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void keyTyped(KeyEvent e) {
|
public void keyTyped(KeyEvent e) {
|
||||||
Child_Billing OnlyNumbers = new Child_Billing();
|
Parent_Billing OnlyNumbers = new Parent_Billing();
|
||||||
try {
|
try {
|
||||||
OnlyNumbers.NumbersOnly(e);
|
OnlyNumbers.NumbersOnly(e);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
@@ -246,7 +246,7 @@ public class BillingSystem {
|
|||||||
textFieldChrome.addKeyListener(new KeyAdapter() {
|
textFieldChrome.addKeyListener(new KeyAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void keyTyped(KeyEvent e) {
|
public void keyTyped(KeyEvent e) {
|
||||||
Child_Billing OnlyNumbers = new Child_Billing();
|
Parent_Billing OnlyNumbers = new Parent_Billing();
|
||||||
try {
|
try {
|
||||||
OnlyNumbers.NumbersOnly(e);
|
OnlyNumbers.NumbersOnly(e);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
@@ -482,7 +482,7 @@ public class BillingSystem {
|
|||||||
JButton btnExit = new JButton("Exit");
|
JButton btnExit = new JButton("Exit");
|
||||||
btnExit.addActionListener(new ActionListener() {
|
btnExit.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent arg0) {
|
public void actionPerformed(ActionEvent arg0) {
|
||||||
Child_Billing iExit = new Child_Billing();
|
Parent_Billing iExit = new Parent_Billing();
|
||||||
try {
|
try {
|
||||||
iExit.iExitSystem();
|
iExit.iExitSystem();
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
@@ -537,25 +537,19 @@ public class BillingSystem {
|
|||||||
tDate.format(timer.getTime());
|
tDate.format(timer.getTime());
|
||||||
// ----------------------------Receipt----------------------------
|
// ----------------------------Receipt----------------------------
|
||||||
|
|
||||||
textReceipt.append("\tBilling System:\n" + "Reference:\t\t\t" + refs +
|
textReceipt.append("\tBilling System:\n" + "Reference:\t\t\t" + refs
|
||||||
"\n================================================\n" +
|
+ "\n================================================\n" + "Labour:\t\t\t"
|
||||||
"Labour:\t\t\t" + textFieldLabour.getText() + "\n\n" +
|
+ textFieldLabour.getText() + "\n\n" + "Travel:\t\t\t" + textFieldTravel.getText() + "\n\n"
|
||||||
"Travel:\t\t\t" + textFieldTravel.getText() + "\n\n" +
|
+ "Plastic:\t\t\t" + textFieldPlastic.getText() + "\n\n" + "Copper:\t\t\t"
|
||||||
"Plastic:\t\t\t" + textFieldPlastic.getText() + "\n\n" +
|
+ textFieldCopper.getText() + "\n\n" + "Chrome:\t\t\t" + textFieldChrome.getText() + "\n\n"
|
||||||
"Copper:\t\t\t" + textFieldCopper.getText() + "\n\n" +
|
+ "VAT:\t\t\t" + textFieldVAT.getText() + "\n\n"
|
||||||
"Chrome:\t\t\t" + textFieldChrome.getText() + "\n\n" +
|
+ "================================================\n" +
|
||||||
"VAT:\t\t\t" + textFieldVAT.getText() + "\n\n" +
|
|
||||||
"================================================\n"+
|
|
||||||
|
|
||||||
"Tax:\t\t\t" + textFieldTax.getText() + "\n\n" +
|
"Tax:\t\t\t" + textFieldTax.getText() + "\n\n" + "Subtotal:\t\t\t" + textFieldSubtotal.getText()
|
||||||
"Subtotal:\t\t\t" + textFieldSubtotal.getText() + "\n\n" +
|
+ "\n\n" + "Total:\t\t\t" + textFieldTotal.getText() + "\n\n" +
|
||||||
"Total:\t\t\t" + textFieldTotal.getText() + "\n\n" +
|
|
||||||
|
|
||||||
"================================================\n\n"+
|
"================================================\n\n" + tDate.format(timer.getTime()) + "\n"
|
||||||
tDate.format(timer.getTime()) + "\n"+
|
+ tTime.format(timer.getTime()) + "\n" + "\nThank you!");
|
||||||
tTime.format(timer.getTime()) + "\n"+
|
|
||||||
"\nThank you!"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
btnRecipt.setFont(new Font("Tahoma", Font.BOLD, 35));
|
btnRecipt.setFont(new Font("Tahoma", Font.BOLD, 35));
|
||||||
@@ -567,7 +561,7 @@ public class BillingSystem {
|
|||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
|
||||||
double iVAT, iTax, iSubtotal, iTotal;
|
double iVAT, iTax, iSubtotal, iTotal;
|
||||||
Child_Billing Cost_Of_Material = new Child_Billing();
|
Parent_Billing Cost_Of_Material = new Parent_Billing();
|
||||||
Cost_Of_Material.Labour = Cost_Of_Material.pLabour * Double.parseDouble(textFieldLabour.getText());
|
Cost_Of_Material.Labour = Cost_Of_Material.pLabour * Double.parseDouble(textFieldLabour.getText());
|
||||||
Cost_Of_Material.Travel = Cost_Of_Material.pTravel * Double.parseDouble(textFieldTravel.getText());
|
Cost_Of_Material.Travel = Cost_Of_Material.pTravel * Double.parseDouble(textFieldTravel.getText());
|
||||||
Cost_Of_Material.Plastic = Cost_Of_Material.pPlastic * Double.parseDouble(textFieldPlastic.getText());
|
Cost_Of_Material.Plastic = Cost_Of_Material.pPlastic * Double.parseDouble(textFieldPlastic.getText());
|
||||||
@@ -595,9 +589,8 @@ public class BillingSystem {
|
|||||||
String total = String.format("%.2f", iTotal);
|
String total = String.format("%.2f", iTotal);
|
||||||
textFieldTotal.setText(total);
|
textFieldTotal.setText(total);
|
||||||
|
|
||||||
|
textFieldCostOfMaterial.setText(String.format("%.2f",
|
||||||
textFieldCostOfMaterial.setText(String.format("%.2f",Cost_Of_Material.Chrome + Cost_Of_Material.Copper
|
Cost_Of_Material.Chrome + Cost_Of_Material.Copper + Cost_Of_Material.Plastic));
|
||||||
+ Cost_Of_Material.Plastic));
|
|
||||||
|
|
||||||
textFieldCostOfLabor.setText(String.format("%.2f", Cost_Of_Material.Labour));
|
textFieldCostOfLabor.setText(String.format("%.2f", Cost_Of_Material.Labour));
|
||||||
textFieldMileage.setText(String.format("%.2f", Cost_Of_Material.Travel));
|
textFieldMileage.setText(String.format("%.2f", Cost_Of_Material.Travel));
|
||||||
@@ -624,9 +617,8 @@ public class BillingSystem {
|
|||||||
String total = String.format("%.2f", iTotal);
|
String total = String.format("%.2f", iTotal);
|
||||||
textFieldTotal.setText(total);
|
textFieldTotal.setText(total);
|
||||||
|
|
||||||
|
textFieldCostOfMaterial.setText(String.format("%.2f",
|
||||||
textFieldCostOfMaterial.setText(String.format("%.2f",Cost_Of_Material.Chrome + Cost_Of_Material.Copper
|
Cost_Of_Material.Chrome + Cost_Of_Material.Copper + Cost_Of_Material.Plastic));
|
||||||
+ Cost_Of_Material.Plastic));
|
|
||||||
|
|
||||||
textFieldCostOfLabor.setText(String.format("%.2f", Cost_Of_Material.Labour));
|
textFieldCostOfLabor.setText(String.format("%.2f", Cost_Of_Material.Labour));
|
||||||
textFieldMileage.setText(String.format("%.2f", Cost_Of_Material.Travel));
|
textFieldMileage.setText(String.format("%.2f", Cost_Of_Material.Travel));
|
||||||
@@ -653,9 +645,8 @@ public class BillingSystem {
|
|||||||
String total = String.format("%.2f", iTotal);
|
String total = String.format("%.2f", iTotal);
|
||||||
textFieldTotal.setText(total);
|
textFieldTotal.setText(total);
|
||||||
|
|
||||||
|
textFieldCostOfMaterial.setText(String.format("%.2f",
|
||||||
textFieldCostOfMaterial.setText(String.format("%.2f",Cost_Of_Material.Chrome + Cost_Of_Material.Copper
|
Cost_Of_Material.Chrome + Cost_Of_Material.Copper + Cost_Of_Material.pPlastic));
|
||||||
+ Cost_Of_Material.pPlastic));
|
|
||||||
|
|
||||||
textFieldCostOfLabor.setText(String.format("%.2f", Cost_Of_Material.Labour));
|
textFieldCostOfLabor.setText(String.format("%.2f", Cost_Of_Material.Labour));
|
||||||
textFieldMileage.setText(String.format("%.2f", Cost_Of_Material.Travel));
|
textFieldMileage.setText(String.format("%.2f", Cost_Of_Material.Travel));
|
||||||
@@ -682,9 +673,8 @@ public class BillingSystem {
|
|||||||
String total = String.format("%.2f", iTotal);
|
String total = String.format("%.2f", iTotal);
|
||||||
textFieldTotal.setText(total);
|
textFieldTotal.setText(total);
|
||||||
|
|
||||||
|
textFieldCostOfMaterial.setText(String.format("%.2f",
|
||||||
textFieldCostOfMaterial.setText(String.format("%.2f",Cost_Of_Material.Chrome + Cost_Of_Material.Copper
|
Cost_Of_Material.Chrome + Cost_Of_Material.Copper + Cost_Of_Material.Plastic));
|
||||||
+ Cost_Of_Material.Plastic));
|
|
||||||
|
|
||||||
textFieldCostOfLabor.setText(String.format("%.2f", Cost_Of_Material.Labour));
|
textFieldCostOfLabor.setText(String.format("%.2f", Cost_Of_Material.Labour));
|
||||||
textFieldMileage.setText(String.format("%.2f", Cost_Of_Material.Travel));
|
textFieldMileage.setText(String.format("%.2f", Cost_Of_Material.Travel));
|
||||||
@@ -711,9 +701,8 @@ public class BillingSystem {
|
|||||||
String total = String.format("%.2f", iTotal);
|
String total = String.format("%.2f", iTotal);
|
||||||
textFieldTotal.setText(total);
|
textFieldTotal.setText(total);
|
||||||
|
|
||||||
|
textFieldCostOfMaterial.setText(String.format("%.2f",
|
||||||
textFieldCostOfMaterial.setText(String.format("%.2f",Cost_Of_Material.Chrome + Cost_Of_Material.Copper
|
Cost_Of_Material.Chrome + Cost_Of_Material.Copper + Cost_Of_Material.pPlastic));
|
||||||
+ Cost_Of_Material.pPlastic));
|
|
||||||
|
|
||||||
textFieldCostOfLabor.setText(String.format("%.2f", Cost_Of_Material.Labour));
|
textFieldCostOfLabor.setText(String.format("%.2f", Cost_Of_Material.Labour));
|
||||||
textFieldMileage.setText(String.format("%.2f", Cost_Of_Material.Travel));
|
textFieldMileage.setText(String.format("%.2f", Cost_Of_Material.Travel));
|
||||||
@@ -740,14 +729,14 @@ public class BillingSystem {
|
|||||||
String total = String.format("%.2f", iTotal);
|
String total = String.format("%.2f", iTotal);
|
||||||
textFieldTotal.setText(total);
|
textFieldTotal.setText(total);
|
||||||
|
|
||||||
|
textFieldCostOfMaterial.setText(String.format("%.2f",
|
||||||
textFieldCostOfMaterial.setText(String.format("%.2f",Cost_Of_Material.Chrome + Cost_Of_Material.Copper
|
Cost_Of_Material.Chrome + Cost_Of_Material.Copper + Cost_Of_Material.Plastic));
|
||||||
+ Cost_Of_Material.Plastic));
|
|
||||||
|
|
||||||
textFieldCostOfLabor.setText(String.format("%.2f", Cost_Of_Material.Labour));
|
textFieldCostOfLabor.setText(String.format("%.2f", Cost_Of_Material.Labour));
|
||||||
textFieldMileage.setText(String.format("%.2f", Cost_Of_Material.Travel));
|
textFieldMileage.setText(String.format("%.2f", Cost_Of_Material.Travel));
|
||||||
}
|
}
|
||||||
//--------------------------------Enable Text-----------------------------------------------------------
|
// --------------------------------Enable
|
||||||
|
// Text-----------------------------------------------------------
|
||||||
JTextField clearText = null;
|
JTextField clearText = null;
|
||||||
|
|
||||||
for (Component c : panel_2.getComponents()) {
|
for (Component c : panel_2.getComponents()) {
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
package billingSystem;
|
|
||||||
|
|
||||||
public class Child_Billing extends Parent_Billing {
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user