diff options
| author | Benjamin Culkin <scorpress@gmail.com> | 2024-07-01 17:27:48 -0400 |
|---|---|---|
| committer | Benjamin Culkin <scorpress@gmail.com> | 2024-07-01 17:27:48 -0400 |
| commit | 02bc52037e9ccccca672d6156d9c325c74fe28b3 (patch) | |
| tree | db022b83c90562f461f4a27412caa9936a8dfd04 /projects/net.wotonomy.test/src/main/java/net/wotonomy/test/Test.java | |
| parent | c75d7dbd613a47b217499f7a856c469a8bc59e2a (diff) | |
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"
Diffstat (limited to 'projects/net.wotonomy.test/src/main/java/net/wotonomy/test/Test.java')
| -rw-r--r-- | projects/net.wotonomy.test/src/main/java/net/wotonomy/test/Test.java | 18 |
1 files changed, 8 insertions, 10 deletions
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); } |
