Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. package org.tweetwallfx.vdz;
  2.  
  3. import javafx.application.Application;
  4. import javafx.geometry.Rectangle2D;
  5. import javafx.scene.Group;
  6. import javafx.scene.Scene;
  7. import javafx.scene.paint.Color;
  8. import javafx.stage.Screen;
  9. import javafx.stage.Stage;
  10.  
  11. public class TestMain extends Application {
  12.  
  13. @Override
  14. public void start(Stage primaryStage) throws Exception {
  15. Rectangle2D visualBounds = Screen.getPrimary().getVisualBounds();
  16. System.out.println("Visual bounds");
  17. System.out.println("min x \t" + visualBounds.getMinX());
  18. System.out.println("min y \t" + visualBounds.getMinY());
  19. System.out.println("width \t" + visualBounds.getWidth());
  20. System.out.println("height \t" + visualBounds.getHeight());
  21.  
  22. System.out.println();
  23.  
  24. Rectangle2D bounds = Screen.getPrimary().getVisualBounds();
  25. System.out.println("Bounds");
  26. System.out.println("min x \t" + bounds.getMinX());
  27. System.out.println("min y \t" + bounds.getMinY());
  28. System.out.println("width \t" + bounds.getWidth());
  29. System.out.println("height \t" + bounds.getHeight());
  30.  
  31. Scene scene = new Scene(new Group(), 1920, 1080);
  32. scene.setFill(Color.YELLOW);
  33. primaryStage.setHeight(1080);
  34. primaryStage.setWidth(1920);
  35. primaryStage.setTitle("Test");
  36. primaryStage.setScene(scene);
  37. primaryStage.show();
  38. primaryStage.setFullScreen(true);
  39. }
  40.  
  41. public static void main(String[] args) {
  42. launch(args);
  43. }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement