I created a frame and panel (for Graphics) and add buttons to the panel. However, when I run my program buttons are not visible until I hover over them. Maybe it is something wrong with graphics methods. How the problem can be solved? Answer Your painting code is mostly wrong. For example: If you need to over…
Tag: java
Field … in … a bean of type ‘service’ that could not be found
I’m trying to use an object which is in an external library, but when I use the @Autowired property, it is not found by the application. The main application has the following annotations: In the com.XXXX.prj.business.modules I have a class that calls the object of the dependency, called MailService, in…
While loop is not working as expected. Everything seems to be correct. How do I fix this problem?
So I have this program: This program is supposed to prompt the user to enter their name. And it is supposed to keep prompting them until they actually enter their name meaning that if they keep the input field blank and press enter, they will get prompted again. However, this program does not do that. Even if…
I’m receiving an java.lang.AssertionError in a test using REST Assured
This is the first time for me using Gson and REST Assured, and I am really struggling to be honest. I need to verify that the content type is JSON and it is, but the test fails with the following message that you will see below. I am not writing all the imports that I have, if it is needed
ActiveMQ – Applications unable to connect for a minute on localhost. Eventual reconnect using failover
I’m running an ActiveMQ broker (version 5.15.12 and later downgraded to 5.15.8) on a windows server on which several local applications are running that are connecting. During heavier than average load on ActiveMQ, it happens regularly that the initial connection to ActiveMQ cannot be made by the applic…
How to obtain the info inside a String without length and indexOF. (JAVA)
I have an api which returns a String in the following format: ACTNEW_38_0001,ACTO_57999 I need to extract the numerical values (57999, or 38_0001) but: 1: They can arrive in different order. 2: It can arrive only one of them. 3: It has to be lightweight. I roughly know how to do it. My actual code looks more …
Runnable interface instantiation
I am following the book Head first java and was reading about threads and came to know about the Runnable interface. Now we know an interface can’t be instantiated directly. Its members are implemented by any class that implements the interface , but below code made bouncers over my head. The book decla…
IntelliJ Idea IDE: Abnormal build process termination. How to fix that?
I guess that’s because of Cyrillic symbols in paths which IDE cannot digest correctly during build process, but I cannot just rename this folder in Windows 10. Tried to make a junction using MKLINK J, but it didn’t help.. I suppose the Cyrillic symbols in Windows username made the IDE throw but I …
Reading input from 2 files and writing to a third file in ascending order
I have 2 files that each contain a series of ordered numbers, separated by spaces (” “). Write a program that produces a third file that will contain the ascending sequence of numbers. When solving, you are not allowed to use any type of collection. File 1: 1 18 40 100 File 2: 0 10 15 80 1001 I ma…
Make method accept only parameter with particular annotation
I have a method And I have a class which holds field And I have main class, where I call that method and pass him that: Problem is that the method accepts all the 3 parameters, (no warnings, errors, nothing) however only roomDao is annotated. Annotation itself: How to make the restriction, so that injectConfi…