summaryrefslogtreecommitdiff
path: root/projects/net.wotonomy.test/src/main/java/net/wotonomy/test/Test.java
diff options
context:
space:
mode:
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.java18
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);
}