List of usage examples for javax.swing.undo StateEdit end
public void end()
From source file:UndoableDrawingPanel.java
public UndoableDrawingPanel() { MouseListener mouseListener = new MouseAdapter() { public void mouseReleased(MouseEvent mouseEvent) { StateEdit stateEdit = new StateEdit(UndoableDrawingPanel.this); polygon.addPoint(mouseEvent.getX(), mouseEvent.getY()); stateEdit.end(); undoableEditSupport.postEdit(stateEdit); repaint();// w w w . j av a 2 s . c om } }; addMouseListener(mouseListener); }
From source file:UndoableDrawingPanel2.java
public UndoableDrawingPanel2() { MouseListener mouseListener = new MouseAdapter() { public void mouseReleased(MouseEvent mouseEvent) { StateEdit stateEdit = new StateEdit(UndoableDrawingPanel2.this); polygon.addPoint(mouseEvent.getX(), mouseEvent.getY()); stateEdit.end(); undoableEditSupport.postEdit(stateEdit); repaint();/*w w w.ja v a2 s.c o m*/ } }; addMouseListener(mouseListener); }