Utiliser l'Annotation @PostConstruct
Bonjour, est-ce qu'on peut utiliser l'annotation @PostConstruct en JavaFX :question:
Si oui comment l'activer car dans mon cas elle n'est jamais appelée.
Par exemple :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
public class A
{
public A()
{
System.out.println("A");
}
@PostConstruct
public void init()
{
System.out.println("init");
}
} |
Code:
1 2 3 4 5 6 7 8
|
@Override
public void start(Stage stage) throws Exception
{
stage.setScene(new Scene(new Group(), 300, 250));
stage.show();
A a = new A();
} |