Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 9 months ago. Improve this question how to create a timer for 2 minutes by pressing the button? I want to create a button that …
Tag: java
How to access a variable from one class controller file to another in JavaFX?
So I have an integer number called “size” saved to a controller class called SettingsStageController.java and I want that variable to be accessed through my other controller class file called GameStageController.java but I can’t seem to find out how. SettingsStageController.java GameStageCon…
Spring Data Jpa: persisting child entities from parent entity does not update child identity
Environment: OS: Ubuntu 20.04 LTS Java: OpenJDK 17.0.3 Spring Boot: 2.6.7 MySQL: 8.0.29 Is it normal for Spring Data Jpa (or Jpa in general) to NOT update child identity attributes when the child is persisted (saved) via the parent entity repository? Consider this: When I call someClassFunction() I get: The d…
Remove duplicate letters from a string sentence while keeping the spaces from the sentence
I am trying to take a sentence that a user has entered into a String variable and remove the duplicate letters while keeping the spaces in the sentence. For example if a user enters “hello my name is danny” it will return “Helo my nam is dn”. To do this I have already tried this code: …
Update statement is no query?
How do I define the update statement in the orm.xml. I have it as a named-query and everything works, but my teacher said that an update statement isn’t a query. I have tried a native query, but that wasn’t working. ORM-Type: Update Statement: Answer The term “query” is used rather amb…
Adding multipart file as an attachment to an email in Spring Boot
I want to send an email from Spring Boot with a pdf attachment. I have received the pdf file as a multipart file from a POST call. Here’s my controller class so far (sendEmails method is included in emailService service): And here’s sendEmails method: Now, in the sendEmailAndUpdate method I have t…
Springboot 2.5.6 gives java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: OffsetSeconds issues
Since migration to springboot 2.5.6 I have to register our ObjectMapper with JavaTimeModule. However, I am getting the below error for the format “yyyy-MM-dd’T’HH:mm:ss.SSSZ”. How can I fix it? The input time that we get is something like 2020-07-01T10:00:00.000+0000 Error Our Serializ…
why is this still need to cast in java?
error right DefaultLiteProcessScope extends DefaultLiteProcessScope,but it is till need to be cast?why? Answer What you are doing here is wrong. You want to return some subtype of DefaultLiteProcessScope from the build method. However, you hard code the return type like this: new DefaultLiteProcessScope(). No…
Java API POST Call with special characters
I currently have a POST call with HTTPClient framework using JAVA, the method is not ours and i have found an interesting problem with the special characters. The call is sending a JSON Object, not using URL parameters. The call works well in my code and in postman but, if I put some special characters in the…
Java Web Scraper project is returning null instead of normal links
Used maven for htmlunit dependency for the webscraper. The main issue is that my scraper returns null instead of links. I made an item class to set and get. } Result: basically a line of null going down *note: Putting System.out.println(link) returns one link and reuses that same link as it prints new line, i…