From cb8e184ab8fee1e4564699c4b3e7e3a1e5a48d02 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Sun, 12 Feb 2012 19:58:40 -0500 Subject: [PATCH] Using setMinimumSize() instead of window listener for editor windows. http://code.google.com/p/arduino/issues/detail?id=52 --- app/src/processing/app/Editor.java | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index ba2e641c2..65345016e 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -288,19 +288,9 @@ public class Editor extends JFrame implements RunnerListener { setPlacement(location); - // If the window is resized too small this will resize it again to the - // minimums. Adapted by Chris Lonnen from comments here: - // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4320050 - // as a fix for http://dev.processing.org/bugs/show_bug.cgi?id=25 - final int minW = Preferences.getInteger("editor.window.width.min"); - final int minH = Preferences.getInteger("editor.window.height.min"); - addComponentListener(new java.awt.event.ComponentAdapter() { - public void componentResized(ComponentEvent event) { - setSize((getWidth() < minW) ? minW : getWidth(), - (getHeight() < minH) ? minH : getHeight()); - } - }); - + // Set the minimum size for the editor window + setMinimumSize(new Dimension(Preferences.getInteger("editor.window.width.min"), + Preferences.getInteger("editor.window.height.min"))); // System.out.println("t3"); // Bring back the general options for the editor