I am making a ping pong game using JavaFX, but before I am going to make that, I like to test the KeyEvents. I made a simple ping pong game about 2 years ago, but I like to improve my game. And was pretty bad controlls back when I made the ping pong game, because of the not smooth controls. so here is the problem: whenever I holdpress A and switch quickly to holdpress D or D to A, same with (W to S and S to W). it just takes a little break and then move, is there something …

Member Avatar
Member Avatar
+0 forum 4

So I am making a responsive audio waveform, if you don't know what that is, it is something like this: (btw this is my goal to make those audio waveforms). https://i.ytimg.com/vi/J7uN-SQtOYI/maxresdefault.jpg https://www.youtube.com/watch?v=OVMuwa-HRCQ https://www.youtube.com/watch?v=SCD2tB1qILc I don't know how to describe it, so just look at the videos and image. but my question is, how do I get the values from the "AudioSpectrumListener", it has a lambda expression. And I need the value of the magnitude. So I can print out the values. Later I will use the values to make rectangles and that rectangles will change height shape because of the …

Member Avatar
Member Avatar
+0 forum 17

I am making a program, and I don't know why my program becomes unresponsive, when I click the button ): I have a feeling its because of this: "connection = server.accept();" I don't know how to fix it. I am trying to recreate this: https://stackoverflow.com/questions/18505123/how-to-use-client-chat-on-different-pc but in javafx. package yeetYeet; import java.io.EOFException; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.ServerSocket; import java.net.Socket; import javafx.animation.AnimationTimer; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.TextArea; import javafx.scene.control.TextField; import javafx.scene.paint.Color; import javafx.stage.Stage; public class Server extends Application{ private ObjectOutputStream output; private ObjectInputStream input; private ServerSocket server; private Socket connection; //set up and …

Member Avatar
Member Avatar
+0 forum 16

Hello, I would like to develop a sprite editor. Therefore I have programmed a software like paint. As you can see on the picture, on the right, there is a canvas with a grid on it. I use a GridBagLayout to manage every widgets inside my window. The canvas is represented by a JLabel which is inside a JLayeredPane. I have set the size of the JPanel with setPreferredSize. It works well with my screen resolution because there is enough space to display the canvas. However on smaller screen, it doesn't show up. Any idea on how to adapt the …

Member Avatar
Member Avatar
+0 forum 1

Hi guys, I've made an application in JavaFX and I do want to export it into a runnable jar. When I run it from Eclipse or Netbeans, it works well. But when I run it from windows as an executable jar I get this error for my layout. Exception in Application start method Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) Caused by: java.lang.RuntimeException: Exception in Application start method at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$152(LauncherImpl.java:182) at com.sun.javafx.application.LauncherImpl$$Lambda$2/1338668845.run(Unknown Source) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalStateException: Location is not set. at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2438) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2413) at application.MainApp.initRootLayout(MainApp.java:47) at …

Member Avatar
Member Avatar
+0 forum 2

The "Invalid Property" Error is thrown at Line 20, which is for the TextField. No idea as to why it is being thrown. <?xml version="1.0" encoding="UTF-8"?> <?import java.lang.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <?import javafx.scene.text.*?> <VBox prefHeight="400.0" prefWidth="284.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> <children> <AnchorPane maxHeight="-1.0" maxWidth="-1.0" prefHeight="375.0" prefWidth="285.0" VBox.vgrow="ALWAYS"> <children><Button fx:id="zero" layoutX="14.0" layoutY="321.0" mnemonicParsing="false" prefHeight="40.0" prefWidth="40.0" text="0" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="230.0" /><Button fx:id="decimal" layoutX="54.0" layoutY="321.0" mnemonicParsing="false" prefHeight="40.0" prefWidth="40.0" text="." AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="68.0" AnchorPane.rightAnchor="176.0" /><Button fx:id="posneg" layoutX="94.0" layoutY="321.0" mnemonicParsing="false" prefHeight="40.0" prefWidth="40.0" text="+/-" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="122.0" AnchorPane.rightAnchor="122.0" /><Button fx:id="one" layoutX="14.0" layoutY="271.0" mnemonicParsing="false" prefHeight="40.0" prefWidth="40.0" text="1" AnchorPane.bottomAnchor="68.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="230.0" /><Button fx:id="two" layoutX="54.0" layoutY="271.0" mnemonicParsing="false" prefHeight="40.0" prefWidth="40.0" text="2" AnchorPane.bottomAnchor="68.0" AnchorPane.leftAnchor="68.0" …

Member Avatar
Member Avatar
+0 forum 7

Okay, so I have a ListView populated by an Array, which is populated by a text file. I also have 3 TextBoxes which are changed to different values in multiple Arrays using the Selected Index. My problem occurs when reloading the ListView after saving the text file. The values from the TextBoxes are used in the text file. What happens is, the index is being changed since the ListView is being cleared, which fires the changed method. Since the ListView is empty now, the Selected Index is -1 which is why I get an Array Index Out Of Bounds Exception …

Member Avatar
Member Avatar
+0 forum 1

So I have a button which adds a "Miner" then removes the cost of the Miner. The problem is that it is taking away too much, double the cost, and also will not buy if the current gold is equal to the cost. I have no idea why it is like this because I know I didn't program it like this. Here is an Example Scenario: hasEnoughGold, returns boolean (On Exact Amount) hasEnoughGold, returns boolean (One gold more then Cost) miner.getCost(), returns int Calculation (game.getCurGold() - miner.getCost() = game.getCurGold()) game.getCurGold(), returns double false true 25 Calc: 26.0 - 25.0 = …

Member Avatar
Member Avatar
+0 forum 1

Could someone give me a few reasons why an Application isn't terminating on close? `*THIS IS FOR A JavaFX APPLICATION*`

Member Avatar
Member Avatar
+0 forum 5

This is PART of my GoldMiner class where the problem is occuring. I am getting a null pointer. I assume it is because of the way I declared my sceneController class. private static Game game; private static sceneController controller; public static void main(String[] args) { Application.launch(GoldMiner.class, (java.lang.String[])null); game = new Game(); running = true; tick(); //Line 26 } //Line 44: update(); private static void update() { controller.totalGoldLabel.setText(Float.toString(game.getTotalGold())); //Line 52 controller.currentGoldLabel.setText(Float.toString(game.getCurGold())); } Error Exception in thread "main" java.lang.NullPointerException at com.github.geodox.goldminer.GoldMiner.update(GoldMiner.java:52) at com.github.geodox.goldminer.GoldMiner.tick(GoldMiner.java:44) at com.github.geodox.goldminer.GoldMiner.main(GoldMiner.java:26) Exception in thread "JavaFX Application Thread" sceneController is just the FX Controller, and it is using the …

Member Avatar
Member Avatar
+0 forum 15

Cannot get FXMLLoader to load this fxml. Error: Feb 19, 2014 11:25:01 PM com.github.geodox.goldminer.GoldMiner start SEVERE: null java.lang.NullPointerException: Location is required. at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2825) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2809) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2795) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2782) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2771) at com.github.geodox.goldminer.GoldMiner.start(GoldMiner.java:24) at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319) at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:219) at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:182) at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:179) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17) at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67) at java.lang.Thread.run(Unknown Source) Code: package com.github.geodox.goldminer; import java.util.logging.Level; import java.util.logging.Logger; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class GoldMiner extends Application { public boolean running; public static void main(String[] args) { Application.launch(GoldMiner.class, (java.lang.String[])null); } @Override public void start(Stage primaryStage) { try …

Member Avatar
Member Avatar
+0 forum 1

`final PerspectiveCamera camera = new PerspectiveCamera(true);` The constructor PerspectiveCamera(boolean) is undefined. http://download.java.net/jdk8/jfxdocs/javafx/scene/PerspectiveCamera.html Clearly says that it can accept a boolean for "verticalFieldOfView" Why is Java giving me this error?

Member Avatar
Member Avatar
+0 forum 3

I have an installer application I am building in javafx but I can't figure out how to get the operating system it is running on so I can place files in the right locations for each system and so I can customize the interface for each. If anyone has any ideas or knows of a website that I can go to for help that would be great. I already tried oracle I could not find anything on ther but if you find a specific page please let me know. Thanks.

Member Avatar
Member Avatar
+0 forum 2

Hi, I just struggeled all day how can I build JavaFX Application made with visual composer plugin in Nebeans. Every other application worked but this doesn't. When I build it says can't find [I]javac[/I]. Of course, javac .exe is not located in the JRE... [CODE] Cannot run program "C:\Program Files\Java\jre6\bin\javac.exe": CreateProcess error=2, The system cannot find the file specified C:\.....\My Documents\NetBeansProjects\FXComposerMobile\nbproject\build-impl.xml:143: exec returned: -1 BUILD FAILED (total time: 0 seconds) [/CODE] PLEASE HELP ME.

Member Avatar
Member Avatar
+0 forum 2

The End.