Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with OpenJDK 21 #71

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Library upgrades
dbschema-pro committed Sep 17, 2024
commit b5a713d1e4c3deb07a3b7e4c55167170fd6e49a8
4 changes: 2 additions & 2 deletions src/main/groovy/groovyx/javafx/GroovyFX.java
Original file line number Diff line number Diff line change
@@ -60,15 +60,15 @@ public static void start(Closure buildMe) {
closure = buildMe;
if ( Platform.isFxApplicationThread()){
try {
final Stage primaryStage = new Stage();
// FIND OUT WHERE THE SCENE IS CREATED
// primaryStage.sceneProperty().addListener((o,p,c)-> Thread.dumpStack());

final Stage primaryStage = new Stage();
final ObservableList<Window> activeWindows = Window.getWindows();
System.out.println("Currently active " + activeWindows.size() + " windows.");
if ( !activeWindows.isEmpty()) {
primaryStage.initOwner( activeWindows.get( activeWindows.size()-1 ));
}

buildMe.setDelegate(new SceneGraphBuilder(primaryStage));
InvokerHelper.invokeClosure(buildMe, new Object[] { primaryStage });
} catch(RuntimeException re) {
8 changes: 7 additions & 1 deletion src/main/groovy/groovyx/javafx/factory/StageFactory.groovy
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@
package groovyx.javafx.factory

import groovyx.javafx.event.GroovyEventHandler
import javafx.application.Platform
import javafx.event.EventHandler
import javafx.stage.FileChooser
import javafx.stage.Popup
@@ -79,6 +80,9 @@ class StageFactory extends AbstractFXBeanFactory {
def centerOnScreen = attributes.remove("centerOnScreen");
builder.context.put("centerOnScreen", centerOnScreen);

def showAndWait = attributes.remove("showAndWait");
builder.context.put("showAndWait", showAndWait);

def show = attributes.remove("show");
if(show == null)
show = attributes.remove("visible");
@@ -123,7 +127,9 @@ class StageFactory extends AbstractFXBeanFactory {
if(builder.context.centerOnScreen) {
node.centerOnScreen();
}
if (builder.context.show) {
if (builder.context.showAndWait) {
node.showAndWait();
} else if (builder.context.show) {
node.show();
}
}