Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Window minimize problem.

843260Oct 30 2012 — edited Oct 30 2012
Hello,
when I minimize javafx2 window it gets x=-32000 and y=-32000 coordinates, so when the window is minimized I cannot determinate on which monitor it was opened (application that I write will be using more than one monitor). After deminimize, window gets back to it's original position on the monitor so I hoped that coordinates before minimize are kept in Stage object but I cannot find anything like this. I would appreciate any help.
I'm using Windows 7 Professional and JavaFx 2.2.3 from Java SE 7u9.

This problem does not apper on Ubuntu, JavaFx 2.2.0 beta. After minimize x and y coordinates do not change.

I'm applying code to reproduce described situation.
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class Screens extends Application {

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

	@Override
	public void start(final Stage primaryStage) throws Exception {
		StackPane root = new StackPane();
		primaryStage.setScene(new Scene(root, 300, 250));
		primaryStage.iconifiedProperty().addListener(
				new ChangeListener<Boolean>() {

					@Override
					public void changed(ObservableValue<? extends Boolean> prop, Boolean oldValue, Boolean newValue) {
						System.out.println("x=" + primaryStage.getX() + ", y=" + primaryStage.getY() + ", width=" + primaryStage.getWidth() + ", height=" + primaryStage.getHeight());
						System.out.println("iconified=" + newValue);
					}
				});

		primaryStage.show();
	}
}
Edited by: 840257 on 2012-10-30 04:14

Edited by: 840257 on 2012-10-30 04:16

Edited by: 840257 on 2012-10-30 04:16
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 27 2012
Added on Oct 30 2012
0 comments
250 views