您可以从ActionMap获取Action:
Jframe frame = new Jframe();JFileChooser fileChooser = new JFileChooser(".");Action details = fileChooser.getActionMap().get("viewTypeDetails");details.actionPerformed(null);fileChooser.showOpenDialog(frame);
您可以从ActionMap获取Action:
Jframe frame = new Jframe();JFileChooser fileChooser = new JFileChooser(".");Action details = fileChooser.getActionMap().get("viewTypeDetails");details.actionPerformed(null);fileChooser.showOpenDialog(frame);