Dear visitor, welcome to Jabaco - Community.
If this is your first visit here, please read the Help. It explains in detail how this page works.
To use all features of this page, you should consider registering.
Please use the registration form, to register here or read more information about the registration process.
If you are already registered, please login here.
JFormattedTextField
Hello,
I try to use JFormattedTextField with this code:
Public Sub Form_Load()
Dim DatF As java#text#DateFormat= New java#text#SimpleDateFormat ("dd-MM-yyyy")
Dim df As javax#swing#text#DateFormatter=New javax#swing#text#DateFormatter(DatF)
Dim tf As javax#swing#JFormattedTextField=Newjavax#swing#JFormattedTextField(df)
tf.SetBounds(10,10,100,20)
Me.add tf
End Sub
... and i got class descriptor.
Can anyone try this code, and tell me a result?
Thanks
Milan
PS:
tags dont work with Google Chrome
Hi Milan,
I get the same result as you.
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
Public Sub Form_Load()
Dim DatF As java#text#DateFormat = New java#text#SimpleDateFormat ("dd-MM-yyyy")
Dim df As javax#swing#text#DateFormatter = New javax#swing#text#DateFormatter(DatF)
Dim tf As javax#swing#JFormattedTextField = New javax#swing#JFormattedTextField(df)
tf.setBounds(10,10,300,20)
Me.add tf
d = Format$(Now, "dd-mm-yyyy")
tf.setValue(DatF.format(d))
End Sub
|
I add two lines to your code to see the actual date, but I do not know what you expected.
Cheers
Stefan
Hi Stefan
Thanks for your response.
I expected something like
this
To create my own format, for easy validating user inputs.
Milan