Category "java"

Drawing with drawString doesn't look good

The result of drawString with the same font and size in java The appearance is different when drawn with the same font and size in a painter (or word). Drawing

Program ends after entering a string in Java

I've been looking for different solutions out here but on my code they won't work. I'm getting an input from a user but then it doesn't display what's inside th

Fixing green YUYV frame format being streamed using OpenGlView

I am using a library to do RTMP streaming from an USB/UVC camera in android. The library I am using is this one. This library works just fine for android USB ca

Decrypting encrypted encoded string containing SAML assertion using OpenSAML in java

I'm trying to build utility that accepts an encrypted/encoded string containing a SAML 2 assertion string and spits out a decrypted/decoded assertion as plainte

Why does webapp specific context in tomcat 10 no longer work?

My application (SimpleWebApp) needs some context parameters defined. I have a SimpleWebApp.xml context file with the following content: <Context>

Seek method for javafx MediaPlayer does not seek correctly for 1.5 hr+ long audio files

I recently fixed a bug where the javafx MediaPlayer would break whenever I disconnected my bluetooth headphones. I fixed that by doing this. mediaPlayer.set

Can you listen for SpringCamelContext status?

Using EventNotifierSupport, I can listen for CamelContextStartedEvent. However, I need to add one more root to the context, after all the other routes have alre

Do I need this many blocks in my launch.json file?

I have had this launch.json file look this way for most of the time I have had my project. I am not entirely sure what the file's purpose is or what the specifi

XmlMapper: read XML values without assigning a class for the created objects

I am trying to implement a multi language interface for my project and for this I want to load the data for the 3 languages from XML file. The problem is that w

Is there a way to configure the memory resources for Spark using Pyspark

I'm working on an ETL job with an SageMaker notebook that uses spark 2.4.0. After joining a couple of tables I keep getting the following errors: Update-- I was

Moving to the Spring Boot. Migration of logic from the old main class

I am very new to Spring Boot and development, so, I am stuck with a problem. I have an old project that needs to be migrated to Spring Boot. The original main m

IllegalAccessError: ClassA and class B are in unnamed module of loader 'app'

I have a spring @Configuration bean which initializes a class A. This class A, in its constructor, calls another static method in class B. When spring initializ

mySQL java union

i used this query java and mysql but its not work (if i send directly mysql console its work bun in java not work.) Here down is my code: PreparedStatement pst;

How to solve (java.lang.IllegalStateException: Not on FX application thread)?

I am working on simple Brick Breaker game on JavaFX. Until now everything was working fine but when I tried to add Label which was updating time it showed up th

Spring Batch - RepositoryItemReaderBuilder with RepositoryMethodReference throws Cannot subclass final class

I'm trying to use Spring Batch RepositoryItemReaderBuilder with RepositoryMethodReference as parameter to provide type-safe way to call repository methods. unfo

Hibernate - Map View to Entity - view is not mapped [SELECT la FROM ListAgent la]

In an effort to power an autocomplete, I resolved to map a PostgreSQL view. I followed a tutorial for this. It seems that it does not work at all : I've always

OpenApi enum with multiple values

I am new to OpenApi and want to define my api with an api.yaml (OpenApi version 3.0.1). My problem is the generated enum just contains the name and not the valu

StringIndexOutOfBoundsException when trying to count 'a's in the entered word in Java

public class methods { public static int howMany(String word) { char character = 'a'; int a = 0; for (int i=0;i<=word.length();i+

I'm using PDFBox to replace text, strange characters

I'm using PDFBox to replace text in a template and there are characters (e.g. a simple J) that the tool recognizes as a special character. Any help to solve thi

Java stream min/max of separate variables

How can I determine both the min and max of different attributes of objects in a stream? I've seen answers on how get min and max of the same variable. I've als