PROG24178 Lecture 12: Show Buttons in Java
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.