1
0
Fork 0
mirror of https://gitlab.com/kauron/jstudy synced 2025-09-30 21:01:10 +02:00

Main: Icons and about button

This commit is contained in:
Carlos Galindo 2016-06-13 20:18:09 +02:00
commit 76bff4c84b
Signed by: kauron
GPG key ID: 83E68706DEE119A3
3 changed files with 82 additions and 48 deletions

View file

@ -13,13 +13,18 @@ import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.BorderPane;
import javafx.stage.FileChooser;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.util.*;
import java.util.List;
public class Controller implements Initializable {
@FXML
@ -65,6 +70,7 @@ public class Controller implements Initializable {
dialog.getEditor().setPromptText("Table name");
dialog.setTitle("Creating new table");
dialog.setHeaderText("Please input a name for the new table");
dialog.setGraphic(new ImageView(new Image(Main.class.getResource("img/Edit.png").toString())));
dialog.getDialogPane().setMinWidth(250);
dialog.showAndWait();
dialog.setResultConverter(value -> value.getButtonData().equals(ButtonBar.ButtonData.OK_DONE) ? value.getText() : "");
@ -152,4 +158,15 @@ public class Controller implements Initializable {
e.printStackTrace();
}
}
@FXML
protected void onAboutAction(ActionEvent event) {
if (Desktop.isDesktopSupported()) {
try {
Desktop.getDesktop().browse(URI.create("https://kauron.github.io/jstudy"));
} catch (IOException e) {
e.printStackTrace();
}
}
}
}