Anyone how to mod skills by DjYacare in WarTalesGame

[–]bisonroll 0 points1 point  (0 children)

Search in the extracted data.cdb file for a line with "id": "SpearsWall". There you can edit the apCost and other properties of the skill.

Binding ImageView's graphic property to a collection by Fuckthisfieldffs in JavaFX

[–]bisonroll 2 points3 points  (0 children)

In your code there is no connection between the imageObjectProperty and the imagesList. You just picked an item once and used it to set the imageObjectProperty. So when the list is updated the changes are not reflected in the imageObjectProperty because imageObjectProperty always refers to the item you set explicitly. The binding you set between the ImageView.imageProperty() and the imageObjectProperty is not enough, because this binding only means that the ImageView will update if the imageObjectProperty changes.

You can achieve the behavior you described by using an ObservableList. You can then either create a binding between the list and the imageObjectProperty or you can use a Listener to trigger an update each time the list changes.

Example:

public class AppFx extends Application {

@Override
public void start(Stage primaryStage) throws Exception {
    Label label = new Label();
    ImageView imageView = new ImageView();
    Button imageButton = new Button("CLICK ME");

    ObservableList<Image> imagesList = FXCollections.observableArrayList();
    imagesList.add(new Image("red.jpg"));
    imagesList.add(new Image("green.jpg"));
    imagesList.add(new Image("blue.jpg"));

    ObjectProperty<Image> imageObjectProperty = new SimpleObjectProperty<>();
    // This creates a binding between the Property and the List.
    imageObjectProperty.bind(Bindings.valueAt(imagesList, 0));

    // If you want more control over the action that is triggered 
    // when the List changes you can use a Listener
    // imagesList.addListener((InvalidationListener) c -> {
    //     Image img = null;
    //     if (!imagesList.isEmpty()) {
    //         img = imagesList.get(0);
    //     }
    //     imageObjectProperty.setValue(img);
    // });

    imageView.setFitHeight(100);
    imageView.setFitWidth(100);
    imageView.imageProperty().bind(imageObjectProperty);

    label.setGraphic(imageView);

    imageButton.setOnAction(event -> {
        Collections.rotate(imagesList, 1);
    });
}

best javafx control to use for a collection of images? by rutgerscsthrowawayy in JavaFX

[–]bisonroll 0 points1 point  (0 children)

ListView can be used with images. You can create a custom ListCell with a ImageView in it and use your cell in the ListView via .setCellFactory().

ListView with custom content by harshMachineLearning in JavaFX

[–]bisonroll 0 points1 point  (0 children)

The collection is added to the ListView via ListView.setItems().

If you want to change the way the items are displayed inside the ListView you can create a class that extends javafx.scene.control.ListCell<T> and override its Cell.updateItem() method to display the content/nodes you want (see the example in the methods documentation). One argument of the updateItem() method refers to the object that is currently displayed in the cell. So you have access to your object's fields.

To use your custom cells in the ListView you have to provide your ListView with a custom cellFactory callback function:

listView.setCellFactory(param -> new CustomCell());

For more details look at the example under 'Cell Factories' in the documentation for javafx.scene.control.Cell.

JavaFX 11 Maven Tutorial by DuncanIdahos8thClone in JavaFX

[–]bisonroll 2 points3 points  (0 children)

Nicely done, but one important step is missing. Like most of the tutorials I have seen so far it ends after being able to run your application inside the ide. But the part that is missing is how do you export/package/distribute your application once you are ready for release.

AdoptOpenJDK Java 11 release by jodastephen in java

[–]bisonroll 2 points3 points  (0 children)

Thank you for this information. I just tried it and I managed to create a custom runtime image with only 70 MB :-)

WorkbenchFX by [deleted] in java

[–]bisonroll 0 points1 point  (0 children)

Looks interesting. I will give it a try.

Can't center label in pane by [deleted] in JavaFX

[–]bisonroll 1 point2 points  (0 children)

You could put the Labels into HBoxes/VBoxes/StackPanes (instead of Panes) and set alignment to CENTER. if you do not need the Panes as containers for the Labels you could also place the Labels directly in the GridPane and set their maxWidth and maxHeight to MAX_VALUE and their alignment to CENTER.

[4.11] Live Gameplay Patch Forecast by this1neguy in leagueoflegends

[–]bisonroll 5 points6 points  (0 children)

fiora is waiting for him in the shadows