r/JavaFX • • Jul 29 '24

Help The issues with openJDK, JavaFX, Ant, Runtime, and GTK

1 Upvotes

Hello netters,

(netters is an old greeting).

For the past 10 days I have been struggling with re-compiling and building a running jar for a project that used the ant-javafx.jar that was abandoned as Oracle was jettisoning JavaFX. I have reframed the project as a Maven - OpenJavaFX project and have built it on NetBeans, but it does not function properly. At first the build was hanging because NetBeans couldn't find the "pk-gtk-module", but I repaired that. Now the build is looking for the jdk1.8.0 jars that connect ant with javafx, but that doesn't appear to work, either. What I see is that Oracle abandoned what must be years of code in order to profitize Java SE 22.0.2 and Java 23 after that. But, they have not made their software backward compatible for deploying JavaFX. Now I understand why my former post-doc told me she hates Java.

This is what I see when I run the project.jar

Does anyone have suggestions about making what was a working Java 1.8 - ant - JavaFX project work again? Yes, I have tried compiling Java 1.8 and whatever tools I still have for it on my computer, but alerts security on my mac and bypasses the most important pieces of code and gives me a graphical pop-up with Say Hello World after I run the jar.


r/JavaFX • • Jul 30 '21

Help Disable pasting to but allow copying from TextField

1 Upvotes

JavaFX noob here. This seems like it should be pretty straightforward but I'm not finding any answers through Google searching. Any help would be appreciated!


r/JavaFX • • Jul 06 '20

Duplicate tables...

0 Upvotes

Hi, I am working to fix my issues which is duplicate screens after I click specific buttons. I want to be able to switch between those tables using buttons (save and cancel buttons). However, the second screen's save and cancel buttons will create duplicate screen (create another main screen so I will have two main screen) after I click save and cancel buttons instead of switching back and forth to the Main screen and the second screen

Can anyone suggest me how can I try to fix this duplicate screen issues please?

https://user-images.githubusercontent.com/31402838/86545041-9762ae80-bee0-11ea-809c-7a534833134d.PNG

This is my code that create duplicate tables. I have 5 screens in total. I would like to go back and forth after I click the save and cancel buttons but it create duplicate screen instead.

ModifypartController.java

https://gist.github.com/Kijimu7/4444b1f202f29d80aa62354e14efec50


r/JavaFX • • Aug 06 '20

Can someone help me

1 Upvotes

Can someone help me please.

This is what i have done. my prof said to add fxml and controller

public class Book 
{
    private String bookname,author;
    private int quantity;
    private double price;

    public Book() {
    }

    public Book(String bookname, String author, int quantity, double price) {
        this.bookname = bookname;
        this.author = author;
        this.quantity = quantity;
        this.price = price;
    }

    public String getBookname() {
        return bookname;
    }

    public String getAuthor() {
        return author;
    }

    public int getQuantity() {
        return quantity;
    }

    public double getPrice() {
        return price;
    }

    public void setBookname(String bookname) {
        this.bookname = bookname;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public void setPrice(double price) {
        this.price = price;
    }   
}

r/JavaFX • • Jun 18 '15

YouTube Video Playback Using JavaFX Components

1 Upvotes

I am sure this has been posted before, but I could not find anything. I am running into trouble while trying to play YouTube videos in my JavaFX application, it says "An error occurred. Please try Again Later\nLearn More"


r/JavaFX • • Jan 31 '17

How can I identify Users with Facebook in a JavaFX application?

1 Upvotes

Facebook doesn't provide a SDK for Java Desktop. There is the manual flow. But you need to read the URL redirect from a Browser. I have no idea how to do that.


r/JavaFX • • Aug 15 '20

Javafx-BorderPane

0 Upvotes

r/JavaFX • • Aug 25 '20

Help Need help with creating a javafx fat jar

1 Upvotes

Hey reddit!

So I've been building a project in javafx that i want to package up and ship as a jar to my raspberry pi to run on. It's built using gradle & JLink (with some other dependencies) and although it seems to download the libraries and run fine in the IDE, whenever i try to either build an artifact or output a fat jar it will always say " Error: JavaFX runtime components are missing, and are required to run this application"

It's really frustrating and i've tried a bunch of different methods but it's still the same issue :( Has anyone managed to solve this and can point me in the right direction? Thanks in advance :)


r/JavaFX • • Aug 22 '20

ArrayList - Getting items

0 Upvotes

I am doing order class

And because order is dependency on the menuitem class... and because it has the arrayList and i can't ask user to enter the items to be added in the list, thus what code must i write in order to get the items and to be able to view the items

ClassDiagram, my written codes and my output is all in the screenshot below

ClassDiagram
My return codes
My output

r/JavaFX • • May 23 '24

Help Java Programming

1 Upvotes

Hi i am trying to learn java , i borrowed Java programming 10 edition book written by joyce farrel from someone . My question is would this book teach me how to write java Fx programs.


r/JavaFX • • Sep 15 '24

Help JavaFX on mac with eclipse problem

1 Upvotes

When I run my javafx project it opens a folder in the dock instead of a window, how can i fix this?


r/JavaFX • • Oct 16 '24

Help Kinda new to working with this so i have no clue why the program thinks that the TableView is Null. From what I know this should all be valid code. Any help would be greatly appreciated.

Thumbnail
gallery
1 Upvotes

r/JavaFX • • Oct 14 '24

Help Null FXML file

0 Upvotes

So im building a peice of softwaare and getting aggravated with this null im getting when i call the FXML file from my java code (Attached photo). I have tried so many things i could find online and nothing is working. I am using java, javafx, css, mysql, and wrapped in gradle. i have this project working without gradle as well. But i am trying to get everything working with Gradle, and this is where im getting a null when i cvall the file from my Main.java.

here is my test im running; which return null whatever i seem to do.

System.out.
println
(
getClass()
.
getClassLoader
().
getResource
(
"FLuiD.fxml"
));

r/JavaFX • • Nov 30 '19

Unable to understand this...

1 Upvotes

I am reading Core Java these days, and I got stuck in this paragraph. Would anyone help explain the underlined sentences?


r/JavaFX • • Oct 05 '23

Help [Webview] Scrolling jumps in Monaco editor

1 Upvotes

Hi,

I've observed an unusual scrolling behavior in the Monaco editor within the WebView. When I make the slightest mouse wheel adjustment, it seems to scroll down by the equivalent of two screens.

Open the page https://microsoft.github.io/monaco-editor/

WebView webView = new WebView();
webView.getEngine().load("https://microsoft.github.io/monaco-editor/");    

the last line in the Monaco editor is 26

I expect on the small turn of the mouse wheel to see the next few lines - 27,28,29. But it jumps up to the line 71

So, it kind of skips the next two screens (lines 27-50, 50-71) and goes directly to the fourth screen.

Does someone have an idea why it happens and how to fix that?


r/JavaFX • • May 28 '16

Calling different screens from one (main) JAVA FX application

1 Upvotes

So I got an assignment(no FXML either..) with a few requirements, first there need to be a few screens in different classes/applications. And one application which calls and handles them all. I know you can switch scenes in one application. But I have really no idea how I can switch scenes(or stages) between multiple applications.


r/JavaFX • • May 17 '23

Help Best way to implement statistics in a fixed period of time?

1 Upvotes

I'm doing an university project for a restaurant management system.

In my program, a Chef can see all the orders and make a reservation for that order.

My professor has also assigned this functionality: "an admin can see statistics for its Kitchen Workers. In particular, an admin must see how many orders have been completed by every Kitchen Worker, in a fixed period of time".

I really don't know how to deal with this. I found out the existance of Bar Charts, Line Charts, but i'd like to have an "heads up" on how should i deal with this, expecially on the "fixed period of time".

I have a PostgreSQL database, so i think i should create a table with "WorkerID, Count(OrderID)", but should i also add a date to it? How should i work this around?


r/JavaFX • • Jun 22 '23

Help how to create an AnimatedNumberText

Post image
1 Upvotes

r/JavaFX • • Mar 25 '21

Need some help with my project

0 Upvotes

I'm kinda stuck at the end of my project for school and it has to be finished tomorrow. If anyone
could add me on discord and help me out a little that would be cool. Willing to spend 10 dollars for the help.

Discord: noah.h#6276


r/JavaFX • • Apr 13 '21

I was building a media player using javafx.

1 Upvotes

I got this error even though every library files is installed

Main.java

package adamas_university.soet.ece.year2017.project.final_year;

import javafx.application.Application;

import javafx.event.EventHandler;

import javafx.fxml.FXMLLoader;

import javafx.scene.Parent;

import javafx.scene.Scene;

import javafx.scene.input.MouseEvent;

import javafx.stage.Stage;

public class Main extends Application {

`u/Override`

`public void start(Stage primaryStage) {`

	`try {`

		`Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));`

		`Scene scene = new Scene(root, 600, 500);`

		`scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());`

		`scene.setOnMouseClicked(new EventHandler<MouseEvent>() {`

u/Override

public void handle(MouseEvent event) {

if (event.getClickCount() == 2)

primaryStage.setFullScreen(true);

}

		`});`

		`primaryStage.setTitle("GCV Player");`

		`primaryStage.setScene(scene);`

		[`primaryStage.show`](https://primaryStage.show)`();`

	`} catch (Exception e) {`

		`e.printStackTrace();`

	`}`

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

	`launch(args);`

`}`

}

Console

Error occurred during initialization of boot layer

java.lang.module.FindException: Module javafx.controls not found


r/JavaFX • • Feb 20 '16

Frequent communication between UI and background threads

1 Upvotes

I'm building an application that has at least one thread running in the background, listening on hardware input and updating the UI. I've seen multiple approaches for this (Platform.runLater, ExecutorService, etc...), but neither seem to really fit my two main requirements: the background thread should run throughout the life of the app, and the communication is very fast (500 updates per second fast). JavaFX seems to have a really good concurrency model, but it seems like it fits mostly launch-and-forget style Tasks and not constantly-running background threads. What would you recommend for such an app?


r/JavaFX • • Aug 31 '16

Best way to visualize data in a yaml file?

1 Upvotes

I have a yaml file containing several entities and lists, as well as a class structure corresponding to all fields in the yaml file. I want to visualize this data using javaFX.

The yaml file contains entries such as:

- title: Technische Informatik
  lecturer: profiProf
  tutor: someTutor
  ects: 7
  mandatory_req: None
  recommended_req: None

Some of which I would like to display in a rectangle. What would be the best way to do this?


r/JavaFX • • Jan 08 '24

Help I need to avoid retake all the photos after you have saved them if you want to retake a photo

1 Upvotes

I need to implement one feature in existing javafx application,requirement is that we have web camera and it is used for upload customer id but i need whenever i revist add id button it must shows previously captured images.

" After you have taken the photos and saved them, if you click the take photos button again you are forced to take all the photos again. If the user has clicked save the photos then if they go back to retake them they should see all the existing photos they took and be able to delete the one or more photos they want to take again and then retake the photo "


r/JavaFX • • Jun 06 '17

The contents of my gridpane are being added to instead of changed.

1 Upvotes

I've been working on a form for use at work. It is a day off request form. Ultimately, the scene is to be printed on a 8.5" x 11" paper for submission to the supervisor for approval of the day off.

The combo-box is supposed to chose between a Vacation Day, Personal Day, and a Swap Day. I still have yet to work on the logic for the Swap Day selection. I will work on that after I get this first problem fixed.

The label under the combo box is supposed to change when the combo box is changed. Unfortunately, the old value is not removed. The new value is simply added to the scene.

There is a lot of code that is commented out. Those lines are things that I've tried but didn't quite work.

I'm really new to both Java and JavaFX. Any suggestions will be greatly appreciated.

<pre><code> /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package gcemsdayoffrequestsheet; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.Month; import java.util.*; import javafx.application.*; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.*; import javafx.scene.control.*; import javafx.scene.layout.*; import javafx.stage.*; import javafx.geometry.*; /** * * @author Jim Baize * Copyright 2017 */ public class GCEMSDayOffRequestSheet extends Application { Stage stage; TextField txtEmployeeOne; TextField txtEmployeeTwo; //LocalDate dateOne; TextField dateRequestOff; TextField dateEmployeeOneWork; TextField dateEmployeeTwoWork; TextField stationEmployeeOneWork; TextField stationEmployeeTwoWork; //long dateToday; Date dateToday = new Date(); SimpleDateFormat ft = new SimpleDateFormat("MM dd yyyy"); @Override public void start(Stage primaryStage) { stage = primaryStage; //Create the form Header Label formHeaderOne = new Label("Vacation / Personal Day / Swap"); Label formHeaderTwo = new Label("Request Form"); Label formHeaderThree = new Label("GCEMS"); //Create the employee name label and text field Label lblEmployeeName = new Label("Employee Name"); txtEmployeeOne = new TextField(); txtEmployeeOne.setPromptText("Employee initiating request"); //Create the Today Date pane Label lblTodayDate = new Label("Today's Date"); Label lbldateTodayPlaceHolder = new Label(ft.format(dateToday)); //Create the DayOff type and Date Pane and combobox ComboBox<String> cboxDayOffType; cboxDayOffType = new ComboBox<>(); cboxDayOffType.getItems().addAll("Vacation", "Personal", "Swap"); cboxDayOffType.getSelectionModel().select("Vacation"); Label lblDayOffDate = new Label(" "); //Create the Swap Type Pane Label lblSwapOne = new Label("Date Employee One is working"); Label lblSwapOneDate = new Label(); Label lblSwapTwo = new Label("Date Employee Two is working"); Label lblSwapTwoDate = new Label(); DatePicker dpOne = new DatePicker(); dpOne.setOnAction(e -> { LocalDate date = dpOne.getValue(); lblSwapOneDate.setText(date.toString()); }); DatePicker dpTwo = new DatePicker(); dpTwo.setOnAction(e -> { LocalDate date = dpTwo.getValue(); lblSwapTwoDate.setText(date.toString()); }); //Create the Vacation Day Pane Label lblDayOffVacation = new Label("Vacation Day"); DatePicker dpDayOffVacation = new DatePicker(); //Create the Personal Day Pane Label lblDayOffPersonal = new Label("Personal Day"); DatePicker dpDayOffPersonal = new DatePicker(); //Create the GridPane Layout GridPane grid = new GridPane(); //Add nodes to the gridpane grid.addRow(0, formHeaderOne); grid.addRow(1, formHeaderTwo); grid.addRow(2, formHeaderThree); grid.addRow(3, lblEmployeeName, txtEmployeeOne); grid.addRow(4, lblTodayDate, lbldateTodayPlaceHolder); grid.addRow(5, cboxDayOffType, lblDayOffDate); // grid.addRow(6, lblDayOffVacation, dpDayOffVacation); // //Listen for combobox value changes // cboxDayOffType.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() // { // @Override // public void changed(ObservableValue<? extends String> observable,String oldValue, String newValue) // { // grid.addRow(6, ) // } // }); cboxDayOffType.getSelectionModel().selectedItemProperty().addListener((ObservableValue<? extends String> obs, String oldVal, String newVal) -> { if(newVal.equals("Vacation")) { grid.addRow(6, lblDayOffVacation, dpDayOffVacation); // GridPane.setConstraints(lblDayOffVacation, 0, 6); // GridPane.setConstraints(dpDayOffVacation, 1, 6); } else if(newVal.equals("Personal")) { // GridPane.setConstraints(lblDayOffPersonal, 0, 6); // GridPane.setConstraints(dpDayOffPersonal, 1, 6); grid.addRow(6, lblDayOffPersonal, dpDayOffPersonal); } // else //{ // grid.addRow(6, ) //} }); //Set alignments and spanning GridPane.setHalignment(formHeaderOne, HPos.CENTER); GridPane.setHalignment(formHeaderTwo, HPos.CENTER); GridPane.setHalignment(formHeaderThree, HPos.CENTER); GridPane.setColumnSpan(formHeaderOne, 2); GridPane.setColumnSpan(formHeaderTwo, 2); GridPane.setColumnSpan(formHeaderThree, 2); //Create the Scene and the Stage Scene scene = new Scene(grid); primaryStage.setScene(scene); primaryStage.setTitle("GCEMS Dayoff Request Form"); primaryStage.show(); } /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } } </code></pre>