Skip to main content
Share Your Experience: Take the 2024 Developer Survey
7 votes

Snake in JavaFX

A few recommendations per class: Food.java What's the point in this class? It just's just a Point with a constant colour. I would just have a FOOD_COLOUR constant ...
Michael's user avatar
  • 778
5 votes
Accepted

Follow the Rubberduck - Part 3: JavaFX MVC and MVP Matrjoshka

...
Pimgd's user avatar
  • 22.3k
5 votes
Accepted

JavaFX clone of Snake game

TL;DR summary: Use less comments, use meaningful comments, use Deque, DRY and generalise the repetitive code (with some smarts), out-of-border checking, make ...
Hawk's user avatar
  • 216
4 votes
Accepted

A "pointless" animation program

This looks very nice, straightforward code. A few minor improvements are possible. Simplifications of lambdas This uses a statement lambda: ...
janos's user avatar
  • 111k
4 votes
Accepted

Simple Java password rule enforcing

I see at least one big problem in your method: there is no separation of concerns. Everything is mixed into this method: common rule for password double-checking, business rules for password ...
Spotted's user avatar
  • 599
4 votes
Accepted

Snake Game in JavaFX

It looks good to me. I only have minor reviews. All constants should be declared in a final variable. ...
Cian's user avatar
  • 116
4 votes

Cookie Clicker in JavaFX

I don't have the time to write a complete review but I do have possible (big) change you may want to consider. That is to see if you can use javaFX's Properties to store (and update) your numbers. ...
Imus's user avatar
  • 4,287
4 votes
Accepted

Minesweeper JavaFX app

Thanks for sharing your code. General coding You declare member variables of the same type in one line. This is an unusual way to do it. It is certainly not a problem as long as you are the only one ...
Timothy Truckle's user avatar
4 votes

Ensuring threads running infinite loops are terminated before exiting the program

Hello and welcome to code review! My main question is: How often do you write programs that have several threads running throughout the application lifecycle with identical exit condition? It is ...
TorbenPutkonen's user avatar
4 votes
Accepted

Space Invaders clone for a college project

Thanks for sharing your code. Just a few things coming to my mind when skimming over it: Inappropriate inheritance In OOP we create subclasses to extend the behavior of a parent class. Your classes <...
Timothy Truckle's user avatar
4 votes

"2048" game in JavaFX

GameMatrix isn't easily constructible, as it enforces a singleton pattern. In my view, that's an antipattern, as it makes it impossible to run unit-tests in ...
Toby Speight's user avatar
3 votes

Find anagrams from a file

The method findAnagrams dealing with filePaths, InputStreams and FileNotFoundException is a code smell for me. I expect a method with the name findAnagrams to work with words. Actually, your ...
jkerr's user avatar
  • 31
3 votes

Simple Java password rule enforcing

Start writing some utility classes, you're likely going to be checking if strings are nonempty in other places: ...
Johnbot's user avatar
  • 2,974
3 votes
Accepted

Finance manager

Disclaimer: I have no experience with JavaFX, so I'll focus on other points. Feel free to ask for more details regarding specific advice if needed. Naming Conventions Package names should be ...
Marvin's user avatar
  • 560
3 votes

Java Navigation System for GUI in JavaFX

No need to include class identifier stage.setTitle(APPLICATION_TITLE); Unhandled exception: ...
Stan Van Der Bend's user avatar
3 votes

Simple Java game of a rocket ship flying in space

All constants should be declared in a final variable. ...
Cian's user avatar
  • 116
3 votes

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

I'm not familiar with JavaFX so I'll focus on things not related to it. One thing that I would not recommend is to mix two languages when naming function (or anything really) in your language. You ...
Julien Rousé's user avatar
3 votes
Accepted

Media player component with JavaFX

I've never used fxml or jfoenix, so I may be missing some issues specific to those libraries, but I did notice a couple of points you could think about: The logic in ...
Richard Inglis's user avatar
3 votes
Accepted

Snake Game in Java feedback

This is a very good for a few months of experience! You're on the right track with trying to separate concepts out into objects, but I think you made some strange decisions in your separating of ...
Bailey Parker's user avatar
3 votes
Accepted

JavaFX Connect Four AI

The Move class could have its getters removed by making use of final since its members row ...
Carcigenicate's user avatar
3 votes

Multiple buttons and their event handlers in JavaFX

First thing that comes to mind is subclassing Button, perhaps nesting it in your main class so it can easily modify class variables: ...
Kein's user avatar
  • 133
3 votes

Concerned about thread safety

Please take a look at this library for inspiration on how to state machine could be defined: https://projects.spring.io/spring-statemachine/ Should I change locking system to "fair"? => ...
Alexander Alexandrov's user avatar
3 votes
Accepted

Create an analogue clock interface in Java using JavaFX

Whoever says your code is not following OOP principles should continue by explaining their opinion about the shortcomings. As I see, it's class room code and it's intention is to teach a certain thing ...
TorbenPutkonen's user avatar
3 votes

Class for serializing themes for my JavaFX application

Here at Code Review we're not normally meant to simply suggest alternative solutions, but in this case, you already mentioned the alternative and I'm really just suggesting that you look again at your ...
Jeremy Hunt's user avatar
3 votes
Accepted

Funny TextUIWindow.java and a simple colorful text editor

Re-usability of Widget First, your name is a bit misguiding, since TextUIWindow is not a real Window/...
Martin Frank's user avatar
  • 2,838
3 votes
Accepted

Comparing video recording algorithms in Java: no-compression vs. naive diff compressor

Some improvements: VideoCompressionApp class: This piece of code can be replace with something more elegant: ...
Omar Mahamid's user avatar
3 votes
Accepted

A JavaFX program to find out the mouse refresh rate

Your start doesn't actually throw any checked exceptions, so remove throw Exception (don't worry; this doesn't break override ...
Reinderien's user avatar
  • 62.1k
3 votes
Accepted

A JavaFX program to find out the mouse refresh rate v2

LGTM. Calling .replace(',', '.') seems a curious way to address Locale concerns. Wouldn't you prefer to use the decimal format interface to obtain the desired <...
J_H's user avatar
  • 27.6k
3 votes

Add category section and save in database in admin section with java and javafx using mvc

The architecture could indeed be a bit more like Model-View-Controller, but I would first concentrate on the more clear code usage. It must be said that some knowledge is demonstrated here. Like ...
Joop Eggen's user avatar
  • 3,466

Only top scored, non community-wiki answers of a minimum length are eligible