This file contains hidden or 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
| public class JavafxSampleLIST extends Application { | |
| ListView<String> list = new ListView<>(); | |
| ObservableList<String> items = FXCollections.observableArrayList(); | |
| @Override | |
| public void start(Stage primaryStage) { | |
| StackPane root = new StackPane(); | |
| root.getChildren().add(list); |
This file contains hidden or 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
| @Override | |
| public void start(Stage primaryStage) { | |
| Button btn = new Button(); | |
| btn.setText("Say 'Hello World'"); | |
| btn.setOnAction(new EventHandler<ActionEvent>() { | |
| @Override | |
| public void handle(ActionEvent event) { | |
| System.out.println("Hello World!"); | |
| } | |
| }); |
This file contains hidden or 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
| ListView<String> list = new ListView<>(); | |
| ObservableList<String> items = FXCollections.observableArrayList(); |
This file contains hidden or 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
| button.setOnAction(new EventHandler<ActionEvent>() { | |
| @Override | |
| public void handle(ActionEvent event) { | |
| System.out.println("Anonymous!"); | |
| } | |
| }); |
This file contains hidden or 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
| public class SomeJavaApp extends Application { | |
| ListView<String> list = new ListView<>(); | |
| ObservableList<String> items = FXCollections.observableArrayList(); | |
| @Override | |
| public void start(Stage primaryStage) { | |
| StackPane root = new StackPane(); | |
| root.getChildren().add(list); |
This file contains hidden or 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
| start { | |
| stage(title: 'GroovyFX Hello World', visible: true) { | |
| scene(fill: BLACK, width: 500, height: 250) { | |
| hbox(padding: 60) { | |
| text(text: 'Groovy', font: '80pt sanserif') { | |
| fill linearGradient(endX: 0, stops: [PALEGREEN, SEAGREEN]) | |
| } | |
| text(text: 'FX', font: '80pt sanserif') { | |
| fill linearGradient(endX: 0, stops: [CYAN, DODGERBLUE]) | |
| effect dropShadow(color: DODGERBLUE, radius: 25, spread: 0.25) |
This file contains hidden or 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
| private void doStuff(int liczba) { | |
| assert (liczba>0); | |
| // jeżeli liczba jest wieksza niż 0, to przechodzimy dalej. | |
| } |
This file contains hidden or 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
| private void doStuff(int liczba) { | |
| assert (liczba>0): "Wprowadzona liczba jest mniejsza niż zero"; | |
| //... | |
| } |
This file contains hidden or 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
| /* | |
| ze względu na to ze chce dla różnych orientacji inaczej wypełnić fragmenty, | |
| muszę sprawdzić w jakiej aktualnie orientacji się znajduje. | |
| */ | |
| if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE){ | |
| PersonFragment articleFrag = (PersonFragment) | |
| getSupportFragmentManager().findFragmentById(R.id.detail_container); | |
| articleFrag.updateArticleView(person); | |
| //Ląduje tutaj w przypadku kiedy aktualną orientacją jest landscape. | |
| }else{ |
This file contains hidden or 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
| getResources().getConfiguration().orientation |
OlderNewer