From 02bc52037e9ccccca672d6156d9c325c74fe28b3 Mon Sep 17 00:00:00 2001 From: Benjamin Culkin Date: Mon, 1 Jul 2024 17:27:48 -0400 Subject: Update a whole bunch of things Yeah... not a great commit message. t.b.h, I could maybe've split the commit into more parts; but that would be quite a lot off effort and would have a pretty decent chance of at least one of the commits leaving the repository in a non-working state. For the future, will want to try and commit more often so there aren't these mega-commits where it's just "a whole bunch of stuff changed" --- .../src/main/java/net/wotonomy/test/Test.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'projects/net.wotonomy.test/src/main/java/net/wotonomy/test/Test.java') diff --git a/projects/net.wotonomy.test/src/main/java/net/wotonomy/test/Test.java b/projects/net.wotonomy.test/src/main/java/net/wotonomy/test/Test.java index 5b4533d..d262aad 100644 --- a/projects/net.wotonomy.test/src/main/java/net/wotonomy/test/Test.java +++ b/projects/net.wotonomy.test/src/main/java/net/wotonomy/test/Test.java @@ -1,8 +1,6 @@ package net.wotonomy.test; import java.awt.BorderLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; @@ -31,7 +29,7 @@ public class Test { // system l&f try { // UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel"); - UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); +// UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); // UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); // UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch (Exception e) { @@ -66,11 +64,7 @@ public class Test { menu.add("New"); menuItem = new JMenuItem("Save"); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.CTRL_MASK)); - menuItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent evt) { - controller.displayGroup.dataSource().editingContext().saveChanges(); - } - }); + menuItem.addActionListener(evt -> controller.displayGroup.dataSource().editingContext().saveChanges()); menu.add(menuItem); menu.add("Close"); @@ -84,12 +78,16 @@ public class Test { frame.getContentPane().add(testPanel, BorderLayout.CENTER); frame.setTitle("Test Frame"); - frame.setBounds(50, 50, 750, 500); - frame.show(); // comment out this to avoid memory leak from jdk1.2.2 bug + + frame.pack(); + frame.setSize(640, 480); + + frame.setVisible(true); // comment out this to avoid memory leak from jdk1.2.2 bug // add WindowListener for frame frame.addWindowListener(new WindowAdapter() { // exit on close + @Override public void windowClosing(WindowEvent e) { System.exit(0); } -- cgit v1.2.3