Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package com.dlsc.gemsfx.demo;
import com.dlsc.gemsfx.DialogPane;
import com.dlsc.gemsfx.DialogPane.Dialog;
import fr.brouillard.oss.cssfx.CSSFX;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.binding.Bindings;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonBar;
import javafx.scene.control.ButtonType;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
import javafx.util.Duration;
import javafx.util.StringConverter;
import org.scenicview.ScenicView;
import java.util.List;
import java.util.Objects;
import java.util.prefs.Preferences;
import static com.dlsc.gemsfx.DialogPane.Type.INFORMATION;
public class DialogPaneApp extends Application {
@Override
public void start(Stage primaryStage) {
DialogPane dialogPane = new DialogPane();
Button blankButton = new Button("Blank");
blankButton.setOnAction(evt -> {
Dialog dialog = new Dialog<>(dialogPane, DialogPane.Type.BLANK);
dialog.setResizable(true);
dialog.setId("blank.dialog");
dialog.setPreferences(Preferences.userNodeForPackage(DialogPaneApp.class).node(dialog.getId()));
dialog.setContentAlignment(Pos.CENTER);
Label content = new Label("Content");
content.setAlignment(Pos.CENTER);
content.setPrefSize(400, 300);
content.setMinSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE);
content.setOnMouseClicked(e -> dialog.cancel());
dialog.setContent(content);
dialog.show();
});
Button infoButton = new Button("Info");
infoButton.setOnAction(evt -> {
Dialog dialog = dialogPane.showInformation("Information Dialog Title", "Just some plain old information folks, which can actually be a very long text and we want to make sure it wraps.");
dialog.setResizable(true);
});
Button warnButton = new Button("Warning");
warnButton.setOnAction(evt -> dialogPane.showWarning("Warning Title", "A warning message is not so bad, errors are worse. Especially when the errors are runtime exceptions of the worst kind."));
Button errorButton = new Button("Error");
errorButton.setOnAction(evt -> dialogPane.showError("Error Title", "Error dialog message that can be somewhat longer but that is kind of important because the uer has to take errors very seriously.\n\nSome errors might be so bad that the application needs to be restarted because the process ran out of memory or a heap dump was produced somewhere."));
Button errorWithDetailsButton = new Button("Error with details");
errorWithDetailsButton.setOnAction(evt -> dialogPane.showError("Error Title", "Error dialog message that can be somewhat longer", "But that is kind of important because the uer has to take errors very seriously.\n\nSome errors might be so bad that the application needs to be restarted because the process ran out of memory or a heap dump was produced somewhere."));
Button errorWithExceptionButton = new Button("Error with exception");
errorWithExceptionButton.setOnAction(evt -> dialogPane.showError("Error Title", "Error dialog message that can be somewhat longer", new NullPointerException("A fake null pointer exception.")));
Button confirmButton = new Button("Confirmation");
confirmButton.setOnAction(evt -> dialogPane.showConfirmation("Confirmation Title", "A confirmation requires the user to decide."));
Button inputSingleLineButton = new Button("Input");
inputSingleLineButton.setOnAction(evt -> {
Dialog dialog = dialogPane.showTextInput("Text Input", "Please enter something, anything really.", "Text already there ...", false);
dialog.setRequired(true);
});
Button inputMultiLineButton = new Button("Input Multi");
inputMultiLineButton.setOnAction(evt -> {
Dialog dialog = dialogPane.showTextInput("Multiline Text Input", "Please enter something, anything really.", "Text already there ...", true);
dialog.setRequired(true);
});
Button node1Button = new Button("Node 1");
node1Button.setOnAction(evt -> {
Dialog