Question

In: Computer Science

Write a JavaFx program to create Forms as front end and JDBC as back end to...

Write a JavaFx program to create Forms as front end and JDBC as back end to store the data and retrieve the data.

Solutions

Expert Solution

JavaFx program to create form.

1.first create a gridpane layout

GridPane grid = new GridPane();
grid.setAlignment(Pos.CENTER);
grid.setHgap(10);
grid.setVgap(10);
grid.setPadding(new Insets(25, 25, 25, 25));

Scene scene = new Scene(grid, 300, 275);
primaryStage.setScene(scene);

2.set the grid padding property.

Text scenetitle = new Text("Welcome");
scenetitle.setFont(Font.font("Tahoma", FontWeight.NORMAL, 20));
grid.add(scenetitle, 0, 0, 2, 1);

Label userName = new Label("User Name:");
grid.add(userName, 0, 1);

TextField userTextField = new TextField();
grid.add(userTextField, 1, 1);

Label pw = new Label("Password:");
grid.add(pw, 0, 2);

PasswordField pwBox = new PasswordField();
grid.add(pwBox, 1, 2);

3. Add button, Text and button events.

Button btn = new Button("Sign in");
HBox hbBtn = new HBox(10);
hbBtn.setAlignment(Pos.BOTTOM_RIGHT);
hbBtn.getChildren().add(btn);
grid.add(hbBtn, 1, 4);
final Text actiontarget = new Text();
        grid.add(actiontarget, 1, 6);
btn.setOnAction(new EventHandler<ActionEvent>() {
 
    @Override
    public void handle(ActionEvent e) {
        actiontarget.setFill(Color.FIREBRICK);
        actiontarget.setText("Sign in button pressed");
    }
});

4. now run the application.


Related Solutions

Write a JavaFx program for addition of two numbers. (create text as Number1, Number2 and Result...
Write a JavaFx program for addition of two numbers. (create text as Number1, Number2 and Result and create 3 textfileds. Create sum button. You have to enter number1 and number2 in the textfileds. If you click the button Sum, the result will be showed in the third text field.
Write a Python program that: Create the algorithm in both flowchart and pseudocode forms for the...
Write a Python program that: Create the algorithm in both flowchart and pseudocode forms for the following requirements: Reads in a series of positive integers,  one number at a time;  and Calculate the product (multiplication) of all the integers less than 25,  and Calculate the sum (addition) of all the integers greater than or equal to 25. Use 0 as a sentinel value, which stops the input loop. [ If the input is 0 that means the end of the input list. ]...
Write a Java program (use JDBC to connect to the database) that implements the following function...
Write a Java program (use JDBC to connect to the database) that implements the following function (written in pseudo code): (20 points) CALL RECURSION ( GIVENP# ) ; RECURSION: PROC ( UPPER_P# ) RECURSIVE ; DCL UPPER_P# ... ; DCL LOWER_P# ... INITIAL ( ' ' ) ; EXEC SQL DECLARE C CURSOR FOR SELECT MINOR_P# FROM PART_STRUCTURE WHERE MAJOR_P# = :UPPER_P# AND MINOR_P# > :LOWER_P# ORDER BY MINOR_P# ; print UPPER_P# ; DO "forever" ; EXEC SQL OPEN C...
Create a JavaFX program in java that does the following items: Display a drawing area of...
Create a JavaFX program in java that does the following items: Display a drawing area of dimension 500 x 400, with a black background. Provides a radio button group to allow the user to select one of the following three colors: red, green, and blue. Upon startup, the red radio button should be selected. Each time the user clicks in the drawing area, a circle of size 10 of the color selected by the radio button group in item 2...
PROGRAM MUST BE WRITTEN IN JAVAFX Develop a program flowchart and then write a menu-driven Java...
PROGRAM MUST BE WRITTEN IN JAVAFX Develop a program flowchart and then write a menu-driven Java program that will solve the following problem. The program uses one and two-dimensional arrays to accomplish the tasks specified below. The menu is shown below. Please build a control panel as follows: (Note: the first letter is shown as bold for emphasis and you do not have to make them bold in your program.) Help SetParams FillArray DisplayResults Quit Upon program execution, the screen...
Assume that front end developers make $54.63 per hour and back end developers make $62.39 per...
Assume that front end developers make $54.63 per hour and back end developers make $62.39 per hour. Write a function (calcWeeklyPay) that will accept a developer type (1 for front end, 2 for back end), and number of hours worked per week as parameters and return the developer's weekly pay amount.
JAVAFX Create a JavaFx application that is an MP3 player. The size of the media player...
JAVAFX Create a JavaFx application that is an MP3 player. The size of the media player should be 800 pixels in width and 650 pixels in height. The media player should have a TextField that allows the user to type the full path of the .mp3 file to be played. The application should also use 2 Checkbox controls to show/hide the total playing time and the status (methods of MediaPlayer class). Use 2 RadioButton controls to change background colors (red...
A new advertising program involves placing small screens on the back of taxi front seats in...
A new advertising program involves placing small screens on the back of taxi front seats in order to run several advertisements continuously. The theory is that riders give their undivided attention to these ads during the entire trip. To understand the potential of the advertising program, advertisers would like to first learn about the length of time of taxi rides. Random samples of the taxi ride times (in minutes) in two cities were obtained. Please assume that the distributions are...
A new advertising program involves placing small screens on the back of taxi front seats in...
A new advertising program involves placing small screens on the back of taxi front seats in order to run several advertisements continuously. The theory is that riders give their undivided attention to these ads during the entire trip. To understand the potential of the advertising program, advertisers would like to first learn about the length of time of taxi rides. Random samples of the taxi ride times (in minutes) in two cities were obtained. Please assume that the distributions are...
Front-end load VS Back-end load I asked the professor which one is better and she said...
Front-end load VS Back-end load I asked the professor which one is better and she said that it depends on your time horizon. So, which one is better for short-term and why?? And which one is better for long-term and why??
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT