About Java-FX Controller
public class SettingsController implements Initializable{
@Override
public void initialize(URL location, ResourceBundle resources) {
}
}
This is the way to write controller class in javafx
But remember some point about controller class in javafx
- It is not necessary to extends Initialization interface to create controller class
- But if you implements initialization interface then it is necessary to override initialize method as shown
second way :
public class SettingsController {
public void initialize() {
}
}
this is also a correct way to create controller class in jaavfx
Note - method name should be initialize it is starting point of your controller class
ex : public class SettingController
{
init(){
This is not a valid controller class
}
}
@Override
public void initialize(URL location, ResourceBundle resources) {
}
}
This is the way to write controller class in javafx
But remember some point about controller class in javafx
- It is not necessary to extends Initialization interface to create controller class
- But if you implements initialization interface then it is necessary to override initialize method as shown
second way :
public class SettingsController {
public void initialize() {
}
}
this is also a correct way to create controller class in jaavfx
Note - method name should be initialize it is starting point of your controller class
ex : public class SettingController
{
init(){
This is not a valid controller class
}
}
Comments
Post a Comment