javafx

How to change images with Timeline in JavaFX

久未见 提交于 2021-02-11 02:53:30
问题 I intend to change the images of birds over the time by adding key frames in a for loop to the timeline object. It turns out that only the first image is displayed. Could someone point out where part I got it wrong. Thanks in advance. Besides, I noticed that I have to reset the counter "index" to 0 after for loop otherwise it generates java.lang.ArrayIndexOutOfBoundsException. package application; import javafx.animation.Animation; import javafx.animation.KeyFrame; import javafx.animation

How to change images with Timeline in JavaFX

荒凉一梦 提交于 2021-02-11 02:47:15
问题 I intend to change the images of birds over the time by adding key frames in a for loop to the timeline object. It turns out that only the first image is displayed. Could someone point out where part I got it wrong. Thanks in advance. Besides, I noticed that I have to reset the counter "index" to 0 after for loop otherwise it generates java.lang.ArrayIndexOutOfBoundsException. package application; import javafx.animation.Animation; import javafx.animation.KeyFrame; import javafx.animation

Does having many classes worsens performance in java?

岁酱吖の 提交于 2021-02-10 20:48:34
问题 So I'm trying to make a CCG type of game using javafx (similar to Hearthstone), and I was wondering if it's a very bad idea to have one class for each card, because I've done some research and most fan made card games of Hearthstone use JSON to get the card objects. For example if the game only had 4 cards with the names: DragonMaster Vulcan Pirate Chuck Norris I'd have 4 classes, with the names respectively. Now I though this was necessary since every card would have its own behaviour,

Does having many classes worsens performance in java?

强颜欢笑 提交于 2021-02-10 20:43:29
问题 So I'm trying to make a CCG type of game using javafx (similar to Hearthstone), and I was wondering if it's a very bad idea to have one class for each card, because I've done some research and most fan made card games of Hearthstone use JSON to get the card objects. For example if the game only had 4 cards with the names: DragonMaster Vulcan Pirate Chuck Norris I'd have 4 classes, with the names respectively. Now I though this was necessary since every card would have its own behaviour,

JavaFX how to overlap a shape onto another

匆匆过客 提交于 2021-02-10 19:58:23
问题 I am trying to create a line on top of a circle. Things that i have tried : I added the circle to the StackPane, and then the StackPane and line to a group which i sent to the scene constructor got some undesired results like stackpane not spreading fully over the stage adding the line after the circle puts it automatically above that but i need more control over it. e.g., i have 10 shapes and i want to declare them all and then decide what goes over what and i don't want to worry about

How can I be sure that my javaFX application is loading images from a relative path?

醉酒当歌 提交于 2021-02-10 18:42:59
问题 I'm unable to load images in my game despite using what I thought was the proper file path in the java image class. I've multiple file paths and extensions available, and have messed around with the file location as well, the current file structure is: --src -- main.java -- images -- the image Image earth = new Image("file:projectName/images/img.png"); I expect it to show up once I launch my game, but it unexpectedly doesn't show up, and the game doesn't crash neither. Any help is greatly

Unresolved reference to symbol 'WixUI:WixUI_InstallDir' in section for JAVA FX Deploy

隐身守侯 提交于 2021-02-10 18:37:27
问题 I created a java fx application and am customizing the MSI installer. I added my Software.wxs to the package/windows directory and I am getting the error: Unresolved reference to symbol 'WixUI:WixUI_InstallDir' in section I understand I need to reference C:\Program Files (x86)\WiX Toolset v3.11\bin\WixUIExtension.dll which I have seen documentation for in visual studios & in command line but I am using eclipse with the build.xml ANT deploy. If i do not reference any WixUIExtension's my

Materialize Icons doesn't work in JavaFX Browser

我的未来我决定 提交于 2021-02-10 18:17:37
问题 I'm trying to show MaterialIcons on my JavaFx WebBrowser using webEngine, but it just shows the description of the icon. Icons doesn't work also on IE and Safari. Does anyone know how to make it readable? 回答1: I also struggle on that one, so for those who are intersted to know, JavaFX is only compatible with MaterialIcons written with numerical character references as James_D stated and not with ligatures format. So insted of writing : <i class="material-icons">add</i> You should write : <i

Missing fonts in Scene builder

给你一囗甜甜゛ 提交于 2021-02-10 18:12:01
问题 I use Scene builder to build some JavaFX app, whenever I try to select a font from right menu some fonts aren't shown in the list, what could be the problem? I tried several solutions such as reinstalling the program, install the fonts then installing Scene builder, and tried different machines. I noticed that any PC that runs Windows 7 are working perfectly. Edit 1: After some attempts to try to fix the problem it turned out that Windows 10 store fonts in two separate folders, when

OpenJFX 16ea on Pi 3 throws UnsatisfiedLinkError for libprism_es2_monocle.so: libGLESv2.so

橙三吉。 提交于 2021-02-10 16:15:27
问题 I try to use a JavaFX application on a Raspberry Pi 3 B+ with a small display connected to the display port. But this throws an error on startup of the application. Maybe first some quick questions to get started: Is the display port supported by JavaFX? Because this is the first time I use it instead of HDMI. Or is OpenJFX 16ea only for Raspberry Pi 4? I downloaded latest openjfx from https://gluonhq.com/products/javafx/. This is my startup command to run the (Maven) compiled application: