Created
February 27, 2015 22:35
-
-
Save deniscostadsc/9a92f4285c5ffbccd9de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package javafxexemploslayout; | |
import javafx.application.Application; | |
import javafx.geometry.Insets; | |
import javafx.scene.Scene; | |
import javafx.scene.control.Button; | |
import javafx.scene.layout.BorderPane; | |
import javafx.scene.layout.HBox; | |
import javafx.stage.Stage; | |
public class JavaFXExemplosLayout extends Application { | |
@Override | |
public void start(Stage primaryStage) { | |
BorderPane border = new BorderPane(); | |
HBox hbox = addBox(); | |
border.setTop(hbox); | |
Scene scene = new Scene(border, 300, 200); | |
primaryStage.setTitle("Exemplo de layouts"); | |
primaryStage.setScene(scene); | |
primaryStage.show(); | |
} | |
public HBox addBox() { | |
HBox hbox = new HBox(); | |
hbox.setPadding(new Insets(15, 12, 15, 12)); | |
hbox.setSpacing(10); | |
hbox.setStyle("-fx-background-color: #336699"); | |
Button currentButton = new Button("Atual"); | |
currentButton.setPrefSize(100, 20); | |
Button nextButton = new Button("Próximo"); | |
currentButton.setPrefSize(100, 20); | |
hbox.getChildren().addAll(currentButton, nextButton); | |
return hbox; | |
} | |
public static void main(String[] args) { | |
launch(args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment