我创建了一个JavaFX项目,并为java Scene Builder中的第一个登录框架创建了GUI.登录成功后,必须关闭登录框,并且必须显示下一帧(主程序框).我可以使新框架出现,但我无法关闭登录框架.我尝试了类似dispose()但没什么用的东西.下面是主类的代码:
public class KuberComm extends Application {
@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
Scene scene = new Scene(root);
stage.setResizable(false);
stage.setTitle("Login to KuberComm");
stage.setScene(scene);
stage.show();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
}
Run Code Online (Sandbox Code Playgroud)
登录按钮的处理程序位于另一个类(NetBeans IDE生成的控制器类)中.我无法弄清楚框架的名称是什么,以便在控制器类中使用它.
任何帮助都感激不尽!
如何使用 ionic 提取受密码保护的 zip?未受密码保护的 zip 可以正常提取,但受密码保护的 zip 会返回异常。
string selected_zip = FileListBox.GetItemText(FileListBox.SelectedItem);
String TargetDirectory = "C:\\Users\\Aristomenis\\Desktop\\" + selected_zip;
using (Ionic.Zip.ZipFile zippy = Ionic.Zip.ZipFile.Read(TargetDirectory))
{
zippy.ExtractAll("c:\\Users\\user1\\Desktop\\",
Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite);
}
Run Code Online (Sandbox Code Playgroud)