user3147619
user3147619

Reputation: 147

How to set up an inner stage in javaFX

I have a TabPane with 2 Tabs. What I want is a modal pane (say X) but only visible within one Tab. When showed, the pane "X" prevents the content of the Tab from being accessed, like a modal stage does. What are the possible implementations here ?

Upvotes: 1

Views: 180

Answers (1)

James_D
James_D

Reputation: 209330

ControlsFX has a lightweight dialog that can be used for this.

That API is marked as deprecated, as some of the functionality has been migrated to the core JavaFX API. As of the latest JavaFX release (8u40), the lightweight dialog functionality has not been included (though it may be in a later release); so for now you will need ControlsFX to do this.

The code would look something like

Tab someTab ;
// ...
Action response = Dialogs.create()
    .owner(someTab)
    .title("Please confirm")
    .message("Confirm your decision)
    .showConfirm();

Upvotes: 1

Related Questions