Questions tagged [javafx]

The JavaFX platform enables developers to create and deploy rich desktop or browser-embedded applications that behave consistently across multiple platforms and browsers.

Filter by
Sorted by
Tagged with
1
vote
0answers
22 views

Reduce repetition of code for drawing on a canvas in JavaFx

Is there a way to simplify my code underneath? Basically I'm drawing a series of rectangles against each other on a mouse dragged event. The negative numbers are read from a 2D array in an other class ...
3
votes
0answers
153 views

Pomodoro JavaFX (MVC Pattern) Countdown Timer

I made a simple JavaFX app. It is just a Pomodoro timer, it works as expected. The Pomodoro study pattern is a technique where you study for 25 minutes and take a 5-minute break and after 4 periods of ...
4
votes
2answers
201 views

Create an analogue clock interface in Java using JavaFX

The app when works fine, but people are saying that the code is not written with good code style and following OOP principles. Can I improve on any parts of my code? Especially regarding: Code ...
2
votes
0answers
291 views

Feedback JavaFX code - MineSweeper using SceneBuilder

I've learned JavaFX recently (with Scene Builder) and made a MineSweeper game, would love to receive feedback and tips for improvement! Thanks. Below is mines class, I've commented out some lines for ...
5
votes
1answer
552 views

JavaFX clone of Snake game

I have made a Snake clone using Java 14 and JavaFX 14. My game uses an anonymous instance of the AnimationTimer class as the game loop. The basic UI for the start ...
3
votes
1answer
95 views

Concerned about thread safety

I'm writing start/stop module for my application. I have a class that manages application life cycle and I called it Work. Work ...
5
votes
3answers
304 views

Ensuring threads running infinite loops are terminated before exiting the program

As a hobbyist programmer, I gain knowledge where I can find it from google searches. I tend to write code that utilizes threads that have infinite loops using while loops, where the while condition ...
3
votes
1answer
2k views

Multiple buttons and their event handlers in JavaFX

In my project I used this code to create a GUI using JavaFX. The aim was to have a screen with 7 buttons on it. Next, depending on which button is pressed another set of buttons will appear on the ...
7
votes
1answer
243 views

Gem Puzzle game

I started learning JavaFX a few days ago and I have just created as an exercise a simple Gem Puzzle game. The puzzle pieces can be moved if we click on them. The visual aspect of the game is very ...
3
votes
0answers
232 views

Making a fast Mandelbrot Fractal viewer

I'm making a Mandelbrot set viewer in JavaFX. It takes a while, like maybe 5 seconds to finish. Here's my code: ...
2
votes
0answers
36 views
1
vote
0answers
29 views

Building treetableview using directory as a datasource [closed]

Trying to build a TreeTableView following this guide https://edvin.gitbooks.io/tornadofx-guide/content/part1/5.%20Data%20Controls.html. While I managed to use File class as a data source, I still ...
1
vote
1answer
555 views

Animation of adding / removing nodes from VBox

Method hide_old_show_new (I can't think of a suitable name) gradually, using FadeTransition, removes all nodes (from last to ...
2
votes
0answers
865 views

JavaFX lazy loading of images in TableView

This code is based off https://stackoverflow.com/questions/25711103/javafx-combobox-lazy-loading-images but modified to work with a TableCell Firstly, the model object should have an observable ...
5
votes
1answer
745 views

JavaFX Connect Four AI

I made a Connect Four AI with minimax algorithm. It's my first bigger JavaFX project. Any help for improvements would be really appreciated. Board: ...
1
vote
1answer
90 views

slow JavaFx PostgreSQL CRUD app with complex object

I've created a JavaFX app to the data about Vessels, Employees and Jobs. The current version works but it is quite slow which I need to fix. I understand the root of my problems but I do not know how ...
1
vote
1answer
237 views

Multithreading to allow multiple clients on to a server and client requests handling

I have to create a client-server JavaFX application using MVC which does many operations consisting mainly in messages exchange. I'd like to know if this way to handle client acceptance and client ...
6
votes
1answer
784 views

Snake Game in Java feedback

I started coding in August 2018, and I was wondering on how I can improve as a programmer. I'm more concerned about coding conventions. Particularly, how can I improve the structure of my code, ...
1
vote
1answer
626 views

JavaFX Exercise Application

This is a pre version of my program. This program is about solving exercises. Because this is one of my first graphical applications, I want to know, what can be improved. To this point I usually ...
1
vote
0answers
414 views

A JavaFX for generating beeping sound on Windows via JNI

This is my practice program: a simple dialog box using which a user may specify a frequency of a sinus audio signal, and play it via pressing a button. It contains a GUI: App.java ...
2
votes
0answers
162 views

Color picker using WritableImage in JavaFX

I am making my own JavaFX color picker just for learning more about JavaFX. I am rendering a color wheel in JavaFX using WritableImage and I have a ...
1
vote
0answers
1k views

Simple card game with updating GUI

I have coded a simple card game that updates the GUI each second and contains many nodes in game which are used to display game events and animation. People who have tried the game said that their ...
0
votes
1answer
705 views

Breaking up a simple Paint application into smaller classes

(Sorry this is a repeat post, I hadn't logged in on my initial question and am unable to respond) I currently have a working code for a simple paint application but it is all in one file and very ...
4
votes
1answer
2k views

Simple Java Download Manager

I have written a simple download accelerator in java which downloads the same file in multiple threads and then combines them all. I would love some feedback on my design. How the same implementation ...
1
vote
1answer
287 views

JavaFX controller for a poker game

I am making a poker application in JavaFX. When I try to display the cards on the screen it is working perfectly fine. Yet I have a method with a lot of duplicated code in it. I have tried to ...
1
vote
0answers
180 views

KeyEvent listener: mapping physical keyboard to onscreen keyboard [closed]

I have an assignment to create a GUI with a keyboard and text area. Conceptually, the user would type on the physical keyboard and the respective key would change background on screen to reflect that ...
3
votes
1answer
1k views

Media player component with JavaFX

I am trying to build a media player as a part of a bigger project in JavaFX. It is a simple media player as of now, which requires a Presentation component to ...
2
votes
1answer
77 views

Cards for Monster, Spell and Trap interfaces [closed]

So I wrote a card game in Java/JavaFX but I don't particularly like this solution and I was wondering if you guys have any better solutions: ...
3
votes
2answers
390 views

Creating user accounts

I have a method which allows to create user account. It contains some conditions to control empty fields, wrong format of email, weak password, etc. ...
2
votes
0answers
242 views

Encapsulation of putpixel is terribly slow in JavaFx

I am trying to write a simple rendering engine in JavaFx and I manage encapsulate putpixel in the way that I pass x,y coordinates and color and it draws pixel of that color to the screen. I also wrote ...
4
votes
1answer
3k views

Minesweeper JavaFX app

This is my Minesweeper JavaFx app. It is working without any weird bugs, at least none that I found. I am not too concerned about the way it looks either, the main reason I post this here is to get an ...
1
vote
0answers
188 views

JavaFX Audio Visualizer unsure about MVC / Observer / Listerner design patterns

I have a MP3Player Class that does the Fast Fourier Transform and puts the values in a float array (called bands). Then every 20ms it notifys the Observer (VisualizerController) which then uses ...
5
votes
1answer
1k views

Cookie Clicker in JavaFX

Download the Program I have written a Cookie Clicker Game with JavaFX. I have not much experience so I guess that the code looks terrible to a person that is familar with JavaFX. So lets improve that!...
5
votes
1answer
2k views

JavaFX Checkers game

I started self teaching myself Java a few months ago. I recently came to the point where I felt it was time to blackout myself from any help or guiding material other than Oracle's docs, so I made a 2 ...
7
votes
1answer
271 views

A Game of Life application, with mouse clicks

I have a Game of Life program that has a grid[][] array which is populated by Cell objects. If there's a cell in a grid square, ...
7
votes
1answer
1k views

Moving Cell objects around a game field

I have a 20x20 field that contains Square objects. Each Square contains a Rectangle that is ...
4
votes
0answers
149 views

Algorithm to find connected tiles (percolation)

I wrote a little program in JavaFX which displays a path of neighbouring open tiles going from top to bottom. It should simulate a percolation. The algorithm iterates through the whole grid (every ...
2
votes
2answers
693 views

Calculate the total sum of points that cost to level up a character

I'm learning JavaFX and how to make good code in general. I created a little aplication that let you calculate how many points cost to level up a character stats. But I noticed that I usually repeteat ...
6
votes
1answer
2k views

Simple Java game of a rocket ship flying in space

This is just some code I wrote for a hobby really, I'm trying to get better so please tell me all the bad/weird stuff I've done. Thanks for helping! I've left a little boring code out but most of it ...
1
vote
0answers
32 views

JavaFX FreeTTS program lags on MacOSX. Load wheel

I am working on a personal project and I am new to app development in general also java and javafx. I have some code that works. Only, I am unsure why I get the mac loader wheel once my button to play ...
3
votes
1answer
7k views

JavaFX: Load and associate an FXML with a controller class using an interface with Java 8 default methods

I created an interface (IFXMLComponent) that can be added to a FXML controller class. The FXML controller class that implements this interface will be associated with an FXML file. The interface ...
1
vote
0answers
35 views

Slider with and without notification

In my project the value slider must be sometimes set. Then no notification may be generated because otherwise the new value will written in database again. I have this solved in the following way. Is ...
4
votes
2answers
6k views

Make a popup window that will stay open for 3 seconds

I am doing an assignment and I have a task where I need to make a simulation where under certain conditions it opens a popup window and then closes it after 3 seconds. This is how I did it: ...
2
votes
1answer
91 views

Setting value of controller controls for domain objects with Reflection

Is my use of Java Reflection an OK design? Each domain object contains an annotation to declare what controller would be initialized to edit/create the object: Each field of the domain object has ...
1
vote
0answers
1k views

Java Reversi Implementation (javafx)

This is a working Reversi game in JavaFX. The user is 'black' and the computer that plays against the user is 'white'. I tried to structure the code to be object oriented, but I am not sure if I am ...
3
votes
1answer
156 views

Google Guice module that loads two kinds of views

The code of my Guice Module looks like this: ...
5
votes
1answer
2k views

Snake Game in JavaFX

I've made a simple snake game on which I want to expand with some properties and settings to allow the user to change the speed increments of the snake and the game field size. Before expanding on it ...
3
votes
1answer
367 views

Patience game (Klondike)

I've been working on a Patience clone in java using javaFX. It's not finished yet, there are some features not working and some bugs still there, but I'm really in need of some structural advice and ...
3
votes
0answers
1k views

Structure of a serial port reading program

I am writing a serial port communication app. And I thought I could get some feedback about the general structure of the program. If I am doing MVC correct, etc. Since this is a "large" program I ...
2
votes
1answer
51 views

Glorified Document Chooser

I'm primarily concerned about the design of this MVC application. But will gladly take any suggestions! Primary objective: Create an interface that allows a user to choose a document from a database. ...