Skip to content

Instantly share code, notes, and snippets.

@IAMIronmanSam
Created October 17, 2012 17:03
Show Gist options
  • Save IAMIronmanSam/3906741 to your computer and use it in GitHub Desktop.
Save IAMIronmanSam/3906741 to your computer and use it in GitHub Desktop.
Login App
package visage.javafx.scene.effect;
import visage.animation.Interpolator;
import visage.animation.Timeline;
import visage.javafx.geometry.Rectangle2D;
import visage.javafx.stage.Stage;
import visage.javafx.scene.Group;
import visage.javafx.scene.Scene;
import visage.javafx.scene.effect.*;
import visage.javafx.scene.control.Button;
import visage.javafx.scene.control.Label;
import visage.javafx.scene.control.TextField;
import visage.javafx.scene.image.Image;
import visage.javafx.scene.image.ImageView;
import visage.javafx.scene.text.*;
import visage.javafx.scene.shape.Rectangle;
import visage.lang.Color.*;
//var position = 100;
/*Timeline {
at (10s) {position => 150 tween Interpolator.LINEAR}
}.play();*/
var uname:TextField ;
var pword:TextField ;
Stage {
title: "Login"
Scene {
width: 500
height: 400
fill: Color.WHITE
def visage = Image { url: "{__DIR__}Visage1.jpg" }
def jugc = Image { url: "{__DIR__}jugc.png" }
Group {
[
Text {
text: "VisageFX"
fill: PURPLE
x: 92
y: 37
font: Font.font("SansSarif", javafx.scene.text.FontWeight.BOLD, 40)
effect: Glow {
level: 1.0
}
}
Label{
text: "Username"
wrapText: true
textFill: Color.BLACK
layoutX: 127
layoutY: 96
effect: Glow {
level: 1.0
}
}
Label{
text: "Password"
wrapText: true
textFill: Color.BLACK
layoutX: 135
layoutY: 150
effect: Glow {
level: 1.0
}
}
uname=TextField{
layoutX: 254
layoutY:90
prefColumnCount:20
}
pword=TextField{
layoutX: 254
layoutY:150
prefColumnCount:20
}
/*Text{text:"Username:" x: 127 y: 96 }
Text{text:"Password:" x: 135 y: 150 }*/
Button {
text: "Login"
layoutX: 236
layoutY: 200
onAction: function(e){
println("The button is clicked");
if(uname.text !="")
{
println("Thank u");
}
}
/*layoutX: bind position
layoutY: bind 80 + position*/
}
ImageView {
visage
fitWidth: 305
preserveRatio: true
layoutY: 300
layoutX:180
}
ImageView {
jugc
fitWidth: 150
fitHeight:150
preserveRatio: true
layoutY:240
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment