I have one more question, I have it separated in my project by folders in this way:
I have a folder (Main) for the main class with the method start(Stage stage)
and the method main(String [] args)
Another folder (Model) for business logic
Another one for the Views that the application will have
and finally another (ViewModel) for the Controller of each View.
SampleController code:
public class SampleController {
@FXML
private JFXTextField TxtWatts;
@FXML
public void initialize() {
TxtWatts.setOnKeyTyped(event -> SoloNumerosEnteros(event));
}
public void SoloNumerosEnteros(KeyEvent keyEvent) {
try{
char key = keyEvent.getCharacter().charAt(0);
if(!Character.isDigit(key))
keyEvent.consume();
}catch (Exception ex){
System.out.println(ex.getMessage());
}
}
}