Code Monkey home page Code Monkey logo

ajaquet / magicdialog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from magiclen/magicdialog

0.0 1.0 0.0 5.12 MB

MagicDialog is a Java library used for creating dialogs quickly in JavaFX applications. It supports alert(information, warning, confirmation, error) dialogs, input dialogs and choice dialogs. In addition, MagicDialog includes MagicAudioPlayer to produce sound when the dialog is shown.

Home Page: https://magiclen.org/javafx-dialog/

Java 100.00%

magicdialog's Introduction

MagicDialog

Introduction

MagicDialog is a Java library used for creating dialogs quickly in JavaFX applications. It supports alert(information, warning, confirmation, error) dialogs, input dialogs and choice dialogs. In addition, MagicDialog includes MagicAudioPlayer to produce sound when the dialog is shown.

Usage

Dialogs class

Dialogs class is in the org.magiclen.magicdialog package. It can help you create an alert dialog quickly.

Initialize

To create an Dialog instance, you can use the static method create in Dialogs class and make some settings before you show it.

Here is an example to create and show an alert dialog,

Dialogs.create()
        .addButton("Yes", null)
        .addButton("No", () -> {
            Platform.exit(); // Exit this problem.
        })
        .audio(DialogAudio.COCOCO)
        .fontSize(15)
        .owner(primaryStage)
        .message("If you don't want to continue, this application will be stopped.")
        .header("Do you want to continue?")
        .title("Hint")
        .type(Dialogs.Type.QUESTION)
        .showAndWait();

You don't need to set up all the options.

InputDialogs class

InputDialogs class is in the org.magiclen.magicdialog package. It can help you create an input dialog quickly.

Initialize

To create an Dialog instance, you can use the static method create in InputDialogs class and make some settings before you show it.

Here is an example to create and show an input dialog,

final String inputText = InputDialogs.create()
        .audio(DialogAudio.DIN)
        .fontSize(15)
        .owner(primaryStage)
        .message("Input your name:")
        .header("What is your name?")
        .title("Input")
        .text("Magic Len")
        .showAndWait();

Again, you don't need to set up all the options.

DoubleInputDialogs class

DoubleInputDialogs class is in the org.magiclen.magicdialog package. It can help you create an input dialog quickly. In comparison with InputDialogs class, DoubleInputDialogs class can allow user to input two rows of data but InputDialogs class cannot.

Initialize

To create an Dialog instance, you can use the static method create in DoubleInputDialogs class and make some settings before you show it.

Here is an example to create and show an input dialog,

final String[] inputText = DoubleInputDialogs.create()
        .audio(DialogAudio.DIN)
        .fontSize(15)
        .fontFamily("Noto Sans TC Regular")
        .owner(primaryStage)
        .message("Input your name:", "Input your website:")
        .header("What is your name?")
        .title("Input")
        .text("Magic Len", "magiclen.org")
        .showAndWait();

Again, you don't need to set up all the options.

ChoiceDialogs class

ChoiceDialogs class is in the org.magiclen.magicdialog package. It can help you create a choice dialog quickly.

Initialize

To create an Dialog instance, you can use the static method create in ChoiceDialogs class and make some settings before you show it.

Here is an example to create and show a choice dialog,

final String choose = ChoiceDialogs.create()
        .audio(DialogAudio.DEFAULT)
        .fontSize(15)
        .owner(primaryStage)
        .message(null)
        .header("How many people are in your family?")
        .title("Choose")
        .options("One", "Two", "Three", "Four", "Five")
        .defaultOption("Three")
        .showAndWait();

Again, you don't need to set up all the options.

SimpleProgressDialogs class

SimpleProgressDialogs class is in the org.magiclen.magicdialog package. It can help you create a simple progress dialog quickly.

To create an SimpleProgressDialog instance, you can use the static method create in SimpleProgressDialogs class and make some settings before you show it.

Here is an example to create and show a simple progress dialog,

Initialize

SimpleProgressDialogs.create()
        .audio(DialogAudio.DEFAULT)
        .fontSize(20)
        .owner(primaryStage)
        .message("Please wait...")
        .showAndWait();

Again, you don't need to set up all the options.

License

Copyright 2015-2017 magiclen.org

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

What's More?

Please check out our web page at

https://magiclen.org/javafx-dialog/

magicdialog's People

Contributors

magiclen avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.