From 4a470ee779ecc060393beaf8307ffc3f67695744 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Tue, 13 Apr 2021 12:49:03 +0200 Subject: [PATCH] Use readBytes instead of readAllBytes in info.kt --- common/src/main/kotlin/fr/username404/snowygui/exec/info.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/src/main/kotlin/fr/username404/snowygui/exec/info.kt b/common/src/main/kotlin/fr/username404/snowygui/exec/info.kt index 3202a70..3f6d648 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/exec/info.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/exec/info.kt @@ -51,16 +51,17 @@ object ExecObj { ((this.layout) as FlowLayout).alignment = FlowLayout.CENTER } }.apply { - // TODO Add text + val iconStream = ExecObj.javaClass.getResourceAsStream("/icon.png") add( JLabel( ImageIcon( Toolkit.getDefaultToolkit() - .createImage(ExecObj.javaClass.getResourceAsStream("/icon.png")?.readAllBytes()) + .createImage(iconStream.readBytes()) .getScaledInstance(256, 256, Image.SCALE_SMOOTH) ) ) ) + iconStream.close() add( JLabel("You should install this mod by dropping it into your mods folder, and not by running it.").apply { font = Font.createFont(Font.TRUETYPE_FONT, ExecObj.javaClass.getResourceAsStream("/font/NotoSans-Regular.ttf")).deriveFont(Font.BOLD, 20F)