There is no way in the API to do this. However, Frode Johansen made a custom class that inherited Region and placed a WebView control inside it, then adjusting its height based on the document height after it has loaded its content by executing a Javascript one-liner code in order to retrieve the height value.

A very big thank you because considering that the Label control cannot display formatted HTML content, the only way to work around this limitation is to create a custom class of it. Luckily, he has saved us all the trouble of making one.

Here is the custom class.

Sad to say, there is no such control in Java FX 2. However, Java FX 8 has one. Then again, if you want to maintain your rule that you must never force the user to update to the latest version just to be able to see a date picker, the only option is to make one.

Luckily, somebody else did the dirty work for us. Marko Jacob extended a more flexible version from Christian Schudt and it works flawlessly. Plus, using it is fairly easy too.

The downside to this is that you cannot import this control in the Java FX Scene Builder. You will have to add the DatePicker control programmatically.

javafx-date-picker

Download his JavaFX Date Picker Release on GitHub.

If ever this will happen to you, chances are you used a bean class as the object passed to the ObservableList. Hence, any update done will not update your TableView unless it is binded to that bean class.

To do so, replace your data types like long, int, double to use the Property class and instantiate it with SimpleProperty class. For String, use StringProperty and instantiate it with SimpleStringProperty.

Check this sample class:

Your bean class must have a Property method that will return the property class in order for binding to take effect with your TableView and ObservableList. This is so that the values of the individual entity fields can be observed for changes and any update action will take effect.

Related Posts Plugin for WordPress, Blogger...