HanSolo / tilesfx

A JavaFX library containing tiles that can be used for dashboards.
Apache License 2.0
1.43k stars 202 forks source link

Remove the BarChart from FlowPane,WARNING: Exception while evaluating select-binding [window, showing] #57

Closed taboowater closed 6 years ago

taboowater commented 6 years ago

when i run the tilesfxdemo in eclipse, everything is perfect,but i try to remove same item,there is a problem:

`pane.setAlignment(Pos.CENTER); pane.setCenterShape(true); pane.setPadding(new Insets(5)); //pane.setPrefSize(800, 600); pane.setBackground(new Background(new BackgroundFill(Color.web("#101214"), CornerRadii.EMPTY, Insets.EMPTY)));

    PerspectiveCamera camera = new PerspectiveCamera();
    camera.setFieldOfView(10);

    Scene scene = new Scene(pane);
    scene.setCamera(camera);

    **pane.getChildren().clear();**

    stage.setTitle("TilesFX");
    stage.setScene(scene);
    stage.show();`

WARNING: Exception while evaluating select-binding [window, showing] July 23, 2018 6:59:06 AM com.sun.javafx.binding.SelectBinding$SelectBindingHelper getObservableValue WARNING: Exception while evaluating select-binding [window, showing] July 23, 2018 6:59:06 AM com.sun.javafx.binding.SelectBinding$SelectBindingHelper getObservableValue ...... ......

taboowater commented 6 years ago

how can i remove some item with out WARNING? THX

negste commented 6 years ago

I found the same problem. The warning is annoying because it pollutes log files.

In case it helps, here is a compilable example:

package tileremove;

import eu.hansolo.tilesfx.Tile;
import eu.hansolo.tilesfx.TileBuilder;
import java.util.Locale;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

/**
 *
 * @author ced04u
 */
public class TileRemove extends Application {

    @Override
    public void start(Stage primaryStage) {

        VBox root = new VBox();
        AnchorPane tilePane = new AnchorPane();
        Tile clock = TileBuilder.create()
                .skinType(Tile.SkinType.TIMER_CONTROL)
                .secondsVisible(true)
                .dateVisible(true)
                .running(true)
                .locale(Locale.ITALY)
                .build();
        tilePane.getChildren().add(clock);
        AnchorPane.setTopAnchor(clock, 0.0);
        AnchorPane.setRightAnchor(clock, 0.0);
        AnchorPane.setBottomAnchor(clock, 0.0);
        AnchorPane.setLeftAnchor(clock, 0.0);
        Button btn = new Button();
        btn.setText("Remove tile");
        btn.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                tilePane.getChildren().remove(clock);
            }
        });

        root.getChildren().addAll(tilePane, btn);
        Scene scene = new Scene(root, 300, 250);

        primaryStage.setTitle("Tile remove test");
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        launch(args);
    }

}
negste commented 6 years ago

I have created a pull request for this issue (#58)

HanSolo commented 6 years ago

thx...merged 😊👍🏻

negste commented 6 years ago

Thank you for the awsome library! btw, I'm looking into the possibility of adding a tooltip to the notification region (just like it's already available for the info region). Would you mind if I prepare a pr for that?

HanSolo commented 6 years ago

No problem...just go for it...do not have that much time at the moment cause I'm blocked by a customer project :)

Gerrit Grunwald Westfalenstr. 93 48165 Münster Germany

tel: +49 (0)2501 24321 mob: +49 (0)171 1745350 web: http://www.harmonic-code.org

On 16. Oct 2018, 14:36 +0200, Stefano Negri notifications@github.com, wrote:

Thank you for the awsome library! btw, I'm looking into the possibility of adding a tooltip to the notification region (just like it's already available for the info region). Would you mind if I prepare a pr for that? — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.