From the course: Learning NetBeans

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Add a button and text

Add a button and text

From the course: Learning NetBeans

Start my 1-month free trial

Add a button and text

- [Instructor] The final two controls required for the application are a button control for submitting the data and a text control for displaying a message when the user presses the button. Right on line 61, I will paste in the necessary code. (keyboard clacking) For our objective here, adding the button and text, we first create the button and position it on the bottom right, which is a common place for our buttons that perform an action affecting the entire form. Here, the first line, which is specifically on line 62, we create a button named btn with the label Sign in, and the second line creates an HBox layout pane named hbbtn with spacing of 10 pixels. Now, this HBox pane sets an alignment for the buttons that is different from the alignment applied to the other controls in the grid pane. Now, you can see on line 64, the alignment property has a value of bottom right, which positions a node at the bottom of the space vertically and at the right edge of the space horizontally. On…

Contents