-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.java
More file actions
34 lines (29 loc) · 1.02 KB
/
App.java
File metadata and controls
34 lines (29 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package ass;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Rectangle2D;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.stage.Screen;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
public class App extends Application {
@Override
public void start(Stage stage) throws Exception {
stage.initStyle(StageStyle.TRANSPARENT);
Parent root = FXMLLoader.load(getClass().getResource("weather.fxml"));
root.setStyle( "-fx-background-color: rgba(255, 255, 255, 0);");
Rectangle2D sBounds = Screen.getPrimary().getVisualBounds();
stage.setX(sBounds.getMinX() + sBounds.getWidth()-200);
stage.setY(0);
Scene scene = new Scene(root);
scene.setFill(Color.TRANSPARENT);
stage.setScene(scene);
stage.show();
stage.toBack();//still need to figure out how to keep window behind all others
}
public static void main(String[] args) {
launch(args);
}
}