I am developing an IDE. I created a CustomTab.java
class by extending the default JavaFX Tab
. I wanted to add a color transition animation, but I ran into a problem. The method in TabPane
named getTabs()
, which returns ObservableList<Tab>
, is final. This means I can't override it to return ObservableList<CustomTab>
. It seems that constructions like this:
for (Tab tab : tabPane.getTabs()) {
((CustomTab) tab).stopFlash();
}
used in Controller.java
are neck breaking and wrong.
What is the right way to do this?
I think my reply is quiete late, but I think there is a way to do so. Use the function
In that Object you can store all the informations you'll need to proceed.
so for example create an Object holding all the objects you need. E.g. you can hold the reference to your webView.
Also if you need to have different informations you could use:
Here a link to the documentation I found
Maybe the Javadoc is better, but I found this one.
Here is a little example that I wrote:
In my listener I receive the result simply by: