package datefield; import javax.swing.JFormattedTextField; import javax.swing.text.DateFormatter; public class NewJFrame extends javax.swing.JFrame { public NewJFrame() { initComponents(); formattedTextField(); } public void formattedTextField() { jFormattedTextField1 = new JFormattedTextField(new SimpleDateFormat("MM/dd/yy - mm:HH")); jFormattedTextField1.setValue(new Date()); add(jFormattedTextField1); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)