From b1a0d4f2a9195e49099c926dfdcef2f2fdfda4e1 Mon Sep 17 00:00:00 2001 From: Kristian Knarvik Date: Sun, 18 Feb 2018 22:57:39 +0100 Subject: [PATCH] Gets size instead of preferred size --- src/net/knarcraft/serverlauncher/profile/Profile.java | 1 + src/net/knarcraft/serverlauncher/userinterface/GUI.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/net/knarcraft/serverlauncher/profile/Profile.java b/src/net/knarcraft/serverlauncher/profile/Profile.java index e266cf1..b0a6316 100644 --- a/src/net/knarcraft/serverlauncher/profile/Profile.java +++ b/src/net/knarcraft/serverlauncher/profile/Profile.java @@ -322,6 +322,7 @@ public class Profile { gui.getSize().width, gui.getSize().height )); + System.out.println("Saving: " + gui.getSize().width + ", " + gui.getSize().height); file.close(); for (Profile profile : profiles) { StringBuilder saveString = new StringBuilder(String.format( diff --git a/src/net/knarcraft/serverlauncher/userinterface/GUI.java b/src/net/knarcraft/serverlauncher/userinterface/GUI.java index f82dd13..64935c3 100644 --- a/src/net/knarcraft/serverlauncher/userinterface/GUI.java +++ b/src/net/knarcraft/serverlauncher/userinterface/GUI.java @@ -103,7 +103,7 @@ public class GUI implements ActionListener { } public Dimension getSize() { - return frame.getContentPane().getPreferredSize(); + return frame.getContentPane().getSize(); } /**