@@ -0,0 +1,2483 @@
+/**%0A * The MIT License (MIT)%0A * Copyright (c) 2016 Mark Bernard%0A * %0A * Permission is hereby granted, free of charge, to any person obtaining a copy of %0A * this software and associated documentation files (the %22Software%22), to deal in the %0A * Software without restriction, including without limitation the rights to use, copy, %0A * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, %0A * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:%0A * %0A * The above copyright notice and this permission notice shall be included in all copies or %0A * substantial portions of the Software.%0A * %0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, %0A * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR %0A * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE %0A * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR %0A * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.%0A */%0Apackage io.github.markbernard.jnotepad.dialog;%0A%0Aimport io.github.markbernard.jnotepad.action.DialogAction;%0A%0Aimport java.awt.Frame;%0Aimport java.awt.Window;%0Aimport java.awt.event.KeyEvent;%0A%0Aimport javax.swing.JComponent;%0Aimport javax.swing.JDialog;%0Aimport javax.swing.KeyStroke;%0A%0A/**%0A * @author Mark Bernard%0A *%0A */%0Apublic abstract class BasicDialog extends JDialog %7B%0A    private static final long serialVersionUID = 5010359693222917600L;%0A%0A    /**%0A     * @param owner%0A     * @param title%0A     * @param modal%0A     */%0A    public BasicDialog(Frame owner, String title, boolean modal) %7B%0A        super(owner, title, modal);%0A    %7D%0A%0A    protected void addEscapeToActionMap(JComponent component) %7B%0A        component.getActionMap().put(%22Cancel%22, new DialogAction.CancelAction(this));%0A        component.getInputMap(JComponent.WHEN_FOCUSED)%0A            .put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), %22Cancel%22);%0A    %7D%0A%0A    protected void centerDialog() %7B%0A        Window frameOwner = getOwner();%0A%0A        int width = getWidth();%0A        int height = getHeight();%0A        if (width %3C= 0) %7B%0A            width = 350;%0A        %7D%0A        if (height %3C= 0) %7B%0A            height = 130;%0A        %7D%0A        setLocation(frameOwner.getX() + (frameOwner.getWidth() - width) / 2,%0A                frameOwner.getY() + (frameOwner.getHeight() - height) / 2);%0A    %7D%0A%7D%0A

Create BasicDialog.java