Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(dcs1.getDate().toString().isEmpty()){
- lblOk.setText("Empty");
- }else{
- Date d = dcs1.getDate();
- DateFormat df = new SimpleDateFormat("MM-dd-yyyy");
- String t = df.format(d);
- lblOk.setText(t);
- }
- JLabel lblOk;
- JDateChooser dcs1;
- Date date;
- date = JDateChooser.getDate();
- if (date == null)
- {
- JOptionPane.showMessageDialog(null, "Choose Date from Right Box.", "Error", JOptionPane.ERROR_MESSAGE);
- JDateChooser.grabFocus();
- return false;
- }
- String s = ((JTextField)dateChooser.getDateEditor().getUiComponent()).getText();
- if (s.equals("") {
- JOptionPane.showMessageDialog(null, "Please type birthday", "Warning!", JOptionPane.ERROR_MESSAGE);
- }
- if (jDateChooserBirthDate.getDate() == null) {
- JOptionPane.showMessageDialog(null, "Please type birthday", "Warning!", JOptionPane.ERROR_MESSAGE);
- }
- if(jDateChooser1.getDate() == null){
- JOptionPane.showMessageDialog(this, "Date not selected","No selection",JOptionPane.INFORMATION_MESSAGE);
- jDateChooser1.requestFocusInWindow();
- }
- String test = dateChooserID.getText();
- if(!test.equals("")){
- //DO WHATEVER YOU WANT (DATE IS SELECTED IN THIS CASE);
- }
- else{
- JOptionPane.showMessageDialog(this, "date not choosen");
- }
Add Comment
Please, Sign In to add comment