浏览代码

Loads png from jar

Thomas Buck 12 年前
父节点
当前提交
c7f58dcbdf
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3
    3
      Cube Control/layerEditFrame.java

+ 3
- 3
Cube Control/layerEditFrame.java 查看文件

@@ -15,8 +15,8 @@ public class layerEditFrame extends JFrame {
15 15
   // Anfang Attribute
16 16
   private JPanel panelLED1 = new JPanel(null, true);
17 17
   JButton[][] ledPanels = new JButton[8][8];
18
-  static ImageIcon on = new ImageIcon("LEDon.png");
19
-  static ImageIcon off = new ImageIcon("LEDoff.png");
18
+  ImageIcon on = new ImageIcon(getClass().getResource("LEDon.png"));
19
+  ImageIcon off = new ImageIcon(getClass().getResource("LEDoff.png"));
20 20
   boolean changedStateSinceSave = false;
21 21
   byte[] frame;
22 22
 
@@ -139,4 +139,4 @@ public class layerEditFrame extends JFrame {
139 139
        return 0;
140 140
     }
141 141
   }
142
-}
142
+}

正在加载...
取消
保存