Notes
Notes - notes.io |
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
public class DatabaseGUI extends Application {
private final File databaseFile = null;
@Override
public void start(Stage primaryStage) throws Exception {
databaseChooser(primaryStage);
primaryStage.setTitle("Database");
primaryStage.show();
}
public static void main(String[] args) {
Application.launch(args);
}
public static File openFileChooser(Stage primaryStage) {
FileChooser fc = new FileChooser();
fc.setTitle("Choose Database File");
File file = fc.showOpenDialog(primaryStage);
Desktop desktop = Desktop.getDesktop();
try {
desktop.open(file);
} catch (IOException ex) {
ex.getStackTrace();
}
return file;
}
public static void mainMenu(Stage primaryStage) {
GridPane pane = new GridPane();
Button btSearch = new Button("Search for someone");
Button btEdit = new Button("Edit data");
Button btBack = new Button("Go Back");
pane.setAlignment(Pos.CENTER);
pane.setPadding(new Insets(11.5, 12.5, 13.5, 14.5));
pane.add(btSearch, 0, 0);
pane.add(btEdit, 1, 0);
pane.add(btBack, 2, 0);
btEdit.setOnAction(event ->{
editScene(primaryStage);
});
btBack.setOnAction(event ->{
databaseChooser(primaryStage);
});
Scene scene = new Scene(pane, 500, 500);
primaryStage.setScene(scene);
}
public static void databaseChooser(Stage primaryStage) {
StackPane pane = new StackPane();
Button btFile = new Button("Choose Database File");
btFile.setOnAction(event -> {
openFileChooser(primaryStage);
mainMenu(primaryStage);
});
pane.getChildren().add(btFile);
Scene scene = new Scene(pane, 500, 500);
primaryStage.setScene(scene);
}
public static void editScene(Stage primaryStage) {
}
//Lists rows of buttons depending on the type of person selected
public static void peopleOptions(Stage primaryStage, String value) {
HBox box = new HBox();
Button btStudent = new Button("Student");
Button btFaculty = new Button("Faculty");
Button btStaff = new Button("Staff");
Button btEmployee = new Button("Employee");
Button btPerson = new Button("Person");
Button bt
Scene scene = new Scene(box, 500, 500);
primaryStage.setScene(scene);
primaryStage.setTitle(value);
primaryStage.show();
}
}
//C:Usersgtorr.eclipseGUIProjectdatabase_files
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team