JavaFx -HBox Example
package application;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class ComboBox extends Application {
Stage window;
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
// TODO Auto-generated method stub
window = primaryStage;
window.setTitle("Combo box- JavaFX");
HBox topmenu = new HBox();
topmenu.setPadding(new Insets(15, 12, 15, 12));
topmenu.setSpacing(10);
Button b1 = new Button("Console");
Button b2 = new Button("Action items");
Button b3 = new Button("Members");
Button b4 = new Button("Teams");
Button b5 = new Button("Quit");
topmenu.getChildren().addAll(b1,b2,b3,b4,b5);
BorderPane borderpane1 = new BorderPane();
borderpane1.setTop(topmenu);
Scene scene = new Scene(borderpane1, 300, 200);
window.setScene(scene);
window.show();
}
}
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class ComboBox extends Application {
Stage window;
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
// TODO Auto-generated method stub
window = primaryStage;
window.setTitle("Combo box- JavaFX");
HBox topmenu = new HBox();
topmenu.setPadding(new Insets(15, 12, 15, 12));
topmenu.setSpacing(10);
Button b1 = new Button("Console");
Button b2 = new Button("Action items");
Button b3 = new Button("Members");
Button b4 = new Button("Teams");
Button b5 = new Button("Quit");
topmenu.getChildren().addAll(b1,b2,b3,b4,b5);
BorderPane borderpane1 = new BorderPane();
borderpane1.setTop(topmenu);
Scene scene = new Scene(borderpane1, 300, 200);
window.setScene(scene);
window.show();
}
}
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment