Form adalah tampilan user interface yang disediakan oleh bahasa pmrograman agar mudah untuk menjalankan sebuah program. Event handler adalah sebuah method yang dapat mendeteksi suatu kejadian yang terjadi pada sebuah form, contoh ketika sebuah button di Click maka program akan melakukan sebuah eksekusi  perintah yang ada pada event handlernya.

::C#::

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace From_and_Event_Handler
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        int pertamax, keduax, jumlah;
        private void button1_Click(object sender, EventArgs e)
        {
            pertamax = Convert.ToInt32(textBox1.Text);
            keduax = Convert.ToInt32(textBox2.Text);
            jumlah = pertamax * keduax;
            textBox3.Text = jumlah.ToString();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            pertamax = Convert.ToInt32(textBox1.Text);
            keduax = Convert.ToInt32(textBox2.Text);
            jumlah = pertamax / keduax;
            textBox3.Text = jumlah.ToString();
        }
    }
}


::Java::

int pertamax, keduax, jumlah;
String teks;
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
{
	pertamax = Integer.parseInt(jTextField1.getText());
	keduax = Integer.parseInt(jTextField2.getText());
	jumlah = pertamax * keduax;
	teks = String.valueOf(jumlah);
	jTextField3.setText(teks);
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)
{
	pertamax = Integer.parseInt(jTextField1.getText());
	keduax = Integer.parseInt(jTextField2.getText());
	jumlah = pertamax : keduax;
	teks = String.valueOf(jumlah);
	jTextField3.setText(teks);
}

// Variables declaration - do not modify

private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JPanel mainPanel;
private javax.swing.JProgressBar progressBar;
private javax.swing.JLabel statusAnimationLabel;
private javax.swing.JLabel statusMessageLabel;
private javax.swing.JPanel statusPanel;

// End of variables declaration

private final Timer messageTimer;
private final Timer busyIconTimer;
private final Icon idleIcon;
private final Icon[] busyIcons = new Icon[15];
private int busyIconIndex = 0;
private JDialog aboutBox;