I have a jComoBox and JButton NewJDialog.java. How to pen A.java when i select "A" in JComboBox?
if (jComboBox1.getSelectedItem() == "A"){
A.java.setVisible(true);
}
else {
dispose();
}
}
答案 0 :(得分:1)
如果您尝试打开文件,可以使用像这样的桌面对象。
Desktop d = Desktop.getDesktop();
d.open("your File object here");