JFrame frame = new JFrame();
frame.setSize(256,256);
frame.setLayout(null);
SpinnerDateModel dateModel = new SpinnerDateModel(new Date(), null, null, Calendar.DAY_OF_MONTH);
JSpinner spinner = new JSpinner(dateModel);
spinner.setBounds(0,0, 125,45);
frame.add(spinner);
frame.setVisible(true);
whether I use Calendar.DAY_OF_MONTH or any other field I get the exact same result.
this is what I get, which I don't want. I only need "MONTH/DAY/YEAR".
A
JSpinnerhas asetEditormethod that edits the date field.Here's the complete runnable code example.