Revision: 2984
http://sourceforge.net/p/swingme/code/2984
Author: yuranet
Date: 2025-12-24 20:02:52 +0000 (Wed, 24 Dec 2025)
Log Message:
-----------
close in
Modified Paths:
--------------
SwingMETest/src/net/yura/mobile/test/MainTest.java
Modified: SwingMETest/src/net/yura/mobile/test/MainTest.java
===================================================================
--- SwingMETest/src/net/yura/mobile/test/MainTest.java 2025-12-24 19:57:45 UTC (rev 2983)
+++ SwingMETest/src/net/yura/mobile/test/MainTest.java 2025-12-24 20:02:52 UTC (rev 2984)
@@ -36,6 +36,7 @@
import net.yura.mobile.gui.plaf.MetalLookAndFeel;
import net.yura.mobile.gui.plaf.SynthLookAndFeel;
import net.yura.mobile.gui.plaf.nimbus.NimbusLookAndFeel;
+import net.yura.mobile.io.FileUtil;
import net.yura.mobile.test.MainPane.Section;
public class MainTest extends Section {
@@ -105,11 +106,12 @@
addMenuItem(mainMenu,"aetherGreen", "Nimbus Green Theme");
addMenuItem(mainMenu,"aether2", "Nimbus Red Theme");
addMenuItem(mainMenu,"aetherCharcoal", "Nimbus Charcoal Theme");
+ addMenuItem(mainMenu,"synthThemeSize", "Synth Size");
addMenuItem(mainMenu,"synthTheme1", "Synth J2SE Demo");
+
addMenuItem(mainMenu,"synthTheme3", "Synth Visto");
addMenuItem(mainMenu,"synthTheme4", "Synth Telus");
addMenuItem(mainMenu,"synthTheme5", "Synth LG");
- addMenuItem(mainMenu,"synthThemeSize", "Synth Size");
}
// Override
@@ -661,12 +663,16 @@
synth = new SynthLookAndFeel();
+ InputStream themeIn = getClass().getResourceAsStream(string);
try {
- synth.load( getClass().getResourceAsStream(string) );
+ synth.load(themeIn);
}
catch (Exception ex) {
ex.printStackTrace();
}
+ finally {
+ FileUtil.close(themeIn);
+ }
setupNewLookAndFeel( synth );
@@ -722,15 +728,18 @@
}
};
+ InputStream themeIn = getClass().getResourceAsStream(dir+size+file);
try {
- synth.load( getClass().getResourceAsStream(dir+size+file) );
+ synth.load(themeIn);
}
catch (Exception ex) {
ex.printStackTrace();
}
+ finally {
+ FileUtil.close(themeIn);
+ }
setupNewLookAndFeel( synth );
-
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|