Java program to design mini calculator with add and sub function
import javax.swing.*; import java.awt.event.*; public class JavaApplication5 { public static void main(String[] args) { JFrame f = new JFrame(); f.setLayout(null); JLabel lab1 = new JLabel("Enter Number 1: "); JLabel lab2 = new JLabel("Enter Number 2: "); JLabel lab3 = new JLabel("Result: "); final JTextField text1 = new JTextField(20); final JTextField text2 = new JTextField(20); final JTextField text3 = new JTextField(20); JButton b1 = new JButton("Add"); JButton b2 = new JButton("Subtract"); lab1.setBounds(20, 20, 100, 20); text1.setBounds(140, 20, 100, 20); lab2.setBounds(20, 50, 100, 20); ...