Skip to content

Tag: java

Finding the longest word ArrayList /Java

I want to write a method which finds the longest String (word). The output should be the longest word in case of two words with the same lenght the output should be: “More than one longest word”. I used ArrayList and almost had a solution, but something goes wrong. The case is that I have a proble…

set class fields based on enum value

Using the above code I can get the value of Tempclass fields based on enum values. Now how to set the fields of Tempclass based on enum value ex: if enum VALUE2 is selected, then i need to set the Tempclass field2 to the input value. Answer Use a BiConsumer<Tempclass, String> taking an instance of TempC…

Database error with Java Spring boot Project

I am trying to run a Java Spring Boot survey project (Maven Architecture) in my local machine by following steps — mvn clean package connect to created jar file java -jar target/filename.jar Open browser and browse to localhost:8080 Project is running ok, I can input survey data, but I am getting follow…

JavaFX TableView with array of TableColumns

I got a TableView<MonthRow> where I want to display each month of the year and its relevant days. I got those three classes for presentation purposes: And then I create the table content: Having the ObservableList now for the TableView, I am kinda stuck. I want to have one TableColumn for the month and …

denoise_TVL1 Sizes of input arguments do not match

I am trying to implement total variation algorithm on a grayscale video. As far as I understand this method(denoise_TVL1) is using that algorithm. But I get “Sizes of input arguments do not match” CvException. Could you help me to understand what the problem is? I have this list as class instance:…

Dockerfile to run a Java 11 class

I’m attempting to write the simplest docker file that will run a main class named InsertVolume in package scripts. Here is my Dockerfile : Here is the result of running command : When I then attempt to run the image using : I receive error : The mvn command mvn compile exec:java -Dexec.mainClass=”…

Get imageView resource

i have been searching for hours, and cant seem to find an answer i have a chess board and its made of 64 imageViews (8X8) and i want to move one pawn to another square, and cant seem to find the way to get the image resource (which is a png image) and set it on the empty square. i