Skip to main content

Posts

Featured

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);         text2.setBounds(140, 50, 100, 20);         lab3.setBounds(20, 80, 100, 20);         text3.setBounds(140, 80, 100, 20);         b1.setBounds(50, 120, 80, 20);         b2.setBounds(150, 120, 90, 20);         b1.addActionListener((Actio

Latest posts

Java program to get mark from the file and calculate average

Java multi threading program

Java program to write exception when "hello" entered

Java program to compare two string

Java program to create payslip for employees by using Inheritance

Java program to calculate and display the student mark result

Java program to check the given number is palindrome or not

Java program to fin factorial of a number

Java program to calculate Simple Interest

Java program to find Perfect square of a number