Magazine
 
Quick Review:JavaFX
 
Advanced Examples to JavaFX

}
var passLabel=Label {
text: “LastName”
}
var submit = Button {
text: “Submit”
action: function() {
firstname = text1.text;
lastname = text2.text;
if(firstname.equals(“”) or lastname.equals(“”))
{
laberror.visible=true;
}
else
{
laberror.text=”Incorrect firstname or lastname !”;
laberror.visible=true;
}
if(firstname.equals(“Amit”) and lastname.equals(“Kumar”)){
loginFrame.visible=true;
}
}
}
var panel= FlowPanel{
content:[ submit,Button {
text: “Reset”
action: function() {
text1.text=””;
text2.text=””;
laberror.visible=false;
}
}
]
}
center: FlowPanel{
content:[ userLabel,
text1, passLabel , text2, laberror
]
}
bottom: panel
}
}

Output:

If we “Click” on submit button without filling proper entries that it will show message “Fill Up all entries properly”

Aug 2008 | Java Jazz Up | 50
 
previous
index
next
 
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,

58, 59, 60, 61, 62, 63 Download PDF