
sir,
do you have an example of date in awt java which can be view over a textfield.

Display time in JTextField
import java.util.*;
import javax.swing.*;
import java.awt.event.*;
public class ShowTime extends JFrame{
ShowTime(){
JTextField text=new JTextField(10);
add(text);
text.setEditable(false);
pack();
setVisible(true);
while(true){
try {
Thread.sleep(1000);
Calendar cal = new GregorianCalendar();
String hour = String.valueOf(cal.get(Calendar.HOUR));
String minute = String.valueOf(cal.get(Calendar.MINUTE));
String second = String.valueOf(cal.get(Calendar.SECOND));
text.setText(hour + ":" + minute + ":" + second);
}
catch (Exception e) {}
}
}
public static void main(String args[]){
new ShowTime();
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.