Category "java"

Handle back button in android

I am fragment then I click to button I will transfer to another activity by using startActivity, then in activity I have a back button in screen, I want to back

Paint not showing up on JPanel? I want to paint only if if statement conditions are met

I want to paint the walls of the pacman maze for my APCS A final. I am relatively new to graphics, as you can probably tell. The paintComponent() methods don't

Why does my program keep going to the player() method after p1Game() is finished?

Is there any way I'm able to format my code better too? I'm pretty new to programming and want to learn the best optimal way for this program to work. For examp

How to detect cycle using itarative approach

I am trying to learn how to detect cycle. I see many example of using recursion but I want to implement in iterative way. Here is my code public boolean cycleDe

In java map, I want to assign the repository functions as value like Map<key, function(>

I Want to call the JPA repository functions to access the data from the database based on the String value passed. So I want to make the string as the key and t

Spring Data JPA Redis: Query by multiple values for same key? Query by Example using REGEX not supported

Please let me know if this has been asked before. I have a requirement to do some advanced filtering on data that is stored in Redis cache. Imagine there are 2

Java code to Convert JSON into a Map with specific fields as Key and values

I have a JSON as follows [ { "a": "John", "id": "6", "c": "val1" }, { "a": "Jack", "id": "6", "c": "

Extract data from multiple Excel files

I was basically working on automation of an excel report that I share on a daily basis with the employees. The report gives details on whether or not the employ

merging 2 binary trees- Easy

I am trying to merge 2 binary trees, without worrying about making the resultant tree balanced. Here is my solution which does not work. Why are the Treenode an

Can't figure out how to change Prometheus content type header

So my metrics all appear in one line at my end-point, not in new line per metric. I use micrometer, spring, prometheus and scala. My controller: @RequestMapping

Certificate Chain does not work in mockserver

I would use a Certificate Chain (multiple PEM file merged in one file - end-entity certificate + Intermediate certificate) to do server authentication. I'm usin

how to run java selnium junit Tests using groovy

I am using ReadyAPI which use Groovy as Scripting language. But, I built a Selenium 4 framework which Tests some IHMs in my work using java8 and Junit4, and it

Bouncy Castle signature verification fails for known good signature

I'm working with a platform that sends and receives very large AS/2 S/MIME messages and have problems verifying the signature for multipart/signed. The signatur

Spring batch: How to output list as output for RepositoryItemReader

Hi I have a use case where I should read data from DB and try to combine rows. For example I have one order and many orderDetails. The output of my SQL Query is

JPA Hibernate OneToOne children enity always fetches parent entity

I am having a problem with a OneToOne relationship. Trying to load a children entity will always result in an additional query that loads its parent, even if I

Why Hibernate cant create DB? SQLSyntaxErrorException and CommandAcceptanceException

I have three DBs, of which hibernate can only create 2/3. Can someone explain why hibernate can not create a third table "goods" 1: org.hibernate.tool.schema.sp

How to compress jpg and png images in java?

I used ImageIO library and tried to compress Multipart File but if the extension is jpg then it works fine, but when I used png file then it's not working. I go

SQLITE_BUSY The database file is locked

I'm getting the error [SQLITE_BUSY] The database file is locked (database is locked), even though I close my connection and the statements. Not sure what else

How to search for all records of of type CustomRecordType in Netsuite?

I am trying to get all the records related to a custom record type. How to do it in Netsuite SOAP? Also is there a way to search records of that custom record t

What is the fastest way to split Integer into digits?

I do a lot of operations with splitting numbers into separate digits, putting digits in ArrayList and passing this digits one by one to other ArrayList for furt