Create Notepad in Java AWT source code

Notepad application in Java AWT: This simple tutorial is used to create notepad using Java AWT source code. Yeah! we can create a basic notepad model, but it looks like real one. This java program for notepad can be used as a mini project for 3rd and 4th year students.

NOTEPAD IN JAVA AWT

This program is to create your own notepad app with menu buttons and rich text box with save option; it looks like a clone of notepad application in windows.

Create notepad in Java:

Q: How to crate a basic notepad application usin Java AWT code?

[Useful: C Programming Guide] & [IT Companies List]

//Import statements
import java.awt.*;
//Class definition
class Npd extends Frame
{
	//Variable declaration
	MenuBar mr;
	Menu fe;
	MenuItem n1, o, s, et;
	TextArea tax;
	public Npd()
	{
		setTitle("Students3k - Notepad");
		tax=new TextArea(25,80);
		addWindowListener(new MyWindowListener());
		mr=new MenuBar();//Object creation
		fe=new Menu("File");
		n1=new MenuItem("New");
		o=new MenuItem("Open...");
		s=new MenuItem("Save");
		et=new MenuItem("Exit");
		file.add(n1);
		file.add(o);
		file.add(s);
		file.addSeparator();
		file.add(et);
		mbar.add(fe);
		setMenuBar(mr);
		add(tax);
		setSize(400,400);
		show();
	}
	public static void main(String args[])//Main class
	{
		new Npd();
	}
}