Browsers
This commit is contained in:
parent
a31696c424
commit
2de13f0ead
@ -5,17 +5,16 @@ import javafx.beans.property.ReadOnlyBooleanProperty;
|
|||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.scene.Parent;
|
import javafx.scene.Parent;
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.scene.shape.Rectangle;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import javafx.stage.StageStyle;
|
import javafx.stage.StageStyle;
|
||||||
import java.awt.*;
|
|
||||||
import java.net.URI;
|
|
||||||
|
|
||||||
public class Main extends Application {
|
public class Main extends Application {
|
||||||
|
|
||||||
private double xOffset = 0;
|
private double xOffset = 0, yOffset = 0; // Offsets for dragging
|
||||||
private double yOffset = 0;
|
private Button exit, min; // Define buttons
|
||||||
|
private Rectangle dragBar; // Draggable top bar
|
||||||
volatile double[] posOrigin = {0, 0};
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(Stage primaryStage) throws Exception{
|
public void start(Stage primaryStage) throws Exception{
|
||||||
@ -26,20 +25,29 @@ public class Main extends Application {
|
|||||||
primaryStage.setScene(new Scene(root, 900, 500));
|
primaryStage.setScene(new Scene(root, 900, 500));
|
||||||
primaryStage.show();
|
primaryStage.show();
|
||||||
|
|
||||||
root.lookup("#exit").setOnMouseClicked(event -> primaryStage.close());
|
|
||||||
root.lookup("#min").setOnMouseClicked(event -> primaryStage.setIconified(true));
|
// Field initialization
|
||||||
|
exit = (Button) root.lookup("#exit");
|
||||||
|
min = (Button) root.lookup("#min");
|
||||||
|
dragBar = (Rectangle) root.lookup("#rectangle");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Infrastructural navigation
|
||||||
|
exit.setOnMouseClicked(event -> primaryStage.close());
|
||||||
|
min.setOnMouseClicked(event -> primaryStage.setIconified(true));
|
||||||
|
|
||||||
// Drag
|
// Drag
|
||||||
root.lookup("#rectangle").setOnMousePressed(event -> {
|
dragBar.setOnMousePressed(event -> {
|
||||||
xOffset = event.getSceneX();
|
xOffset = event.getSceneX();
|
||||||
yOffset = event.getSceneY();
|
yOffset = event.getSceneY();
|
||||||
});
|
});
|
||||||
|
dragBar.setOnMouseDragged(event -> {
|
||||||
root.lookup("#rectangle").setOnMouseDragged(event -> {
|
|
||||||
primaryStage.setX(event.getScreenX() - xOffset);
|
primaryStage.setX(event.getScreenX() - xOffset);
|
||||||
primaryStage.setY(event.getScreenY() - yOffset);
|
primaryStage.setY(event.getScreenY() - yOffset);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
launch(args);
|
launch(args);
|
||||||
}
|
}
|
||||||
|
@ -16,16 +16,16 @@ public class Updater {
|
|||||||
conn = new URL(URL).openConnection();
|
conn = new URL(URL).openConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void download(){
|
public void downloadPorn(){
|
||||||
//TODO: Download lots of
|
//TODO: Download lots of porn
|
||||||
}
|
}
|
||||||
|
|
||||||
public void downloadMore(){
|
public void downloadMorePorn(){
|
||||||
//TODO: Download more
|
//TODO: Download more porn
|
||||||
}
|
}
|
||||||
|
|
||||||
public void downloadEvenMore(){
|
public void downloadEvenMorePorn(){
|
||||||
//TODO: Download even more
|
//TODO: Download even more porn
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Updater getInstance(String url) throws IOException {
|
public static Updater getInstance(String url) throws IOException {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user