字符串已分配值,但显示空

时间:2019-07-27 17:13:03

标签: java

我已经为字符串分配了值,但是当第3次循环显示为空

我尝试重新定位该位置,但这不起作用

    check = false;
    for (int i = 0; i < 10; i++) {
        //checking flight available
        for (int row = 0; row < flight.length; row++) {
            for (int column = 0; column < flight[row].length; column++) {
                //System.out.print(flight[row][column] + " ");
                name = flight[row][column];
                if (name.equals(answer)) {
                    message = "\nWe found a flight!\n\n" + "Time: " + time + "\n\n\n\nAre you sure you want to book this flight?";
                    check = true;
                    break;
                }
            }
            if (check == true) {
                break;
            }
        }
        jTextArea1.setText(message);
    }                                     
    if (!check) {
        noBtn.setEnabled(false);
        close();
    } else {
        JOptionPane.showMessageDialog(null, "Sorry for making any innconvenient...Please Come Again");
    }  

线程“ AWT-EventQueue-0”中的异常java.lang.NullPointerException

0 个答案:

没有答案