Jump to content

read date from text - netbeans GUI

- - - - -

  • Please log in to reply
1 reply to this topic

#1
alex1

alex1

    Learning Programmer

  • Members
  • PipPipPip
  • 93 posts
Hello guys...I'm trying to convert text to date,but I can not do this...I tried many options and lost many hours and finaly I came here to ask you. :)

Is there any way to get the text from the container and to convert it to date?Or maybe I have to use another type of container?

Can someone give me a sign? :)

Thanks in advance!!!

#2
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
private JTextField inputfield;
private DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
...

Date date = dateFormat.parse(inputfield.getText());
Note: Need to handle ParseException




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users