r/JavaFX • • Jan 21 '25

Help java market application in javaFX

0 Upvotes

I'm working on developing an application that helps manage store items efficiently and visually represents the data using a pie chart. The goal is to make it easier to track inventory, analyze stock distribution, and gain insights into sales or product categories. I've already experimented with some functions, but I'm still refining the implementation to ensure accuracy and usability.


r/JavaFX • • Oct 15 '25

I made this! It's a shame that java does not have a webview app builder like electron

Thumbnail x.com
0 Upvotes

We can complain as much as we want, but html/css/js is the best way to make ui these days.

A guy on x made a "electron" but for java, and it's funny now that I think of it. JavaScript -> electron Golang -> wails Rust -> tauri

All these are production ready frameworks but java does not have one yet...


r/JavaFX • • Nov 03 '17

Why does Hello World Program take 80MB in JavaFX?

0 Upvotes

I just found out that JavaFX take 80MB [RAM] just for hello world program? Why? Not only it is extremely inefficient it is just plan horrible!


r/JavaFX • • May 26 '19

What can you say about Flutter which now supports development for mobile, desktop, web and embedded?

Thumbnail
flutter.dev
0 Upvotes

r/JavaFX • • Jun 23 '22

Tutorial JavaFX Buttons

Thumbnail
codewithedward.com
0 Upvotes

r/JavaFX • • Jun 24 '18

JavaFx needs system notification API!!

2 Upvotes

No matter Android app or Windows app,they can notifiy.Fx needs it


r/JavaFX • • Nov 12 '21

How I got 100 GitHub stars on a Javafx project

0 Upvotes

r/JavaFX • • Aug 03 '25

I made this! Hello World!

Post image
0 Upvotes

JAVA


r/JavaFX • • Aug 27 '24

Help what is difficulty of building Point Of Sale system using Java FX ?

1 Upvotes

r/JavaFX • • Dec 30 '22

Help How do i convert html file to pdf file using java(fx)?

1 Upvotes

Hey guys, i have school project called cv generator i wonder if you have any ideas how can i convert html file to pdf file. I made lots of resarches but none of them helped me. I am making this project by using javafx.


r/JavaFX • • Apr 29 '23

Help Blank JavaFX GUI

1 Upvotes

Need help debugging my code for my final, it's only coming up with a blank GUI window

import javafx.application.Application;
import javafx.application.Platform;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextInputDialog;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
public class JIMachine extends Application {
private ImageView imageView;
private Button originalSizeButton;
private Button zoomOutButton = new Button("Zoom Out");
private Button openButton;
private Button nextButton;
private Button prevButton;
private Button thumbnailButton;
private Button captionButton;
private Button saveButton; // New save button
private List<File> album;
private int currentImageIndex;
private VBox thumbnailPane;
private String currentCaption;
private File currentFile = new File("path/to/file");
public JIMachine() {
}

u/Override
public void start(Stage stage) {
// Initialize UI components
imageView = new ImageView();
imageView.setPreserveRatio(false);
Button zoomInButton = new Button("Zoom In");
originalSizeButton = new Button("100%");
zoomOutButton = new Button("Zoom Out");
openButton = new Button("Open");
nextButton = new Button("Next");
prevButton = new Button("Previous");
thumbnailButton = new Button("Thumbnails");
captionButton = new Button("Caption");
saveButton = new Button("Save Album");
Button openAlbumButton = new Button("Open Album");
thumbnailPane = new VBox(10);
album = getCurrentDirectoryFiles();
currentImageIndex = 0;
// Set event handlers
zoomInButton.setOnAction(event -> zoomImage(1.25));
originalSizeButton.setOnAction(event -> setOriginalSize());
zoomOutButton.setOnAction(event -> zoomImage(0.8));
openButton.setOnAction(event -> openImage(stage));
nextButton.setOnAction(event -> showNextImage());
prevButton.setOnAction(event -> showPrevImage());
thumbnailButton.setOnAction(event -> showThumbnails());
captionButton.setOnAction(event -> setCaption());
saveButton.setOnAction(event -> saveAlbum(stage));
openAlbumButton.setOnAction(event -> openAlbum(stage));
HBox buttonPane = new HBox(10, openButton, zoomInButton, originalSizeButton, zoomOutButton, prevButton, nextButton, thumbnailButton, captionButton, saveButton, openAlbumButton);
HBox newButtonPane = new HBox(10, openButton, zoomInButton, originalSizeButton, zoomOutButton, prevButton, nextButton, thumbnailButton, captionButton, saveButton, openAlbumButton);
newButtonPane.setPadding(new Insets(10));
newButtonPane.setAlignment(Pos.CENTER);
// Add components to root pane
BorderPane root = new BorderPane();
root.setCenter(imageView);
root.setBottom(buttonPane);
// Set initial button states
updateButtonStates();
// Display default image
Image image = new Image("file:///path/to/image.jpg");
ImageView imageView = new ImageView(image);
// Create scene and show stage
Scene scene = new Scene(root, 800, 600);
stage.setScene(scene);
stage.setTitle("JIMachine");
stage.show();
}

private List<File> getCurrentDirectoryFiles() {
File currentDirectory = new File(".");
File[] files = currentDirectory.listFiles((dir, name) -> name.matches(".*\\.(jpg|jpeg|png|gif)$"));
if (files != null) {
return Arrays.asList(files);
}
return new ArrayList<>();
}
private void openImage(Stage stage) {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Open Image File");
fileChooser.getExtensionFilters().addAll(
new FileChooser.ExtensionFilter("Image Files", "*.png", "*.jpg", "*.jpeg", "*.gif")
);
File selectedFile = fileChooser.showOpenDialog(stage);
if (selectedFile != null) {
currentFile = selectedFile;
currentImageIndex = album.indexOf(currentFile);
displayImage(currentFile);
}
updateButtonStates();
}

private void showNextImage() {
if (currentImageIndex < album.size() - 1) {
currentImageIndex++;
currentFile = album.get(currentImageIndex);
displayImage(currentFile);
}
updateButtonStates();
}
private void openAlbum(Stage stage) {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Open Album");
fileChooser.getExtensionFilters().addAll(
new FileChooser.ExtensionFilter("Image Files", "*.png", "*.jpg", "*.jpeg", "*.gif")
);
List<File> selectedFiles = fileChooser.showOpenMultipleDialog(stage);
if (selectedFiles != null) {
album.addAll(selectedFiles);
currentImageIndex = album.size() - 1;
currentFile = album.get(currentImageIndex);
displayImage(currentFile);
updateButtonStates();
}
}

private void showPrevImage() {
if (currentImageIndex > 0) {
currentImageIndex--;
currentFile = album.get(currentImageIndex);
displayImage(currentFile);
}
updateButtonStates();
}

private void showThumbnails() {
if (thumbnailPane.getChildren().isEmpty()) {
thumbnailPane.getChildren().addAll(album.stream()
.map(file -> {
ImageView thumbView = new ImageView(new Image(file.toURI().toString()));
thumbView.setFitHeight(50);
thumbView.setPreserveRatio(true);
thumbView.setOnMouseClicked(event -> {
currentFile = file;
currentImageIndex = album.indexOf(currentFile);
displayImage(currentFile);
updateButtonStates();
});
return thumbView;
})
.toList());
} else {
thumbnailPane.getChildren().clear();
}
}

private void setCaption() {
TextInputDialog dialog = new TextInputDialog(currentCaption);
dialog.setTitle("Caption");
dialog.setHeaderText(null);
dialog.setContentText("Enter caption:");
Optional<String> result = dialog.showAndWait();
if (result.isPresent()) {
currentCaption = result.get();
displayImage(currentFile);
}
}

private void zoomImage(double zoomFactor) {
imageView.setScaleX(imageView.getScaleX() * zoomFactor);
imageView.setScaleY(imageView.getScaleY() * zoomFactor);
updateButtonStates();
}

private void setOriginalSize() {
imageView.setScaleX(1.0);
imageView.setScaleY(1.0);
updateButtonStates();
}

private void updateButtonStates() {
nextButton.setDisable(currentImageIndex == album.size() - 1);
prevButton.setDisable(currentImageIndex == 0);
thumbnailButton.setText(thumbnailPane.getChildren().isEmpty() ? "Thumbnails" : "Hide Thumbnails");
captionButton.setText(currentCaption == null ? "Caption" : "Edit Caption");
saveButton.setDisable(album.isEmpty()); // Disable save button if album is empty
}

private void displayImage(File file) {
try {
Image image = new Image(file.toURI().toString());
imageView.setImage(image);
} catch (Exception ex) {
System.err.println("Failed to display image: " + ex.getMessage());
}
}

private void saveAlbum(Stage stage) {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Save Album");
fileChooser.getExtensionFilters().addAll(
new FileChooser.ExtensionFilter("Text Files", "*.txt")
);
File selectedFile = fileChooser.showSaveDialog(stage);
if (selectedFile != null) {
try (BufferedWriter writer = Files.newBufferedWriter(selectedFile.toPath())) {
for (File file : album) {
writer.write(file.getAbsolutePath());
writer.newLine();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}

private void loadAlbum(Stage stage) {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Load Album");
fileChooser.getExtensionFilters().addAll(
new FileChooser.ExtensionFilter("Text Files", "*.txt")
);
File selectedFile = fileChooser.showOpenDialog(stage);
if (selectedFile != null) {
List<File> files = new ArrayList<>();
try (BufferedReader reader = Files.newBufferedReader(selectedFile.toPath())) {
String line;
while ((line = reader.readLine()) != null) {
File file = new File(line);
if (file.exists() && !files.contains(file)) {
files.add(file);
}
}
} catch (IOException e) {
e.printStackTrace();
}
if (!files.isEmpty()) {
album.clear();
album.addAll(files);
currentImageIndex = 0;
currentFile = album.get(0);
displayImage(currentFile);
updateButtonStates();
}
}
}

private void exitApplication() {
Platform.exit();
}

public static void main(String[] args) {
launch(args);
}

}


r/JavaFX • • Nov 22 '25

Discussion This readability thing...

1 Upvotes

So, y'all sound pretty badass and experienced and all, but I thought I should talk about one (of many) code cleaning techniques, I learned from reading books like (Clean Code, by Robert C. Martin) and (Refactoring, by Martin Fowler), when it comes to improving code readability of some recurring code snippets. Specifically, listeners.
As you probably know, it is said the ratio of reading to writing code is 10:1. So readability is important.
And in these books, the authors lay out wonderful "mental" shortcuts to applying techniques that improve code readability, and even identifying where to apply said techniques through what they collectively call "code smells".
Called so, because, and this has been my experience for years:

[...any sufficiently large code base will eventually suffer from "code rot" if it doesn't get cleaned every now and then.]

Code rot: When the code is so messy, adding, or modifying code in any meaningful way gets more and more unpleasant and time-consuming, to the point where it feels like the project just collapses...

Anyway, regarding listeners. I'd have code that went like this:

bookCb.getSelectionModel().selectedItemProperty().addListener((a, b, selectedBook) -> {
if(selectedBook != null) {
List<Chapter> chapters = selectedBook.loadChapters();
chapterCb.setItems(FXCollections.observableArrayList(chapters));
}
};

So, the first part is extracting a helper that does whatever happens inside the listener, and might as well pull the null check into it too:

bookCb.getSelectionModel().selectedItemProperty().addListener((a, b, selectedBook) -> {
loadChapters(selectedBook);
};

this happens inside initialize() of a controller, btw, so when I learned about how extracting methods to get rid of boilerplate is a thing, I'd go, fine:

loadChaptersOfSelectedBook();

Pulling everything into it. But then I thought: the method should reflect a callback is involved. So, I'd finally settle with:

onBookSelected(book -> loadChapters(book));

private void onBookSelected(Consumer<Book> func) {
selectedBook.getSelectionModel().selectedItemProperty().addListener(a, b, book) -> {
    func.accept(book);
  });
}

private void loadChapters() {
...
}

as a final point, I also learned to not include the component's type in it. So, instead of bookCB (CB -> ChoiceBox), I started calling it:
bookSelector.

instead of: nameLbl -> nameDisplay.
nameTextField/nameTF -> nameField.
and so on.
It sounds kinda pedantic at first, and something of a style difference, but clean code principles saved my life!
Cheers!


r/JavaFX • • May 17 '25

Help Ui error

0 Upvotes

I'm using Hibernate JPA to retrieve data from the database. The data loads correctly when I run it on the console. However, an error occurs when I try to call the API to load the data into the UI.


r/JavaFX • • May 19 '20

Help JavaFX with Task Manager

0 Upvotes

Hello, I am new here, I would like to know how complex and what best resources is for JavaFx application that takes Task manager from windows and store CPU and memory usage from every app that is running in windows and storing dana in H2 base. I googled and found things, but can someone give adive, or any resources. Thank You in advance.

Kind Regards Newbie Kresimir


r/JavaFX • • Jun 18 '21

beginner need help

0 Upvotes

hello, i just started my java classes, and i have a small homework in javaFX that i don't understand, can some one help me with it?

here is the question: Write a program that displays five images in a Border Pane


r/JavaFX • • Mar 03 '22

Tutorial Playing Video Files

Thumbnail codewithedward.com
0 Upvotes

r/JavaFX • • Mar 03 '22

Tutorial The HBox Layout Pane

Thumbnail codewithedward.com
0 Upvotes

r/JavaFX • • Mar 03 '22

Tutorial Playing Audio Files

Thumbnail codewithedward.com
0 Upvotes

r/JavaFX • • Nov 10 '19

Controller class. Now what?

0 Upvotes

Total newbie here. So I have my @FXML IDs set up.

I have this:

public class Controller {

@FXML

private AnchorPane paneFoo;

}

I want to test if everything works right. I just want to print "Hello World" in that pane but nothing seems to work.

Thanks!


r/JavaFX • • Oct 21 '18

Iterators in Java | Types & Example Programs

Thumbnail
scientecheasy.com
0 Upvotes

r/JavaFX • • Jan 09 '25

Help This type of app, helps to understand more about the javafx?

0 Upvotes

r/JavaFX • • Dec 11 '24

Help How can we set & get common values radio buttons columns

0 Upvotes

basically i have this ui , I want to store each value which is selected by user stored in xml? My approach is

private String getSelectedValue(ToggleGroup group) {
    if (group == null) {
        System.err.println("Error: toggleGroup is null!");
        return null;
    }
        RadioButton selectedRadioButton = (RadioButton) group.getSelectedToggle();
        if (selectedRadioButton != null) {
            return selectedRadioButton.getAccessibleText();  // This will be "S" or "R"
        }
    return null;  // No selection
}

<!-- Repair Section-->
                       <VBox spacing="10.0">
                        <Label text="Repairs" style="-fx-font-size: 24px; -fx-font-weight: bold;" />
                        <!-- Repair Section Layout using GridPane for 3 columns -->
                           <GridPane hgap="20" vgap="10">
<!--                               First Column Header (S and R)-->
                              <Label text="S" GridPane.rowIndex="0" GridPane.columnIndex="0" />
                              <Label text="R" GridPane.rowIndex="0" GridPane.columnIndex="1" />
                              <!-- Second Column Header (S and R) -->
                              <Label text="S" GridPane.rowIndex="0" GridPane.columnIndex="3" />
                              <Label text="R" GridPane.rowIndex="0" GridPane.columnIndex="4" />
                              <!-- Third Column Header (S and R) -->
                              <Label text="S" GridPane.rowIndex="0" GridPane.columnIndex="6" />
                              <Label text="R" GridPane.rowIndex="0" GridPane.columnIndex="7" />
                              <!-- First Column Repairs -->
                              <Label text="Logic board repair" GridPane.rowIndex="1" GridPane.columnIndex="2" />
                              <HBox spacing="5" GridPane.rowIndex="1" GridPane.columnIndex="0">
                                 <RadioButton fx:id="logicBoardRepairS"  accessibleText="S" GridPane.rowIndex="1" GridPane.columnIndex="0" toggleGroup="$logicboardTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="1" GridPane.columnIndex="1">
                                 <RadioButton fx:id="logicBoardRepairR" accessibleText="R" GridPane.rowIndex="1" GridPane.columnIndex="1" toggleGroup="$logicboardTG" />
                              </HBox>
                              <Label text="Deoxidization" GridPane.rowIndex="2" GridPane.columnIndex="2" />
                              <HBox spacing="5" GridPane.rowIndex="2" GridPane.columnIndex="0">
                                 <RadioButton fx:id="deoxidizationS" text="" accessibleText="S" GridPane.rowIndex="2" GridPane.columnIndex="0" toggleGroup="$deoxidationTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="2" GridPane.columnIndex="1">
                                 <RadioButton fx:id="deoxidizationR" text="" accessibleText="R" GridPane.rowIndex="2" GridPane.columnIndex="1" toggleGroup="$deoxidationTG" />
                              </HBox>
                              <Label text="Display" GridPane.rowIndex="3" GridPane.columnIndex="2" />
                              <HBox spacing="5" GridPane.rowIndex="3" GridPane.columnIndex="0">
                                 <RadioButton fx:id="displayS" text="" accessibleText="S" GridPane.rowIndex="3" GridPane.columnIndex="0" toggleGroup="$displayTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="3" GridPane.columnIndex="1">
                                 <RadioButton fx:id="displayR" text="" accessibleText="R" GridPane.rowIndex="3" GridPane.columnIndex="1" toggleGroup="$displayTG" />
                              </HBox>
                              <Label text="Outer Display" GridPane.rowIndex="4" GridPane.columnIndex="2" />
                              <HBox spacing="5" GridPane.rowIndex="4" GridPane.columnIndex="0">
                                 <RadioButton fx:id="outerDisplayS" text="" accessibleText="S" GridPane.rowIndex="4" GridPane.columnIndex="0" toggleGroup="$outerdisplayTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="4" GridPane.columnIndex="1">
                                 <RadioButton fx:id="outerDisplayR" text="" accessibleText="R" GridPane.rowIndex="4" GridPane.columnIndex="1" toggleGroup="$outerdisplayTG" />
                              </HBox>
                              <Label text="Battery" GridPane.rowIndex="5" GridPane.columnIndex="2" />
                              <HBox spacing="5" GridPane.rowIndex="5" GridPane.columnIndex="0">
                                 <RadioButton fx:id="batteryS" text="" accessibleText="S" GridPane.rowIndex="5" GridPane.columnIndex="0" toggleGroup="$batteryTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="5" GridPane.columnIndex="1">
                                 <RadioButton fx:id="batteryR" text="" accessibleText="R" GridPane.rowIndex="5" GridPane.columnIndex="1" toggleGroup="$batteryTG" />
                              </HBox>
                              <Label text="Middle Frame" GridPane.rowIndex="6" GridPane.columnIndex="2" />
                              <HBox spacing="5" GridPane.rowIndex="6" GridPane.columnIndex="0">
                                 <RadioButton fx:id="middleFrameS" text="" accessibleText="S" GridPane.rowIndex="6" GridPane.columnIndex="0" toggleGroup="$middleFrameTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="6" GridPane.columnIndex="1">
                                 <RadioButton fx:id="middleFrameR" text="" accessibleText="R" GridPane.rowIndex="6" GridPane.columnIndex="1" toggleGroup="$middleFrameTG" />
                              </HBox>
                              <Label text="Rear Cover" GridPane.rowIndex="7" GridPane.columnIndex="2" />
                              <HBox spacing="5" GridPane.rowIndex="7" GridPane.columnIndex="0">
                                 <RadioButton fx:id="rearCoverS" text="" accessibleText="S" GridPane.rowIndex="7" GridPane.columnIndex="0" toggleGroup="$rearCoverTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="7" GridPane.columnIndex="1">
                                 <RadioButton fx:id="rearCoverR" text="" accessibleText="R" GridPane.rowIndex="7" GridPane.columnIndex="1" toggleGroup="$rearCoverTG" />
                              </HBox>
                              <Label text="Rear Camera" GridPane.rowIndex="8" GridPane.columnIndex="2" />
                              <HBox spacing="5" GridPane.rowIndex="8" GridPane.columnIndex="0">
                                 <RadioButton fx:id="rearCameraS" text="" accessibleText="S" GridPane.rowIndex="8" GridPane.columnIndex="0" toggleGroup="$rearCameraTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="8" GridPane.columnIndex="1">
                                 <RadioButton fx:id="rearCameraR" text="" accessibleText="R" GridPane.rowIndex="8" GridPane.columnIndex="1" toggleGroup="$rearCameraTG" />
                              </HBox>
                              <Label text="Rear Camera Lens" GridPane.rowIndex="9" GridPane.columnIndex="2" />
                              <HBox spacing="5" GridPane.rowIndex="9" GridPane.columnIndex="0">
                                 <RadioButton fx:id="rearCameraLensS" text="" accessibleText="S" GridPane.rowIndex="9" GridPane.columnIndex="0" toggleGroup="$rearCameraLensTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="9" GridPane.columnIndex="1">
                                 <RadioButton fx:id="rearCameraLensR" text="" accessibleText="R" GridPane.rowIndex="9" GridPane.columnIndex="1" toggleGroup="$rearCameraLensTG" />
                              </HBox>
                              <Label text="Front Camera" GridPane.rowIndex="10" GridPane.columnIndex="2" />
                              <HBox spacing="5" GridPane.rowIndex="10" GridPane.columnIndex="0">
                                 <RadioButton fx:id="frontCameraS" text="" accessibleText="S" GridPane.rowIndex="10" GridPane.columnIndex="0" toggleGroup="$frontCameraTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="10" GridPane.columnIndex="1">
                                 <RadioButton fx:id="frontCameraR" text="" accessibleText="R" GridPane.rowIndex="10" GridPane.columnIndex="1" toggleGroup="$frontCameraTG" />
                              </HBox>
                              <!-- Second Column Repairs -->
                              <Label text="Face ID" GridPane.rowIndex="1" GridPane.columnIndex="5" />
                              <HBox spacing="5" GridPane.rowIndex="1" GridPane.columnIndex="3">
                                 <RadioButton text="" GridPane.rowIndex="1" GridPane.columnIndex="3" toggleGroup="$faceIDTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="1" GridPane.columnIndex="4">
                                 <RadioButton text="" GridPane.rowIndex="1" GridPane.columnIndex="4" toggleGroup="$faceIDTG" />
                              </HBox>
                              <Label text="Volume Flex" GridPane.rowIndex="2" GridPane.columnIndex="5" />
                              <HBox spacing="5" GridPane.rowIndex="2" GridPane.columnIndex="3">
                                 <RadioButton text="" GridPane.rowIndex="2" GridPane.columnIndex="3" toggleGroup="$volumeFlexTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="2" GridPane.columnIndex="4">
                                 <RadioButton text="" GridPane.rowIndex="2" GridPane.columnIndex="4" toggleGroup="$volumeFlexTG" />
                              </HBox>
                              <Label text="Volume Buttons" GridPane.rowIndex="3" GridPane.columnIndex="5" />
                              <HBox spacing="5" GridPane.rowIndex="3" GridPane.columnIndex="3">
                                 <RadioButton text="" GridPane.rowIndex="3" GridPane.columnIndex="3" toggleGroup="$volumebuttonTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="3" GridPane.columnIndex="4">
                                 <RadioButton text="" GridPane.rowIndex="3" GridPane.columnIndex="4" toggleGroup="$volumebuttonTG" />
                              </HBox>
                              <Label text="Power Flex" GridPane.rowIndex="4" GridPane.columnIndex="5" />
                              <HBox spacing="5" GridPane.rowIndex="4" GridPane.columnIndex="3">
                                 <RadioButton text="" GridPane.rowIndex="4" GridPane.columnIndex="3" toggleGroup="$powerFlexTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="4" GridPane.columnIndex="4">
                                 <RadioButton text="" GridPane.rowIndex="4" GridPane.columnIndex="4" toggleGroup="$powerFlexTG" />
                              </HBox>
                              <Label text="Power Button" GridPane.rowIndex="5" GridPane.columnIndex="5" />
                              <HBox spacing="5" GridPane.rowIndex="5" GridPane.columnIndex="3">
                                 <RadioButton text="" GridPane.rowIndex="5" GridPane.columnIndex="3" toggleGroup="$powerButtonTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="5" GridPane.columnIndex="4">
                                 <RadioButton text="" GridPane.rowIndex="5" GridPane.columnIndex="4" toggleGroup="$powerButtonTG" />
                              </HBox>
                              <Label text="Mute Button" GridPane.rowIndex="6" GridPane.columnIndex="5" />
                              <HBox spacing="5" GridPane.rowIndex="6" GridPane.columnIndex="3">
                                 <RadioButton text="" GridPane.rowIndex="6" GridPane.columnIndex="3" toggleGroup="$muteButtonTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="6" GridPane.columnIndex="4">
                                 <RadioButton text="" GridPane.rowIndex="6" GridPane.columnIndex="4" toggleGroup="$muteButtonTG" />
                              </HBox>
                              <Label text="Loud Speaker" GridPane.rowIndex="7" GridPane.columnIndex="5" />
                              <HBox spacing="5" GridPane.rowIndex="7" GridPane.columnIndex="3">
                                 <RadioButton text="" GridPane.rowIndex="7" GridPane.columnIndex="3" toggleGroup="$loudSpeakerTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="7" GridPane.columnIndex="4">
                                 <RadioButton text="" GridPane.rowIndex="7" GridPane.columnIndex="4" toggleGroup="$loudSpeakerTG" />
                              </HBox>
                              <Label text="Earpiece Speaker" GridPane.rowIndex="8" GridPane.columnIndex="5" />
                              <HBox spacing="5" GridPane.rowIndex="8" GridPane.columnIndex="3">
                                 <RadioButton text="" GridPane.rowIndex="8" GridPane.columnIndex="3" toggleGroup="$earpieceSpeakerTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="8" GridPane.columnIndex="4">
                                 <RadioButton text="" GridPane.rowIndex="8" GridPane.columnIndex="4" toggleGroup="$earpieceSpeakerTG" />
                              </HBox>
                              <Label text="Back Microphone(Flashlight)" GridPane.rowIndex="9" GridPane.columnIndex="5" />
                              <HBox spacing="5" GridPane.rowIndex="9" GridPane.columnIndex="3">
                                 <RadioButton text="" GridPane.rowIndex="9" GridPane.columnIndex="3" toggleGroup="$backMicrophoneTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="9" GridPane.columnIndex="4">
                                 <RadioButton text="" GridPane.rowIndex="9" GridPane.columnIndex="4" toggleGroup="$backMicrophoneTG" />
                              </HBox>
                              <Label text="Bottom Microphone" GridPane.rowIndex="10" GridPane.columnIndex="5" />
                              <HBox spacing="5" GridPane.rowIndex="10" GridPane.columnIndex="3">
                                 <RadioButton text="" GridPane.rowIndex="10" GridPane.columnIndex="3" toggleGroup="$bottomMicrophoneTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="10" GridPane.columnIndex="4">
                                 <RadioButton text="" GridPane.rowIndex="10" GridPane.columnIndex="4" toggleGroup="$bottomMicrophoneTG" />
                              </HBox>
                              <!-- Third Column Repairs -->
                              <Label text="Front microphone" GridPane.rowIndex="1" GridPane.columnIndex="8" />
                              <HBox spacing="5" GridPane.rowIndex="1" GridPane.columnIndex="6">
                                 <RadioButton text="" GridPane.rowIndex="1" GridPane.columnIndex="6" toggleGroup="$frontMicrophoneTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="1" GridPane.columnIndex="7">
                                 <RadioButton text="" GridPane.rowIndex="1" GridPane.columnIndex="7" toggleGroup="$frontMicrophoneTG" />
                              </HBox>
                              <Label text="Taptic Engine" GridPane.rowIndex="2" GridPane.columnIndex="8" />
                              <HBox spacing="5" GridPane.rowIndex="2" GridPane.columnIndex="6">
                                 <RadioButton text="" GridPane.rowIndex="2" GridPane.columnIndex="6" toggleGroup="$TapticEngineTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="2" GridPane.columnIndex="7">
                                 <RadioButton text="" GridPane.rowIndex="2" GridPane.columnIndex="7" toggleGroup="$TapticEngineTG" />
                              </HBox>
                              <Label text="Charging Flex" GridPane.rowIndex="3" GridPane.columnIndex="8" />
                              <HBox spacing="5" GridPane.rowIndex="3" GridPane.columnIndex="6">
                                 <RadioButton text="" GridPane.rowIndex="3" GridPane.columnIndex="6" toggleGroup="$chargingFlexTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="3" GridPane.columnIndex="7">
                                 <RadioButton text="" GridPane.rowIndex="3" GridPane.columnIndex="7" toggleGroup="$chargingFlexTG" />
                              </HBox>
                              <Label text="Induction(NFC)" GridPane.rowIndex="4" GridPane.columnIndex="8" />
                              <HBox spacing="5" GridPane.rowIndex="4" GridPane.columnIndex="6">
                                 <RadioButton text="" GridPane.rowIndex="4" GridPane.columnIndex="6" toggleGroup="$inductionTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="4" GridPane.columnIndex="7">
                                 <RadioButton text="" GridPane.rowIndex="4" GridPane.columnIndex="7" toggleGroup="$inductionTG" />
                              </HBox>
                              <Label text="Wifi Antenna" GridPane.rowIndex="5" GridPane.columnIndex="8" />
                              <HBox spacing="5" GridPane.rowIndex="5" GridPane.columnIndex="6">
                                 <RadioButton text="" GridPane.rowIndex="5" GridPane.columnIndex="6" toggleGroup="$wifiAntennaTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="5" GridPane.columnIndex="7">
                                 <RadioButton text="" GridPane.rowIndex="5" GridPane.columnIndex="7" toggleGroup="$wifiAntennaTG" />
                              </HBox>
                              <Label text="Bluetooth Antenna" GridPane.rowIndex="6" GridPane.columnIndex="8" />
                              <HBox spacing="5" GridPane.rowIndex="6" GridPane.columnIndex="6">
                                 <RadioButton text="" GridPane.rowIndex="6" GridPane.columnIndex="6" toggleGroup="$bluetoothAntennaTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="6" GridPane.columnIndex="7">
                                 <RadioButton text="" GridPane.rowIndex="6" GridPane.columnIndex="7" toggleGroup="$bluetoothAntennaTG" />
                              </HBox>
                              <Label text="Proximity Sensor" GridPane.rowIndex="7" GridPane.columnIndex="8" />
                              <HBox spacing="5" GridPane.rowIndex="7" GridPane.columnIndex="6">
                                 <RadioButton text="" GridPane.rowIndex="7" GridPane.columnIndex="6" toggleGroup="$proximityTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="7" GridPane.columnIndex="7">
                                 <RadioButton text="" GridPane.rowIndex="7" GridPane.columnIndex="7" toggleGroup="$proximityTG" />
                              </HBox>
                              <Label text="Fingerprint Sensor" GridPane.rowIndex="8" GridPane.columnIndex="8" />
                              <HBox spacing="5" GridPane.rowIndex="8" GridPane.columnIndex="6">
                                 <RadioButton text="" GridPane.rowIndex="8" GridPane.columnIndex="6" toggleGroup="$fingerprintTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="8" GridPane.columnIndex="7">
                                 <RadioButton text="" GridPane.rowIndex="8" GridPane.columnIndex="7" toggleGroup="$fingerprintTG" />
                              </HBox>
                              <Label text="Waterproof Adhesive" GridPane.rowIndex="9" GridPane.columnIndex="8" />
                              <HBox spacing="5" GridPane.rowIndex="9" GridPane.columnIndex="6">
                                 <RadioButton text="" GridPane.rowIndex="9" GridPane.columnIndex="6" toggleGroup="$waterAdhesiveTG" />
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="9" GridPane.columnIndex="7">
                                 <RadioButton text="" GridPane.rowIndex="9" GridPane.columnIndex="7" toggleGroup="$waterAdhesiveTG" />
                              </HBox>
                              <TextArea fx:id="textArea" GridPane.rowIndex="10" GridPane.columnIndex="8"
                                        prefWidth="140.0"
                                        prefHeight="25"
                              minWidth="100"
                              minHeight="25"
                              maxWidth="300"
                              maxHeight="25"
                              wrapText="true"
                              />
                              <HBox spacing="5" GridPane.rowIndex="10" GridPane.columnIndex="6">
                                 <RadioButton/>
                              </HBox>
                              <HBox spacing="5" GridPane.rowIndex="10" GridPane.columnIndex="7">
                                 <RadioButton/>
                              </HBox>
                           </GridPane>
                        </VBox>

// Map each component with the selected value ("S" or "R")
repairSelections.put("LogicBoardRepair", getSelectedValue(logicboardTG));

Fxml:
controller:
setter & getter in device class
adding element tag in reportclass

can anybody help me what's the problem here cz i am getting null in each tag but expected is either "S" or "R" as per user selection.


r/JavaFX • • Jan 16 '25

Help TrayMenu look outdated

0 Upvotes

The tray menu available looks very old looking, is there a way to get the modern look such as discord for example ?

Thanks in advance


r/JavaFX • • Apr 16 '15

JavaFX: How to put ArrayList values into a ComboBox?

0 Upvotes

Hey everyone

I have an ArrayList of Students and I'm trying to put their respective names into a combobox, so that if somebody clicks it they are able to see information that pertains to that student.

I'm just not sure how I could put populate the combobox with their names, can anybody help?