CS 1425 Lecture Notes - Lecture 1: Javafx

11 views3 pages

Document Summary

1/14/2019: textarea control represented by the class javafx. scene. control. textarea. Textarea textarea = new textarea(): get text: String text = textarea. gettext(): getting text from textarea example: public class textareaexperiments extends application { @override public void start(stage primarystage) throws exception { //set title of the stage when javafx app starts primarystage. settitle("textarea experiment 1"); //create a new button with the text click to get text . Button button = new button("click to get text"); //set minimal width of button to 50 button. setminwidth(50); /*if button is clicked, show whatever text is in the textarea in the console. Then, display the text clicked! */ button. setonaction(action -> { //put the textarea and button on a new vbox. //add vbox to a new scene with height 200 and width 100. //set primarystate to the new scene before showing the scene primarystage. setscene(scene); primarystage. show(); public static void main(string[] args) { //set x position of stage to 50 stage. setx(50);

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents