src/notepad/GUI.java
/**
	 * Format to add Undo Manager Functionality
	 */
Format to add Undo Manager Functionality
Format to add Undo Manager Functionality
public void createTextArea() {
		textArea = new JTextArea();
		textArea.addKeyListener(kHandler); 
		textArea.getDocument().addUndoableEditListener(new UndoableEditListener() {
			@Override
			public void undoableEditHappened(UndoableEditEvent e) {
				um.addEdit(e.getEdit());
			}
		});
		scrollPane = new JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
				JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); 
		window.add(scrollPane);
		scrollPane.setBorder(BorderFactory.createEmptyBorder()); 
	}
public void createTextArea ( ) { textArea = new JTextArea ( ) ; textArea . addKeyListener ( kHandler ) ; textArea . getDocument ( ) . addUndoableEditListener ( new UndoableEditListener ( ) { @ Override public void undoableEditHappened ( UndoableEditEvent e ) { um . addEdit ( e . getEdit ( ) ) ; } } ) ; scrollPane = new JScrollPane ( textArea , JScrollPane . VERTICAL_SCROLLBAR_AS_NEEDED , JScrollPane . HORIZONTAL_SCROLLBAR_AS_NEEDED ) ; window . add ( scrollPane ) ; scrollPane . setBorder ( BorderFactory . createEmptyBorder ( ) ) ; }
Format to add Undo Manager Functionality
Format to add Undo Manager Functionality
// Listen for keypress // TODO Auto-generated method stub // set conditions for scroller // add scroll pane to window // no border between textPane and JFrame // window.add(textArea);