@@ -0,0 +1,2927 @@
+/**%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;%0A%0Aimport java.awt.BorderLayout;%0Aimport java.awt.event.WindowEvent;%0Aimport java.awt.event.WindowListener;%0A%0Aimport javax.swing.JFrame;%0Aimport javax.swing.UIManager;%0A%0A/**%0A * Main application class.%0A * %0A * @author mark%0A */%0Apublic class JNotepad implements WindowListener %7B%0A    private JFrame parentFrame;%0A%0A    /**%0A     * Set up the application before showing the window.%0A     * %0A     * @param parentFrame The main application window.%0A     */%0A    public JNotepad(JFrame parentFrame) %7B%0A        this.parentFrame = parentFrame;%0A        ApplicationPreferences.loadPrefs(parentFrame);%0A        parentFrame.addWindowListener(this);%0A    %7D%0A%0A    @Override%0A    public void windowActivated(WindowEvent e) %7B%7D%0A%0A    @Override%0A    public void windowClosed(WindowEvent e) %7B%7D%0A%0A    @Override%0A    public void windowClosing(WindowEvent e) %7B%0A        exit();%0A    %7D%0A%0A    @Override%0A    public void windowDeactivated(WindowEvent e) %7B%7D%0A%0A    @Override%0A    public void windowDeiconified(WindowEvent e) %7B%7D%0A%0A    @Override%0A    public void windowIconified(WindowEvent e) %7B%7D%0A%0A    @Override%0A    public void windowOpened(WindowEvent e) %7B%7D%0A%0A    private void exit() %7B%0A        ApplicationPreferences.savePrefs(parentFrame);%0A        System.exit(0);%0A    %7D%0A%0A    /**%0A     * Main application starting point.%0A     * %0A     * @param args%0A     */%0A    public static void main(String%5B%5D args) %7B%0A        try %7B%0A            // Make the application look native.%0A            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());%0A        %7D catch (Exception e) %7B%0A            // System look and feel is always present.%0A        %7D%0A%0A        JFrame frame = new JFrame(%22JNotepad%22);%0A        new JNotepad(frame);%0A        frame.setLayout(new BorderLayout());%0A        frame.setVisible(true);%0A    %7D%0A%7D%0A

Create JNotepad.java