Category "java"

Dynamic JFreeChart for custom X-Axis values

I make a JFreeChart for displaying values from serial port. It is working well, but I want to make X-axis movable from right to left. It means when plotting the

Is there an expiring map in Java that expires elements after a period of time since *first* insertion?

I tried looking at cache mechanisms, such as Guava's Cache. Their expiration is only since last update. What I'm looking for is a data structure that stores ke

How to split a readLine but dont split values inside apostrophes?

Example txt file ADD 'Cordless Screwdriver' 30 1 2 COST 'Multi Bit Ratcheting' FIND 'Thermostat' FIND 'Hand Truck' SELL 'Hammer' 1 QUANTITY 'Paint Can' FIRE 'Jo

How do I capture the time a tcp socket is moving from ESTABLISHED TO WAIT state

I have a Java WebSocket server that uses Netty to establish WebSocket connections. This is basically a chat application where a few agents will be interacting w

Best way to convert a List<Object> to List<Object.Property>

Consider the following use case: I have List<Song> which holds an ArrayList. I want to translate the above on-the-fly to List<String> which may be a

Parentheses around data type?

I am a beginning programmer and came across this in my textbook: public boolean equals(DataElement otherElement) { IntElement temp = (IntElement) otherElem

Searching data in the JTable using

I have a table that I post with a database connection. I am searching the table, but after searching, selecting the row and bringing the result to the textbox r

Binary tree not clearing with each loop iteration

I am using a binary tree to convert prefix expression into infix, and then solving them. That part works fully. My issue is the input loop I set up is adding on

How to fix 'java.lang.NoClassDefFoundError: org/springframework/validation/annotation/ValidationAnnotationUtils' In Spring MVC

I have Spring MVC application with JSP and the server is Tomcat. when I run this web application. Tomcat log as follows. 24-Feb-2022 16:13:16.054 SEVERE [http-n

Firebase functions deploy errors

I've deployed firebase deploy in cmd console. but error has occured several times. I already tried these things: Changing %RESOURCE_DIR% in firebase.json file T

Wildfly 26 elytron security domain config is not working

I am trying to migrate an application to wildfly 26, and i am trying to use elytron to secure the application. I successfully run this commands using the jboss

Can a custom serializer/deserializer be a Spring bean?

I have a field in a POJO which needs to be encrypted before being serialized and, similarly, decrypted upon deserialization. The issue is that a cryptor is a Sp

What is the meaning of the construction in array initialization?

I was solving tasks and saw a construction like that: String t[] = new String[n], e; Can you help me, what does ", e" mean? Wasn't able to find something about

How can I create a truststore from a base64 encoded String?

I have a String that is encoded in base64, I need to take this string, decode it and create a truststore file, but when I do that, the final file is not valid.

How to wait until file is downloaded and also wait until the file is deleted from folder in Selenium Java

Have to download a file in multiple formats xls, pdf, rtf, csv, txt. But I have to check all these file formats are downloaded one after another So I have writt

The method setColor(Color) is undefined for the type JFrame

Error code shown below : The method setColor(Color) is undefined for the type JFrame package task3; class Execute { public static void main(String[] a

Is there an alternative to the builder pattern that is preferred in C++?

I'm coming from Java where the builder pattern is used heavily, e.g. Foo foo = new FooBuilder() .setBar(43) .setBaz("hello, world!") .enableCache(tr

How do I access index from filter in java?

I'm planning to convert the following without a for loop and using functional programming: int count = 0; for (int i = 0; i < 5; i++) { //Feedback: avoid for

Why Unicode u+202e and u+202c cause output text to have a different result

In Java: If I print "123\u202e987\u202c456abc" then the result is 123‮987‬456abc If I print "123\u202e987\u202cxyzabc" then the result is 123‮

B2c accelerator hybris 1905 : install.bat -r b2c_acc_plus not working

I have an exception when I try to run install.bat -r b2c_acc_plus , can you help me to resolve it ? java.lang.NoClassDefFoundError: Could not initialize class o