1 import javax.swing.JOptionPane;
2
3 /**
4 This program demonstrates the use of option panes for
5 input and output.
6 */
7 public class OptionPaneDemo
8 {
9 public static void main(String[] args)
10 {
11 String input = JOptionPane.showInputDialog("Enter price:");
12 double price = Double.parseDouble(input);
13 final double TAX_RATE = 8.5;
14 price = price * (1 + TAX_RATE / 100);
15 JOptionPane.showMessageDialog(null, "Price after tax: " + price);
16 }
17 }