set various files including 'Settings Window' and light & dark themes in CSS, rename BrickLogClient : BrickLogClientApplication
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
package com.example.bricklog.view;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.RadioButton;
|
||||
import javafx.scene.control.Slider;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.control.TabPane;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.ToggleGroup;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class SettingsWindow extends Application {
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) {
|
||||
primaryStage.setTitle("Settings");
|
||||
|
||||
// Create a TabPane for organizing settings
|
||||
TabPane tabPane = new TabPane();
|
||||
|
||||
// Tab 1: Display Settings
|
||||
Tab displayTab = new Tab("Display Settings");
|
||||
displayTab.setContent(createDisplaySettingsContent());
|
||||
displayTab.setClosable(false);
|
||||
|
||||
// Tab 2: Server Settings
|
||||
Tab serverTab = new Tab("Server Settings");
|
||||
serverTab.setContent(createServerSettingsContent());
|
||||
serverTab.setClosable(false);
|
||||
|
||||
tabPane.getTabs().addAll(displayTab, serverTab);
|
||||
|
||||
// Set up the scene
|
||||
VBox vbox = new VBox(tabPane);
|
||||
Scene scene = new Scene(vbox, 400, 300);
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
private GridPane createDisplaySettingsContent() {
|
||||
GridPane grid = new GridPane();
|
||||
grid.setPadding(new Insets(10));
|
||||
grid.setVgap(10);
|
||||
grid.setHgap(10);
|
||||
|
||||
// Font Size Adjuster
|
||||
Label fontSizeLabel = new Label("Font Size:");
|
||||
Slider fontSizeSlider = new Slider(10, 30, 14);
|
||||
fontSizeSlider.setShowTickLabels(true);
|
||||
fontSizeSlider.setShowTickMarks(true);
|
||||
|
||||
// Dark/Light Mode Toggle
|
||||
Label themeLabel = new Label("Theme:");
|
||||
ToggleGroup themeGroup = new ToggleGroup();
|
||||
RadioButton lightMode = new RadioButton("Light");
|
||||
RadioButton darkMode = new RadioButton("Dark");
|
||||
lightMode.setToggleGroup(themeGroup);
|
||||
darkMode.setToggleGroup(themeGroup);
|
||||
lightMode.setSelected(true);
|
||||
|
||||
grid.add(fontSizeLabel, 0, 0);
|
||||
grid.add(fontSizeSlider, 1, 0);
|
||||
grid.add(themeLabel, 0, 1);
|
||||
grid.add(lightMode, 1, 1);
|
||||
grid.add(darkMode, 2, 1);
|
||||
|
||||
return grid;
|
||||
}
|
||||
|
||||
private GridPane createServerSettingsContent() {
|
||||
GridPane grid = new GridPane();
|
||||
grid.setPadding(new Insets(10));
|
||||
grid.setVgap(10);
|
||||
grid.setHgap(10);
|
||||
|
||||
// Server IP
|
||||
Label ipLabel = new Label("Server IP:");
|
||||
TextField ipField = new TextField();
|
||||
|
||||
// Authentication Token
|
||||
Label authLabel = new Label("Auth Token:");
|
||||
PasswordField authField = new PasswordField();
|
||||
|
||||
grid.add(ipLabel, 0, 0);
|
||||
grid.add(ipField, 1, 0);
|
||||
grid.add(authLabel, 0, 1);
|
||||
grid.add(authField, 1, 1);
|
||||
|
||||
return grid;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user