我有两个采摘者 . 选择第一个选择器后,第二个选择器应该处于活动状态 . 但是如果首先点击第二个选择器,则打开空选择器字符串,然后显示选择第一个选择器的对话框 . 如果未选择第一个选择器,我怎么能不显示空的选择器字符串列表?

Picker datePicker = new Picker();
datePicker.addActionListener(e -> {
    SimpleDateFormat sf = new SimpleDateFormat("y");
    String a = sf.format(datePicker.getDate());

    SimpleDateFormat sf1 = new SimpleDateFormat("M");
    String b = sf1.format(datePicker.getDate());

    SimpleDateFormat sf2 = new SimpleDateFormat("d");
    String c = sf2.format(datePicker.getDate());

    getStartDate = a + "-" + b + "-" + c;
});

stationPicker.addActionListener(e -> {
    if (!getStartDate.equals("")) {
        _ _ _ _ _ _ _ _ _ ___ _ 
        _ _ _ _ _ _ _ _ _ ___ _ 
    }else{
        Dialog.show("Warning", "Please choose the date first", "ok", null);
        stationPicker.setSelectedString("Select the service center");
    }
});

看看视频,以便更清楚地解决问题 .

https://www.youtube.com/watch?v=Fmg13qm08Is