1.0.4 • Published 3 years ago
jsoptionpane v1.0.4
JSOptionPane
Just JOptionPane but in JavaScript. Just for fun (It doesn't finish yet)
Table of Contents
- Methods
- Get user input
showMessageDialog
parameter : frame, message
Example:
const Dialog = require("JSOptionFrame");
const Window = new Dialog();
Window.showMessageDialog( null, "I love Chicken!" )
Output:
showConfirmDialog
parameter : frame, message
Example:
const Dialog = require("JSOptionFrame");
const Window = new Dialog();
Window.showConfirmDialog( null, "Do you love chicken?" ) ;
Output:
Return:
0 - User selected "Yes"
1 - User selected "No"
2 - User selected "Cancel"
showInputDialog
parameter : frame, message, initialSelectionValue
Example:
const Dialog = require("JSOptionFrame");
const Window = new Dialog();
Window.showInputmDialog( null, "Who is your Chick?", "Chicken" );
Output:
Return: UserInput
exit
Exit the program Example:
const Dialog = require("JSOptionPane");
const Window = new Dialog();
Window.showMessageDialog( null, "I like pizza" );
Window.exit();
Get user input
Example:
const Dialog = require("JSOptionPane");
const Window = new Dialog();
var loveChicken = Window.showConfirmDialog( null, "Do you love chicken?" );
switch(loveChicken) {
case 0:
Window.showMessageDialog( null, "Yeah! I love it too!" );
return Window.exit();
case 1:
Window.showMessageDialog( null, "Why?? Chicken is the best thing" );
return Window.exit();
case 2:
return Window.exit();
}