jar ファイル内に保存されている html ページをヘルプ JEditorPane にロードしようとしています。これまでのところ、Eclipseで実行すると機能しますが、実行可能なjarを作成すると、マップres/pages/...をjarファイルと同じマップに配置する場合を除き、機能しません
class HelpButtonHandler implements ActionListener{
@Override
public void actionPerformed(ActionEvent arg0) {
infodex = new JEditorPane();
helpDialog = new JDialog();
URL url1 = null;
try {
url1 = (new java.io.File("res/pages/help.html")).toURI().toURL();
} catch (MalformedURLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
infodex.setPage(url1);
} catch (IOException e) {
e.printStackTrace();
}
helpDialog.getContentPane().add(new JScrollPane(infodex));
helpDialog.setBounds(400,200,700,600);
helpDialog.show();
infodex.setEditable(false);
Hyperactive hyper = new Hyperactive();
infodex.addHyperlinkListener(hyper);
}
}