I was trying to make an if and else statement that will not accept the process if the DateTimePicker was empty so I tried this one but it is just ignoring it so any possible way how can I get the value or text from this DateTime picker?
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
if(dateTimePicker1.equals("") || dateTimePicker2.equals("") || jTextField1.getText().equals("PACKAGES OFFERED: ")
|| jTextField5.getText().equals("FOOD SERVICES: ") || jTextField6.getText().equals("HOTEL ACTIVITIES: ")
|| jTextField7.getText().equals("HOTEL SERVICES: "))
{
jLabel8.setText("Invalid data please add valid data");
jLabel8.setOpaque(true);
}
else{
Hotel_Dashboard2 hd1 = new Hotel_Dashboard2();
Hotel_Dashboard2.jLabel8.setText(Hotel_Dashboard1.jLabel9.getText());
hd1.setVisible(true);
}
}
Here are the code that I tried:
if(dateTimePicker1=='' || dateTimePicker2.==''
if(dateTimePicker1.length===(0) || dateTimePicker2.length===(0)
if(dateTimePicker1==null || dateTimePicker2.equals==null
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…