Posts

Showing posts with the label java

Java - Calculator Example

Image
This post will show how to create Calculator Application using Java langguage. This is only an example, you can add some feature into this example such as sin,cos,tan expression. Note : This example using netbean v 7.4 Step By Step Create New Project Choose Java Application Rename Project Name to Calculator Delete file Calculator.java Add New JFrame Form under package calculator and change class Name to CalcMainUI Drag and drop java Swing controller into frame. Refer CalcMainUIbelow. ( Note : you can change the position of button as you like). Create Java class . calculateClass.java CalcMainUI Code behind package calculator; import java.math.BigDecimal; import javax.swing.JOptionPane; /**  *  * @author developersnote  */ public class CalcMainUI extends javax.swing.JFrame {     /**      * Creates new form CalcMainUI      */     public CalcMainUI() {         initComponents();     }     /**      * This method is called from within the constructor to initialize the form.      * WARNING: Do

Phone book application example - Java

Image
This post will show one example of a PhoneBook Application developed using Java language. All of the contacts will be store into a .txt file without using the database. This is an example only. You can change the layout or add some features to this example. Note: This tutorial using Netbean v 7.4 Step by step: Create a New Project and choose Java Application Rename Project Name to PhoneContact Delete file PhoneContact.java Add New JFrame Form under package phonecontact and change class Name to MainUI Drag and drop java Swing controller into frame. Refer MainUI below. ( Note: you can change the position of button as you like)   Add new JFrame Form under package phonecontact and change class name to AddEditForm. Drag and drop java sing controller into frame, Refer AddEditForm image below. Create 2 Java Class. Contact.java and ContactsUtility.java. Copy paste the code behind of each java class and frame.   MainUI code behind  import java.awt.event.WindowAdapter; import java.awt.event.Win