Skip to content

Instantly share code, notes, and snippets.

@IAMIronmanSam
Created October 30, 2012 17:56
Show Gist options
  • Save IAMIronmanSam/3981868 to your computer and use it in GitHub Desktop.
Save IAMIronmanSam/3981868 to your computer and use it in GitHub Desktop.
Login
/*
* Copyright (c) 2012, JUGChennai
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name Visage nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package in.jugchennai.sangam12.login;
import visage.javafx.stage.Stage;
import visage.javafx.scene.Group;
import visage.javafx.scene.Scene;
import visage.javafx.scene.effect.*;
import visage.javafx.scene.layout.*;
import visage.javafx.scene.control.Button;
import visage.javafx.scene.control.Label;
import visage.javafx.scene.control.TextField;
import visage.javafx.scene.control.PasswordField;
import visage.javafx.scene.image.Image;
import visage.javafx.scene.image.ImageView;
import visage.javafx.scene.text.*;
import visage.lang.Color.*;
import java.lang.System;
var uname:TextField ;
var pword:PasswordField ;
var status:Label;
var username:TilePane;
var password:TilePane;
var button:TilePane;
/**
*
* @author Arivazhagan Ambigapathy ([email protected])
*/
Stage {
title: "Login"
Scene {
width: 500
height: 400
fill: Color.WHITE
getStylesheets().setAll("{__DIR__}style.css");
def visage = Image { url: "{__DIR__}Visage1.JPG" };
def jugc = Image { url: "{__DIR__}jugc.png" };
VBox {
10
children: [
Text {
text: "VisageFX"
fill: PURPLE
font: Font.font("SansSarif", javafx.scene.text.FontWeight.BOLD, 40)
effect: Glow {
level: 1.0
}
}
username=TilePane{
children:
[
Label{
text: "Username"
wrapText: true
textFill: Color.BLACK
effect: Glow {
level: 1.0
}
}
uname=TextField{
prefColumnCount:5
}
]}
password=TilePane{
children:
[
Label{
text: "Password"
wrapText: true
textFill: Color.BLACK
effect: Glow {
level: 1.0
}
}
pword=PasswordField{
prefColumnCount:5
}]
}
button=TilePane{
children:
[
Button {
text: "Login"
onAction: function(e){
println("The button is clicked");
if(uname.text !="")
{
println("Thank u");
status.visible=true
}
}
}
Button {
text: "Exit"
onAction: function(e){
System.exit(0)
}
}
]
}
status=Label{
text: "Your Are Logged In"
wrapText: true
textFill: Color.BLACK
font: Font.font("SansSarif", javafx.scene.text.FontWeight.BOLD, 30)
visible:false
effect: Glow {level: 1.0}
}
ImageView {
visage
fitWidth: 305
preserveRatio: true
}
ImageView {
jugc
fitWidth: 150
fitHeight:150
preserveRatio: true
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment