I’m new to Java and I’m playing around with a simple GUI example. After having received a good answer to my last question, I tried to take it one step further and to scale the shape with the frame size (with fixed aspect ratio). Indeed, when I change the window size, the shape scales with it. Howe…
Gradle project builds successfully but IntelliJ cannot resolve references
Every usage of the following Kotlin library compiles and can be used, but IntelliJ’s autocomplete (and perhaps others) cannot resolve the references. https://gitlab.com/7Hazard/altv-kotlin I am using it as a dependency via JitPack: https://jitpack.io/#com.gitlab.7Hazard/altv-kotlin JDK 11, Gradle 6.3 (w…
SpringBoot – Java AWS SDK 2 DynamoDB Enhanced Client and devtools problem
I am using Spring Boot 2.17 and java sdk and dynamodb-enhanced ‘2.13.8’. I am calling with the enhanced client an item like this: it leads when called to this error: Switching the livereload to enabled: false did not help but completly removing the devtools worked. But this a not statisfying solut…
Using static methods with Spring Security to get current user details
I have a requirement to get the details of the current user who has been loggedIn. To get the details, we can use the SecurityContextHolder.getContext() and extract the details. According to, SecurityContextHolder, SecurityContext and Authentication Objects By default, the SecurityContextHolder uses a ThreadL…
JScrollPane doesn’t show up in JFrame
there. I’m writing a GUI chat client which sends message to the server and receives echoes from the server. The top half of the client JFrame contains a JTextArea wrapped in a JScrollPane which is placed under the menubar. This JScrollPane is responsible for receiving responses from the server which rec…
Error when running docker container “NoClassDefFoundError”
I am trying to dockerize a simple Spring Boot Application, built with Maven. Dockerfile: When I run the .jar without the container (java -jar target/backend-1.0-SNAPSHOT.jar), everything works fine and the app is running. Now I create the container with docker build -t company/backend . But when I try to run …
How to include a file from a directory above in Maven src.xml?
I want to include the .gitignore file in my Maven project when it is getting packaged. (My university wants the file so they can see that I used it the right way) But the .gitignore is on the …
Profiling Java code changes execution times
I’m trying to optimize my code, but it’s giving me problems. I’ve got this list of objects: There is 1700 objects with unique id (0-1699) and some name, it’s used to decode what type of data I get later on. The method that I try to optimize works like that: This method is called about …
Java: Is there a more efficient way to write JFrame elements into an array?
This is my first time posting so I apologize if the question is too vague or I do not describe my problem so well. I am working on a Java JFrame project and have run into a small issue. I need to instantiate arrays of various frame elements. What I have done as of now works, however, it is very
In my chat app i have this error java.lang.NullPointerException
I making chat app .. and I have this problem when i click in any user to start chat with him. but for first time when i get into chat and i send first message it has been sent “in my firebase i see it”…