问题描述 :编译Swiing客户端java代码的时候一直报错,错误日志,
java.lang.ExceptionInInitializerError
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class LGTopoPanel implements IGroupSubnetTopo
{
static final String[] _lang_select = { "Pointer Tool", "路径选择工具" };
static final String[] _lang_pan = { "Hand Tool", "抓手工具" };
static final String[] _lang_zoomIn = { "Zoom In", "放大视图" };
static final String[] _lang_zoomOut = { "Zoom Out", "缩小视图" };
static final String[] _lang_zoomBak = { "Zoom Back", "撤销缩放" };
static final String[] _lang_zoomReset = { "Reset Zoom", "初始化视图" };
static final String[] _lang_fitCont = { "View all NEs", "观看所有节点" };
static final String[] _lang_zoomView = { "Zoom out a Region", "视图区间放大" };
JPanel m_panel = new JPanel(new BorderLayout());
JPanel networkArea = new JPanel(new BorderLayout());
JPanel treeArea = new JPanel(new BorderLayout());
JSplitPane rightSplitPane =
new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, treeArea, networkArea);
private LGTopoWindow _parentWin;
private IlpNetwork networkComponent;
private IlogTree treeComponent;
public static final URL configurationNet =
LGTopoPanel.class.getResource("topo.css");
public static final String[] configurationTree =
new String[] { LGTopoPanel.class.getResource("tree.css").toString()};
public static final String[] configurationTree =new String[] { LGTopoPanel.class.getResource("tree.css").toString()};
但是当我把static注释掉后,编译通过,没有任何问题。然后我又重新uncheckout,程序运行正常。
比较诡异的问题发生了,把static设置一下就可以重新让程序运行。
这个是不是static 的东西一直还在内存当中呢?还是什么情况发生了?
class.getResource 这个方法是获得资源的?
遗留问题?
慢慢看吧。
探讨了Swiing客户端Java代码编译时出现的ExceptionInInitializerError错误,并分享了解决方法,即移除static关键字后编译通过,进一步讨论了static的作用及getResource方法的用途。
214

被折叠的 条评论
为什么被折叠?



