0
Calendar calendar = Calendar.getInstance();
Date udoa = new Date(calendar.getTime().getTime());`

Here, I am storing system date in udoa (local variable)

I want to display it in JTextField doa;

doa.setText(udoa);

I am using this, but it is not working because data type of udoa is date.

Does anybody know how to achieve this?

1 Answers1

0

You can fix this by using the toString() Method of Date

use doa.setText(udoa.toString());

tung
  • 719
  • 2
  • 14
  • 30