调用netbeans 平台自己的方法

全屏

import javax.swing.Action;
import org.openide.cookies.InstanceCookie;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.loaders.DataObject;
import org.openide.util.Exceptions;

public void fullScreen() {
  FileObject path = FileUtil.getConfigFile("Actions/Window");
  FileObject action = path.getFileObject("org-netbeans-core-windows-actions-ToggleFullScreenAction.instance");
  DataObject dataObj = DataObject.find(action);
  InstanceCookie ic = dataObj.getCookie(InstanceCookie.class);
  Action actionInstance = (Action) ic.instanceCreate();
  actionInstance.actionPerformed(null);
}

你可能感兴趣的:(Netbeans)