[josm-dev] [PATCH] fix deprecated frame.resize()

Dave Hansen dave at sr71.net
Sun Dec 16 21:52:25 GMT 2007


According to my compiler, frame.resize() is deprecated:

compile:
    [javac] Compiling 201 source files to build
    [javac] src/org/openstreetmap/josm/gui/MainApplet.java:130: warning: [deprecation] resize(int,int) in java.awt.Component has been deprecated
    [javac]                             frame.resize(w, h);
    [javac]                                      ^
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 1 warning

Here's a fix:

Index: src/org/openstreetmap/josm/gui/MainApplet.java
===================================================================
--- src/org/openstreetmap/josm/gui/MainApplet.java	(revision 485)
+++ src/org/openstreetmap/josm/gui/MainApplet.java	(working copy)
@@ -5,6 +5,7 @@
 
 import java.applet.AppletStub;
 import java.applet.AppletContext;
+import java.awt.Dimension;
 import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
@@ -127,7 +128,7 @@
 		MainApplet applet = new MainApplet();
 		applet.setStub(new AppletStub() {
 			public void appletResize(int w, int h) {
-				frame.resize(w, h);
+				frame.setSize(new Dimension(w, h));
 			}
 
 			public AppletContext getAppletContext() {


-- Dave





More information about the josm-dev mailing list