Code (Java):
Package softwaretest;
Import javafx.application.Application;
Import javafx.event.ActionEvent;
Import Javafx.event.EventHandler;
Import Javafx.scene.Scene;
Import Javafx.scene.control.Button;
Import Javafx.scene.control.TextField;
Import Javafx.scene.layout.AnchorPane;
Import Javafx.scene.text.Text;
Import Javafx.stage.Stage;
public class Lueluelue extends application{
public static void Main (string[] args) {
Application.launch (args);
}
public void Start (final stage stage) throws Exception {
Stage.settitle ("testing");
Final Anchorpane root = new Anchorpane ();
Final TextField input0 = new TextField ();
Final TextField input1 = new TextField ();
Final TextField input2 = new TextField ();
Final button button = New button ("click");
Final text Text1 = new text ("Please enter correctly");
Final text Text2 = new text ("correct");
Button.setonaction (New eventhandler<actionevent> () {
public void handle (ActionEvent arg0) {
for (int j = 0; J <= 2; j + +) {
String STRING0 = Input0.gettext ();
char [] str0 = String0.tochararray ();
if (j = = 0) {
STRING0 = Input0.gettext ();
STR0 = String0.tochararray ();
}
else if (j = = 1) {
STRING0 = Input1.gettext ();
STR0 = String0.tochararray ();
}
else{
STRING0 = Input2.gettext ();
STR0 = String0.tochararray ();
}
if (str0.length>0 && str0.length<7) {
int i = 0;
for (i = 0; i < str0.length; i + +) {
if ((str0[i]>= ' 0 ' && str0[i]<= ' 9 ') | |
(str0[i]>= ' A ' && str0[i]<= ' z ') | |
(str0[i]>= ' A ' && str0[i]<= ' Z ')) {
Continue
}
else{
Anchorpane.settopanchor (Text1, (double) 140);
Root.getchildren (). AddAll (Text1);
Stage.show ();
Break
}
}
if (i = = str0.length) {
if (j = = 2) {
Anchorpane.settopanchor (Text2, (double) 140);
Root.getchildren (). AddAll (Text2);
Stage.show ();
Break
}
Else
Break
}
}
else{
Anchorpane.settopanchor (Text1, (double) 140);
Root.getchildren (). AddAll (Text1);
Stage.show ();
Break
}
}
}
});
Anchorpane.settopanchor (Input0, (double) 40);
Anchorpane.settopanchor (INPUT1, (double) 80);
Anchorpane.settopanchor (Input2, (double) 120);
Anchorpane.settopanchor (button, (double) 170);
Root.getchildren (). AddAll (Input0,input1,input2,button);
Stage.setscene (New Scene (root,200,200));
Stage.show ();
}
}
Test:
What the DA!
Warmly celebrate the arrival of a small holiday in Qingming