Here is working code.
Two errors amount is not defined and second thing is that you need to import javax.swing.JOptionPane;
<pre lang="java">
import javax.swing.JOptionPane;
public class Text {
public static void main(String[] args) {
String amount;
double stateSalesTax;
double countySalesTax;
double totalSalesTax;
double totalSalesAmount;
double amt;
amount = JOptionPane.showInputDialog("Enter the amount of purchase");
amt = Double.parseDouble(amount);
stateSalesTax = 0.055;
countySalesTax = 0.02;
totalSalesTax = stateSalesTax + countySalesTax;
totalSalesAmount = amt + totalSalesTax;
JOptionPane.showMessageDialog(null, "The purchase amount is: " + amt
+ "The state sales tax is:" + stateSalesTax
+ "The county sales tax is:" + countySalesTax
+ "The total amount of sales is:" + totalSalesAmount);
}
}