第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

按下 javafx 按鈕時不執(zhí)行

按下 javafx 按鈕時不執(zhí)行

白衣非少年 2023-11-01 22:48:27
我遇到的問題是,當(dāng)我單擊“登錄”按鈕時,它什么也沒做。沒有拋出異常,并且 try - catch 似乎沒有捕獲任何錯誤/異常。一直在瀏覽線程,但沒有發(fā)現(xiàn)任何有效的東西。我在整個代碼中添加了 print 語句,似乎在第一個 try 塊的開頭就停止了,還在兩個 catch 塊中添加了 stackTrace 但什么也沒有void getLoginAction(ActionEvent event) throws IOException, Exception {        String username = tfUsername.getText();        String password = tfPassword.getText();        loggingUsers.setUserName(username);        loggingUsers.setPassword(password);        FileHandler userFh = new FileHandler("UserLog.txt", true);        SimpleFormatter sf = new SimpleFormatter();        userFh.setFormatter(sf);        uLog.addHandler(userFh);        uLog.setLevel(Level.INFO);        try {            ObservableList<User> loginInfo = DatabaseMan.getActiveUsers();            loginInfo.forEach((u) -> {                try {                    assert loggingUsers.getUserName().equals(u.getUserName()) && loggingUsers.getPassword().equals(u.getPassword()) : "Incorrect login info!";                    loggingUsers.setUserId(u.getUserId());                    try {                        Appointment upcomingAppt = DatabaseAppointments.getUpcomingAppt();                        if (!(upcomingAppt.getAppointmentId() == 0)) {                            Alert apptAlert = new Alert(Alert.AlertType.INFORMATION);                            apptAlert.setTitle("Upcoming Appointment Reminder");                            apptAlert.setHeaderText("You have an upcoming appointment!");                            apptAlert.setContentText("You have an appointment scheduled"                                     + "\non " + upcomingAppt.getStart().format(DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL))                                    + "\nat " + upcomingAppt.getStart().format(DateTimeFormatter.ofLocalizedTime(FormatStyle.FULL))                                    + " with client " + upcomingAppt.getCustomer().getCustomerName() + ".");                            }沒有錯誤消息,按下按鈕時沒有任何反應(yīng)
查看完整描述

1 回答

?
長風(fēng)秋雁

TA貢獻(xiàn)1757條經(jīng)驗(yàn) 獲得超7個贊

我們放棄了標(biāo)記到按鈕點(diǎn)擊上的 ActionEvent
這是我們命名 Action Event 的方式和代碼示例?屏幕截圖來自 Scene Builder

https://img1.sycdn.imooc.com/65426563000100e202820238.jpg

? ?@FXML

private void onBack() throws IOException{

? ? stage = (Stage)childTVPane.getScene().getWindow();// pane you are ON

? ? paneStart = FXMLLoader.load(getClass().getResource("start.fxml"));// pane you are GOING TO

? ? Scene scene = new Scene(paneStart);// pane you are GOING TO

? ? scene.getStylesheets().add(getClass().getResource("diary.css").toExternalForm());

? ? stage.setScene(scene);

? ? stage.setTitle("Diary");?

? ? stage.show();

? ? stage.sizeToScene();

? ? stage.centerOnScreen();?

}

查看完整回答
反對 回復(fù) 2023-11-01
  • 1 回答
  • 0 關(guān)注
  • 183 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號