TextInputDemo.java - import import import import import...

This preview shows page 1 - 2 out of 2 pages.

import javafx.application.Application;import javafx.stage.Stage;import javafx.scene.Scene;import javafx.scene.layout.BorderPane;import javafx.scene.control.TextArea;import javafx.scene.control.TextField;import javafx.scene.control.Button;import javafx.scene.text.Font;import javafx.scene.text.FontWeight;import javafx.geometry.Insets;import javafx.geometry.Pos;/*** This program simply demonstrates using a TextField* and a TextArea.*/public class TextInputDemo extends Application {/* Define TextArea and TextField as instance variables* so they can be used throughout the program.Not needed* in this program, but fairly typical in more complex* programs.*/private TextArea contentInput;private TextField titleInput;/*** Start method builds the GUI and shows the window.*/public void start(Stage stage) {String title = "A Poem";// Initial text for TextField.String content =// Initial text for TextArea"So, naturalists observe, a flea\n"+ "Has smaller fleas that on him prey;\n"+ "And these have smaller still to bite 'em;\n"+ "

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 2 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Winter
Professor
curtis vince
Tags

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture