1
有人可以解释我的应用程序中有多个软件包时应如何使用资源注入?我似乎无法加载任何其他包中的资源,但我有SingleFrameApplication后代的资源。假设这是我的应用程序结构:使用Swing应用程序框架的资源文件
/resources
/main
/main/resources
/view
/view/resources
这是正确的吗?我试图阅读我能找到的小文档,但我无法弄清楚是否应该将/view/mainView.class的资源文件放到/ resources,/ main/resources或/ view/resources。
如何打开资源文件?我试图把资源文件到/主/资源并开放供mainTableView资源文件
this.resourceMap = org.jdesktop.application.Application.getInstance(scheator.ScheatorApp.class).getContext().getResourceMap(MainTablePanel.class);
this.actionMap = org.jdesktop.application.Application.getInstance(scheator.ScheatorApp.class).getContext().getActionMap(MainTablePanel.class, this);
ScheatorApp是主类(SingleFrameApplication后裔)。属性文件具有类似
ColRound.text = Round
ColHome.text = Home
ColAway.text = Away
线但当我尝试这个办法:
columnNames[0] = resourceMap.getString("ColRound.text");
columnNames[1] = resourceMap.getString("ColHome.text");
columnNames[2] = resourceMap.getString("ColAway.text");
所有的列名是空的。
而且我还没有尝试过,甚至资源注入尚未...