CalendarTextField and FXML problem

859 views
Skip to first unread message

Sebastian Gutierrez

unread,
Nov 15, 2012, 10:10:58 AM11/15/12
to jfxtra...@googlegroups.com
  
Hi,

when I set a CalendarTextField from FXML:


like this..
<CalendarTextField fx:id="txtactiva" layoutX="170.0" layoutY="333.0" prefWidth="200.0" showTime="true" />


I get in scene builder 

Error loading file '...Test.fxml'.
Cause is Failed to set java.util.TimeZone.ID to null

I have no problem with CalendarPicker, is there any way to set that from FXML??? or maybe change the null value in jfxtras default?

thanks!

Tom

unread,
Nov 18, 2012, 2:09:19 PM11/18/12
to jfxtra...@googlegroups.com
Just tested this against JFXtras-2.2-r5-SNAPSHOT

<?import javafx.scene.layout.*?>
<?import jfxtras.labs.scene.control.*?>

<VBox xmlns:fx="http://javafx.com/fxml">
<children>
<CalendarTextField fx:id="txtactiva" layoutX="170.0" layoutY="333.0" prefWidth="200.0" showTime="true" />
</children>
</VBox>

And it works flawlessly. The layoutX and layoutY attributes do not matter here, but time selectors of the control are shown. I have no idea BTW how to set a calendar value using FXML.

Tom
> --
> You received this message because you are subscribed to the Google Groups "JFXtras Users" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/jfxtras-users/-/mIJaLFwu8rEJ.
> To post to this group, send email to jfxtra...@googlegroups.com.
> To unsubscribe from this group, send email to jfxtras-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/jfxtras-users?hl=en.

sguti...@integraccs.com

unread,
May 6, 2013, 8:48:17 AM5/6/13
to jfxtra...@googlegroups.com
retaking htis the problem is on Scene Builder you can check also with the latest developer preview, with this scene builder wont work fine.

Tom

unread,
May 6, 2013, 3:48:39 PM5/6/13
to jfxtra...@googlegroups.com
Almost impossible to read. But this looks like a JSR-310 initialization issue, not a CalendarTextField one. Take a look at the jars that are used by JFXtras.

Tom



On 2013-05-06 14:48, sguti...@integraccs.com wrote:

Sebastian Gutierrez

unread,
May 7, 2013, 9:58:33 AM5/7/13
to jfxtra...@googlegroups.com
if you see this on google groups directly and click the image you can see it ok.

other thing with calendar textfield if you set showtime= false and you select a value on the textfield you see the time that is on the moment you click, shouldn't this be without time when you use showtime=false??

Tom

unread,
May 11, 2013, 2:35:38 AM5/11/13
to jfxtra...@googlegroups.com
I'm not able to reproduce the problem you describe.

It would also be highly illogical: setting the showtime property results in updating the DateFormat being used to render the date as text in the textfield. When showtime is set to false, the formatter is set to "SimpleDateFormat.getDateInstance()". So the time is simply not rendered. However, the minute you set your own DateFormat, this logic is disabled and you are responsible for setting the correct DateFormat yourself.

Tom
--
You received this message because you are subscribed to the Google Groups "JFXtras Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jfxtras-user...@googlegroups.com.

To post to this group, send email to jfxtra...@googlegroups.com.

Tom

unread,
May 20, 2013, 2:26:53 AM5/20/13
to jfxtra...@googlegroups.com
I've though about this a little more and didn't like the approach I ended up with; two properties that can have conflicting values. So the control's API has been changed and the "showTime" property is removed. The control will now autodetect if the used dateformat shows the time or not.

In order to have the control show time, you need to specify a dateFormat that shows time, e.g. SimpleDateFormat.getDateTimeInstance().


On 2013-05-07 15:58, Sebastian Gutierrez wrote:

marcu...@gmail.com

unread,
Jan 2, 2014, 4:04:30 AM1/2/14
to jfxtra...@googlegroups.com
Hi,

I'm having the same problem with the latest version of jvxtras for Java 7 (jfxtras-labs-2.2-r6-20131224).  My Java is also the last stable one (7u45). When I load a CalendarTextField in a fxml file, the Scene Builder (latest for Java7, version 1.1) display an error message on load and it's not possible to work on fxml file. The message is the above mentioned (Failed to set java.util.TimeZone.ID to null). The control is included with all default options. I only setup the localization of the form.

If anyone can help me about this issue I will appreciate.

Thanks in advance!

Cordial,

Marcus Gama

tbeernot

unread,
Jan 2, 2014, 5:31:10 AM1/2/14
to jfxtra...@googlegroups.com
There is an example for using CalendarTextField in FXML

https://github.com/JFXtras/jfxtras-labs/blob/2.2/src/test/java/jfxtras/labs/scene/control/CalendarTextFieldTrial2.xml

This works correctly. Can you tell me what you do differently? What dependencies are defined in your project? Can you create a CalendarTextField without FXML?
--
You received this message because you are subscribed to the Google Groups "JFXtras Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jfxtras-user...@googlegroups.com.
To post to this group, send email to jfxtra...@googlegroups.com.

marcu...@gmail.com

unread,
Jan 2, 2014, 7:02:32 AM1/2/14
to jfxtra...@googlegroups.com
First of all, thank you for your prompt answer. I can't check at my system right now, but at night I will test the code and let you know.

I added to my app the dependencies of java7u45, javafx and jvxtras. The strange is the control is loaded when I run my app (and I think work properly) and when I test in Scene Builder. But when I load the fxml file in Scene Builder, the error message is showed and I cannot edit any other control. I'm using the BigDecimalField also, without problems. If I remove the CalendarText and keep only the BigDecimalField, no error message is showed and I can work as usual with Scene Builder.

At night I will try the code suggested and I will inform you if the problem was solved.

Thank you again!

Cordial,

Marcus Gama

tbeernot

unread,
Jan 2, 2014, 7:31:52 AM1/2/14
to jfxtra...@googlegroups.com
Please also test with the two jars in JFXtras lib directory included as well.

https://github.com/JFXtras/jfxtras-labs/tree/2.2/lib

These should not matter for this usage, but one never knows how a sneaky import somewhere corrupts things.

Tom

marcu...@gmail.com

unread,
Jan 2, 2014, 4:49:41 PM1/2/14
to jfxtra...@googlegroups.com
Hi,

I made some tests without success. I attached to this message five screens about the issue.

The first one, below (I think you can click to see larger), it's my form in Scene Builder without the CalendarTextField. Please, not the top pan with background in white.


The second one, I included the CalendarTextField and tried to load on Scene Builder, only with jfxtras dependency. You can see the Time.Zone.ID error.

The third screen, you see the Scene Builder with my form and CalendarTextField included. After the error, I can open the Scene Builder to edit my form, but the program becomes very unstable (it freeze after some use). You can  see the top panel is not white. It was simply reduced to small square on top left corner (I don't know why).

The fourth screen, I showed my form in Scene Builder in preview mode. It seems the CalendarTextFields works Ok.

The fifth screen, I tried to load my form with the two other jars (from the previous message). The error persists.

I tried to load the syntax sample provided by you. but the error still there. I really don't know what is happening.

Once again, any help I will appreciate.

tbeernot

unread,
Jan 3, 2014, 3:35:57 AM1/3/14
to jfxtra...@googlegroups.com
I've tested adding the control to SceneBuilder 2.0 and it works without problems, except in the preview mode the popup does not show. That is using JavaFX 8.0 and JFXtras 8.0, because Oracle's focus is completely on the 8.0 release. Are you able to test this using the 8.0 versions?



Tom
scenebuilder.png

marcu...@gmail.com

unread,
Jan 3, 2014, 12:30:11 PM1/3/14
to jfxtra...@googlegroups.com
Hi,

I managed to use the CalendarTextField with SceneBuilder 2.0 and Java8 (with the same preview mode problem). But I wouldn't like to migrate right now my app to Java8. Anyway, thank you very much for your support and congratulations for the great work of jfxtras team. I will try a bit more to solve the problem with jfxtras 2.2 and Java7. If I get a solution, I will post here.

Cordial,

Marcus Gama
Reply all
Reply to author
Forward
0 new messages