About javaswing Single box multi-box parameter get

Source: Internet
Author: User
Tags gettext

Jtextarea1.append (Jcombobox1.getselecteditem (). toString () + "+jtextfield1.gettext () +" Hello! \ n "+" you submit personal information as follows \ n "+" gender "+a+" \ n like star "+c+d+e+f+g+h+" \ n "

Inside the core content as above

About radio buttons, using if to determine

String A; if (Jradiobutton1.isselected ()) {// Radio box content gets, good bull than a=jradiobutton1.gettext ();} Else {A=jradiobutton2.gettext ();}

But there's a simpler statement.

Jradiobutton1.isselected ()? Jradiobutton1.gettext (): Jradiobutton2.gettext ()

About the multi-select button, you can use the array to determine the batch, but the use of the stupid method, it is a pity

String c= ""; String D=""; String e=""; String F=""; String g=""; String h=""; if(Jcheckbox1.isselected ()) {//There is no way to find a group of methodsC=jcheckbox1.gettext ();}if(jcheckbox2.isselected ()) {D=jcheckbox2.gettext ();}if(jcheckbox3.isselected ()) {e=jcheckbox3.gettext ();}if(jcheckbox4.isselected ()) {f=jcheckbox4.gettext ();}if(jcheckbox5.isselected ()) {g=jcheckbox5.gettext ();}if(jcheckbox6.isselected ()) {h=jcheckbox6.gettext ();} 
View Code

About javaswing Single box multi-box parameter get

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.