Question: Please add the code to include a small image at the top of the form of this JavaFX GUI(modify code as necessary): Band.java import javafx.application.Application;
Please add the code to include a small image at the top of the form of this JavaFX GUI(modify code as necessary):
Band.java
import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.geometry.Insets; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.scene.layout.GridPane; import javafx.stage.Stage;
public class Band extends Application { final Alert a = new Alert(Alert.AlertType.NONE); final Label brandNameLbl = new Label("Name of Band: "); final RadioButton sample1 = new RadioButton("Sample 1"); final RadioButton sample2 = new RadioButton("Sample 2"); final CheckBox tus = new CheckBox("Tuesday"); final CheckBox fri = new CheckBox("Friday"); final CheckBox sat = new CheckBox("Saturday"); final Label numOfBundlesLbl = new Label("Sample sound clips of songs "); final TextField brandTxt = new TextField(""); final TextField brandPageTxt = new TextField(""); final TextField cont1Txt = new TextField(); final TextField cont2Txt = new TextField(); final Button submitBtn = new Button("Submit Audition"); final Button clearBtn = new Button("Clear form"); final Button extlBtn = new Button("Exit"); final Label totalPayLbl = new Label("Net Compensation:"); int rowStart = 5; int rowDiff = 2;
public static void main(String[] args) { launch(args); }
@Override public void start(Stage stage) { stage.setTitle("Band Info"); Scene scene = new Scene(new Group(), 600, 500);
GridPane grid = new GridPane(); grid.setVgap(4); grid.setHgap(10); grid.setPadding(new Insets(5, 5, 5, 5)); grid.add(brandNameLbl, 0, rowStart); grid.add(brandTxt, 1, rowStart);
rowDiff += rowDiff; grid.add(new Label("Band website or facebook page"), 0, rowStart+rowDiff); grid.add(brandPageTxt, 1, rowStart+rowDiff);
rowDiff += rowDiff; grid.add(numOfBundlesLbl, 0, rowStart + rowDiff); grid.add(sample1, 1, rowStart + rowDiff);
rowDiff += 1;
grid.add(sample2, 1, rowStart + rowDiff);
rowDiff += rowDiff; grid.add(new Label("Days of week youy are typically available for playing"), 0, rowStart + rowDiff); grid.add(tus, 1, rowStart + rowDiff); rowDiff += 1; grid.add(new Label("(check all that apply)"), 0, rowStart + rowDiff); grid.add(fri, 1, rowStart + rowDiff); rowDiff += 1; grid.add(sat, 1, rowStart + rowDiff);
rowDiff += 3; grid.add(new Label("Contact Name "), 0, rowStart + rowDiff); grid.add(cont1Txt, 1, rowStart + rowDiff); rowDiff += 1; grid.add(new Label("Contact Phone "), 0, rowStart + rowDiff); grid.add(cont2Txt, 1, rowStart + rowDiff); rowDiff += 3;
submitBtn.setMinWidth(150); grid.add(submitBtn, 0, rowStart + rowDiff); clearBtn.setMinWidth(150); grid.add(clearBtn, 1, rowStart + rowDiff); extlBtn.setMinWidth(100); grid.add(extlBtn, 2, rowStart + rowDiff);
totalPayLbl.setVisible(false); sample1.setOnAction(new EventHandler
submitBtn.setOnAction(new EventHandler
extlBtn.setOnAction(new EventHandler
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
