Bläddra i källkod

Added option to disable stacktrace spam

Ludwig Tietze 7 år sedan
förälder
incheckning
2a06fdb992
1 ändrade filer med 3 tillägg och 2 borttagningar
  1. 3 2
      src/ui/view/Util.java

+ 3 - 2
src/ui/view/Util.java

@@ -9,7 +9,7 @@ import javax.swing.ImageIcon;
 
 public class Util {
 	
-	private static final boolean debug=true;
+	private static final boolean debug=false, traces=false;
 	
 	static Image loadImage(Object origin, String url, int w, int h, int hints){
 		Image o= loadImage(origin,url);
@@ -25,7 +25,8 @@ public class Util {
 		try {
 			return ImageIO.read(f);
 		} catch (IOException e) {
-			e.printStackTrace();
+			if(traces)e.printStackTrace();
+			if(debug)System.out.println("Using stupid ImageIcon method for "+url+".");
 			return new ImageIcon(url).getImage();//TODO: There is no reason this should work if everything else failed.
 		}
 		//return null;