Hi,
how to convert date value from 2017-09-21 to jtextbox?
example date value is 2017-09-21 then it converted to 3 jtextbox whiches become
jtextbox1 = 21
jtextbox2 = 09
jtextbox3 = 2017?
Please help.....
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hi,
how to convert date value from 2017-09-21 to jtextbox?
example date value is 2017-09-21 then it converted to 3 jtextbox whiches become
jtextbox1 = 21
jtextbox2 = 09
jtextbox3 = 2017?
Please help.....
What is jtextbox? It is coded like it is a variable name. What data type is it?how to convert date value from 2017-09-21 to jtextbox?
Is the value: 2017-09-21 in a String?
The example implies that it is a String with numeric values separated with the "-" character.
The String class's split() method is one way to extract the substrings separated by the "-" character.
If you don't understand my answer, don't ignore it, ask a question.
Hi Norm,
I did this but got error
String Status; String TGL,part1,part2,part3; jCmbType.setSelectedIndex((int)jTable1.getModel().getValueAt(row, 0)); jCmbTrxSource.setSelectedIndex((int)jTable1.getModel().getValueAt(row, 1)); jtxtJournalNo.setText((String)jTable1.getModel().getValueAt(row, 2)); TGL = (String)jTable1.getModel().getValueAt(row, 3).toString(); String[] parts = TGL.split("-"); part1 = parts[0]; part2 = parts[1]; part3 = parts[2]; jCmbYear.setSelectedItem() = part1;
the error messages is cannot applied to given types....
Please copy the full text of the error messages and paste it here.the error messages is cannot applied to given types....
The posted code does not show the data types for many of the variables used there.
If you don't understand my answer, don't ignore it, ask a question.
Hi, the problem is solved just put the part1 inside jcmbyear
jCmbYear.setSelectedItem() = part1; -----> jCmbYear.setSelectedItem(part1);