IN JAVA FxGUI PLEASE!!!! This is the third time im submiting the same question,
ID: 2246391 • Letter: I
Question
IN JAVA FxGUI PLEASE!!!! This is the third time im submiting the same question, please in JAVA FxGUI PLEASE
Select one favorite application of yours (in e-commence, education, games, and so on). Design a Java FxGUI for a "customer" to access the application of your design. the application of your design. 1. Makes sure you have sufficient components (2 or more buttons, text fields/areas, a selection list, 1 or more images and other optional components of your choice). In addition, add an "account" information so that a customer/user may access or utilize the application. Your GUI application shall also allow the customer/user information be entered on the screen. 2. Plan your layout and arrange them into groups when appropriate. 3. Implement your design in Java FxGUI.
CODE IN JAVA FxGUI PLEASE!!!!
Explanation / Answer
package javafxapplication2;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
import javafx.scene.text.Text;
public class JavaFXApplication2 extends Application {
public static void main(String[] args) {
launch(args);
}
private ImageView imageview;
@Override
public void start(Stage primaryStage) {
GridPane grid = new GridPane();
grid.setAlignment(Pos.CENTER);
grid.setHgap(20);
grid.setVgap(20);
imageview=new ImageView();
imageview.setFitHeight(50);
imageview.setFitWidth(100);
Image img=new Image("file:src/images/icon1.png");
imageview.setImage(img);
grid.add(imageview, 1, 1);
Label userNameLbl = new Label("User Name");
grid.add(userNameLbl, 0, 2);
TextField userNameTextField = new TextField();
grid.add(userNameTextField, 1, 2);
Label passLbl = new Label("Password");
grid.add(passLbl, 0, 3);
PasswordField password = new PasswordField();
grid.add(password, 1, 3);
Button btnLogin = new Button("LogIn Button");
HBox loginBox = new HBox(10);
loginBox.getChildren().add(btnLogin);
grid.add(loginBox, 1, 5);
final Text messageTxt = new Text();
grid.add(messageTxt, 1, 6);
btnLogin.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent e) {
messageTxt.setText("Logged In Successfully!!!");
}
});
Scene scene = new Scene(grid, 500, 300);
primaryStage.setScene(scene);
primaryStage.show();
}
}