Initial Knowledge dialog box

Source: Internet
Author: User

Dialogs are divided into: modal and modeless, patterns will mean blocking execution of other threads, indicating the importance of the operation

1. Message dialog box

belong to modal dialog box

Format: public static void Showmessagedialog (Component parentcomponent,string message,string title,int messageType)

parentcomponent specifies where the dialog box is visible, NULL indicates the front of the screen, and not empty indicates that the component is centered in front of the display

message specifies the content, title specifies the dialog box title

MessageType indicates the type of dialog box

Information_message message dialog box

Warning_message warning Dialog box

Error_message error dialog box

Question_message Problem dialog box

Plain_message Simple dialog box

  String str= jtextfield1.gettext ();             String regex= "[a-za-z]+";              if (Str.matches (regex)) {                 Joptionpane.showmessagedialog (this, "121212", "Sasasa", joptionpane.warning_message);             }              Else {                  joptionpane.showmessagedialog (null, "121212", "Sasasa",joptionpane.information _message);                  Jtextfield1.settext (null);             }

Initial Knowledge dialog box

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.