Skip to content

JNA calling CoInitialize when loading a dll

I’ve got a dll written in Pascal. I’ve determined that I need to run CoInitialize in the Java code, but I just can’t figure out how. I found another Stack Overflow thread which should have helped here: https://stackoverflow.com/questions/15763993 but I couldn’t understand how it actual…

How to send an email to multiple recipients in Spring

The email gets sents only to the last email address in the String[] to array. I’m intending to send to all email addresses added to the array. How can I make that work? Answer You have the choice to use the following 4 methods. I have provided examples of the two methods useful in this case. I have cons…

Criteria Restriction by date field

I have 2 tables, Partner and Visit. A partner can have many visits, also various in same day. I need to create a Criteria restriction to know how many days the Partner has visits since a given date. So, 2 or more visits in same date must be only one. Can this be done only by Criteria and Restrictions?? I

Pass an argument that starts with ‘@’ to jcommander

I am using JCommander(version 1.32) to parse command line arguments passed to a java application(let’s call it app). The problem I have is that one of the arguments I need to pass begins with @ and as can be seen here there is a special syntax for @. Thus calling the app with app @arg fails with Could n…

Increase resolution of java screenshot

I am using the following code to take a screenshot in Java: This code works, but the screen shot outputted is fairly low resolution. How can I increase the resolution of the screenshot? Answer There is nothing wrong with this code. I have a screen resolution of 1680×1050 pixels, and the generated png fil…

Why Java locales are not constants?

Java supports the Locales shown in this link. But I can’t figure out why only some countries such as France, Canada, China and United States and some languages such as Italian, Japanese and German have constants for their locales. Everytime a need a locale, I consult the table of supported locales and d…