0

I'm using this very simple example of InfoOverlay:

import javafx.application.Application;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.ImageView;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import org.controlsfx.control.InfoOverlay;

public class MainApp extends Application
{
    private InfoOverlay infoOverlay;

    public static void main(String[] args)
    {
        launch(args);
    }

    public Node getPanel(Stage stage)
    {
        String imageUrl = getClass().getResource("/styles/duke_wave.png").toExternalForm();
        ImageView image = new ImageView(imageUrl);

        String info = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
            + "Nam tortor felis, pulvinar in scelerisque cursus, pulvinar at ante. "
            + "Nulla consequat congue lectus in sodales.";

        infoOverlay = new InfoOverlay(image, info);

        infoOverlay.setShowOnHover(false);
        StackPane stackPane = new StackPane(infoOverlay);

        return stackPane;
    }

    @Override
    public void start(Stage stage) throws Exception
    {
        Scene scene = new Scene((Parent) getPanel(stage));

        stage.setTitle("JavaFX and Maven");
        stage.setScene(scene);
        stage.show();
    }
}

I want to insert VBox or BorderPane into InfoOverlay(image, info). According to the JavaDoc: Have only these default constructors:

InfoOverlay()

InfoOverlay(Node content, String text)

InfoOverlay(String imageUrl, String text)

Can you help me to solve this?

Patrick
  • 4,532
  • 2
  • 26
  • 32
user1285928
  • 1,328
  • 29
  • 98
  • 147

1 Answers1

0

Seems like it only supports text. (The Node is the node over which the text is laid.) You will need to roll your own implementation (or request a feature.)

James_D
  • 201,275
  • 16
  • 291
  • 322