r/JavaFX • u/quizynox • May 31 '23
Release AtlantaFX 2.0 released
Several new controls, three new themes, BBCode markup support and new Sampler app.
The full changelog is here: https://github.com/mkpaz/atlantafx/releases/tag/v2.0.0
r/JavaFX • u/quizynox • May 31 '23
Several new controls, three new themes, BBCode markup support and new Sampler app.
The full changelog is here: https://github.com/mkpaz/atlantafx/releases/tag/v2.0.0
r/JavaFX • u/Sanguevenegro • May 29 '23
Hello everyone, i am game developer and new in the comunity. I wanna learn so much with you guys👊ðŸ˜
r/JavaFX • u/Affectionate_Run_799 • May 28 '23
r/JavaFX • u/BenInQuarantine • May 25 '23
I've been trying to create an executable file to open my JavaFX application and recently found this very helpful tutorial: https://www.youtube.com/watch?v=EyYb0GmtEX4. Unfortunately, after I run mvn install, only the normal Jar file is generated with no sign of the shadow jar. Does anyone have any ideas?
r/JavaFX • u/PartOfTheBotnet • May 23 '23
r/JavaFX • u/Paullo612 • May 22 '23
I'd like to introduce my project. It is called mlfx. It can compile FXML ahead of time. It is basically an annotation processor, which internally uses Micronaut framework's AST abstraction and compiles fxml files directly to JVM bytecode. This decreases UI load time and also helps with native-image reflection configs. It also has some compliance tests that load compiled code and check resulting object graph against one loaded by javafx-xml. It also has some drawbacks now, but, please, read README. Now I'm successfully using it in two production projects.
Here it is: https://github.com/Paullo612/mlfx
Latest release (0.6.0) is available from Maven Central.
Feedback is welcome.
r/JavaFX • u/XeonG8 • May 21 '23
Is it possible? Seems a bit steep just to get rid of a nag screen on a mobile app... I'm wanting to target Android/IOS with a simple app and have looked at other languages /frameworks like C# MAUI Avalonia UNO though I'm more familar with JavaFX as I've done desktop stuff before in JavaFX which ironically is pretty simple but the mobile element with JavaFx seems gatewalled and bit off putting to bother.
r/JavaFX • u/ImagineRl • May 20 '23
When i try to drag and drop my .jar file into a pane it shows a cancle cursor, I have not clue why.
Here's my Controller.java
------------------------------------------------
package com.example.detector;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.input.DragEvent;
import javafx.scene.input.Dragboard;
import javafx.scene.input.TransferMode;
import javafx.scene.layout.Pane;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
import java.io.File;
public class Controller {
public TextField pathText;
public Pane dragDropPane;
public void initialize() {
dragDropPane.setOnDragEntered(event -> {
if (event.getGestureSource() != dragDropPane && event.getDragboard().hasFiles()) {
dragDropPane.setStyle("-fx-border-color: blue; -fx-border-width: 2;");
event.acceptTransferModes(TransferMode.ANY); // Accept the transfer mode
}
event.consume();
});
dragDropPane.setOnDragExited(event -> {
dragDropPane.setStyle("-fx-border-color: transparent;");
event.consume();
});
dragDropPane.setOnDragOver(event -> {
if (event.getGestureSource() != dragDropPane && event.getDragboard().hasFiles()) {
event.acceptTransferModes(TransferMode.ANY); // Accept the transfer mode
}
event.consume();
});
dragDropPane.setOnDragDropped(event -> {
Dragboard dragboard = event.getDragboard();
boolean success = false;
if (dragboard.hasFiles()) {
for (File file : dragboard.getFiles()) {
// Process the dropped file
System.out.println("Dropped file: " + file.getAbsolutePath());
}
success = true;
}
event.setDropCompleted(success);
event.consume();
});
}
protected void onOpenButtonClick() {
String filepath = pathText.getText();
if (!Utils.isValidJarFile(new File(filepath))) return;
JarViewController controller = SceneSwitcher.switchToSceneWithController("JarView.fxml", 1024, 768);
if (controller == null) throw new NullPointerException("JarViewController is null!");
controller.loadJar(filepath);
}
}
------------------------------------------------
Here's my View.fxml
-----------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<?import java.net.\\\*?>
<?import javafx.scene.control.\\\*?>
<?import javafx.scene.layout.\\\*?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.detector.Controller">
<stylesheets>
<URL value="@styles.css" />
</stylesheets>
<children>
<Pane fx:id="dragDropPane" layoutY="-3.0" prefHeight="349.0" prefWidth="600.0" />
<Button layoutX="545.0" layoutY="361.0" onAction="#onOpenButtonClick" text="Open" />
<TextField fx:id="pathText" layoutX="14.0" layoutY="361.0" prefHeight="25.0" prefWidth="515.0" />
<Label layoutX="255.0" layoutY="192.0" text="Drag .jar file here" />
</children>
</AnchorPane>
-----------------------------------------------
r/JavaFX • u/OsirisTeam • May 20 '23
https://github.com/Osiris-Team/Desku
Currently, JCEF is used together with Java Swing, but I am thinking of implementing the JavaFX WebView instead, what do you think?
r/JavaFX • u/Kitsushine • May 19 '23
Hello everyone,
I'm experiencing issues with looping an audio file and transitioning from one to another seamlessly.
When a transition/loop happens there is a small, but noticeable, delay between the two pieces of audio. This is relevant because the audio is background music for a game I'm working on.
The audio files are an intro and a main loop. The intro is played once, then it transitions to the main loop that plays indefinitely.
The code appears to be correct, but here it is:
private void playMusic() {
Media intro = new Media(ClassLoader.getSystemResource("music/BossIntro.wav").toExternalForm());
MediaPlayer introPlayer = new MediaPlayer(intro);
AudioClip bgm = new AudioClip(ClassLoader.getSystemResource("music/BossMain.wav").toExternalForm());
bgm.setCycleCount(AudioClip.INDEFINITE);
introPlayer.setOnEndOfMedia(bgm::play);
introPlayer.play();
}