Junior — Middle
Do you have experience developing applications using JavaFX?
sobes.tech AI
Answer from AI
JavaFX is a modern framework for creating graphical user interfaces in Java. It allows for the development of cross-platform applications with rich UI, supports multimedia, animations, and CSS styling.
Development experience with JavaFX typically includes:
- Creating scenes and stage setups (Scene, Stage).
- Using FXML to describe the interface in XML.
- Handling events and data binding.
- Styling with CSS.
Example of a simple window with a button in JavaFX:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class SimpleApp extends Application {
@Override
public void start(Stage primaryStage) {
Button btn = new Button("Click me");
btn.setOnAction(e -> System.out.println("Button clicked!"));
StackPane root = new StackPane(btn);
Scene scene = new Scene(root, 300, 200);
primaryStage.setTitle("JavaFX Example");
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}