Warmly celebrate the arrival of a small holiday in Qingming

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.