PROG24178 Lecture 12: Show Buttons in Java

186 views3 pages

Document Summary

* to change this license header, choose license headers in project properties. * to change this template file, choose tools | templates. * and open the template in the editor. package textexample; import javafx. application. application; import javafx. scene. scene; import javafx. scene. control. button; import javafx. scene. control. label; import javafx. scene. control. textarea; import javafx. scene. layout. borderpane; //import javafx. scene. layout. stackpane; import javafx. stage. stage; public class textexample extends application { private borderpane pane;//the borderpane field var private label lblshow;//this is the label field var private button btnshow;//button show field var private textarea txtshow;//text area field var. @override public void start(stage primarystage) { btnshow = new button(show); btnshow. settext(show); btnshow. setonaction((e)-> {//set the buttonshow on action to the event handler. // string text=txtshow. gettext(); lblshow. settext(txtshow. gettext());//set the text for the label to the text in textshow. });//end bracket and the other round bracket with semicolon pane = new borderpane();//add a borderpane object called pane lblshow=new label(show);//label object called lblshow with caption show in top pane.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Questions