all requierd methods implemented
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package workshop;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.Button;
|
||||
|
||||
@@ -17,25 +18,43 @@ public class Controller {
|
||||
@FXML
|
||||
private void buyBasic() {
|
||||
// TODO: Call showAlert() with a message indicating the user entered the payment gateway
|
||||
showAlert("Basic Plan Selected.");
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void buyPro() {
|
||||
// TODO: Call showAlert() with a message indicating the user entered the payment gateway
|
||||
showAlert("Pro Plan Selected.");
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void buyEnterprise() {
|
||||
// TODO: Call showAlert() with a message indicating the user entered the payment gateway
|
||||
showAlert("Enterprise Plan Selected.");
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void toggleTheme() {
|
||||
// TODO: Toggle the isDark flag. If dark, switch to style.css and set button text to "Switch to Light Mode"
|
||||
|
||||
isDark = !isDark;
|
||||
|
||||
themeToggle.getScene().getStylesheets().clear();
|
||||
if (isDark) {
|
||||
themeToggle.getScene().getStylesheets().add(getClass().getResource("light.css").toExternalForm());
|
||||
themeToggle.setText("Switch to Dark Mode");
|
||||
}
|
||||
// TODO: If light, switch to light.css and set button text to "Switch to Dark Mode"
|
||||
else {
|
||||
themeToggle.getScene().getStylesheets().add(getClass().getResource("style.css").toExternalForm());
|
||||
themeToggle.setText("Switch to Light Mode");
|
||||
}
|
||||
}
|
||||
|
||||
private void showAlert(String message) {
|
||||
// TODO: Create a new Alert of type INFORMATION with the given message and display it
|
||||
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
||||
alert.setHeaderText(message);
|
||||
alert.show();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user