Fix default close operation (exit app on cross button didn't close the application. Add generated serial id

This commit is contained in:
Andy Chabalier 2018-09-27 16:53:29 +02:00
parent f7c1b4f73a
commit 82847fd740

View File

@ -12,7 +12,9 @@ import java.util.List;
public class Preview extends JFrame { public class Preview extends JFrame {
static final int VIEW_WIDTH = 256; private static final long serialVersionUID = -8104236322964434859L;
static final int VIEW_WIDTH = 256;
static final int VIEW_HEIGHT = 128; static final int VIEW_HEIGHT = 128;
public static final String LEFT_COMMAND = "<"; public static final String LEFT_COMMAND = "<";
@ -32,6 +34,9 @@ public class Preview extends JFrame {
public Preview() throws HeadlessException { public Preview() throws HeadlessException {
model = new ArrayList<>(); model = new ArrayList<>();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// UI elements // UI elements
JMenuBar menuBar = new JMenuBar(); JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar); setJMenuBar(menuBar);