Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here I put an example of windows from <a href="http://jfxtras.org/" rel="nofollow noreferrer">jfxtras</a> inside of Tabs, I just modify the <a href="https://stackoverflow.com/questions/17673292/internal-frames-in-javafx/17693986#17693986">example</a>.</p> <pre><code>import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.Tab; import javafx.scene.control.TabPane; import javafx.stage.Stage; import jfxtras.labs.scene.control.window.CloseIcon; import jfxtras.labs.scene.control.window.MinimizeIcon; import jfxtras.labs.scene.control.window.Window; public class WindowInTab extends Application { private static int counter = 1; private void init(Stage primaryStage) { TabPane tabPane = new TabPane(); Tab tab = generateTab("Windows..."); Tab anotherTab = generateTab("More Windows"); tabPane.getTabs().addAll(tab, anotherTab); primaryStage.setResizable(true); primaryStage.setScene(new Scene(tabPane, 600, 500)); } private Tab generateTab(String tabName) { Tab tab = new Tab(tabName); final Group root = new Group(); tab.setContent(root); Button button = new Button("Add more windows"); root.getChildren().addAll(button); button.setOnAction(new EventHandler&lt;ActionEvent&gt;() { @Override public void handle(ActionEvent arg0) { // create a window with title "My Window" Window w = new Window("My Window#"+counter); // set the window position to 10,10 (coordinates inside canvas) w.setLayoutX(10); w.setLayoutY(10); // define the initial window size w.setPrefSize(300, 200); // either to the left w.getLeftIcons().add(new CloseIcon(w)); // .. or to the right w.getRightIcons().add(new MinimizeIcon(w)); // add some content w.getContentPane().getChildren().add(new Label("Content... \nof the window#"+counter++)); // add the window to the canvas root.getChildren().add(w); } }); return tab; } public double getSampleWidth() {return 600;} public double getSampleHeight() {return 500;} @Override public void start(Stage primaryStage) throws Exception { init(primaryStage); primaryStage.show(); } public static void main(String[] args) {launch(args);} } </code></pre> <p><img src="https://i.stack.imgur.com/OxSXf.png" alt="internal windows in tabs"></p> <p>I don't know if this was exactly what you were looking for. Hope it helps!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload