To automate certain tasks, sometimes we might need to simulate the real mouse click. In this article we will see how to simulate the real mouse click in Java. Using Robot class Using the Robot class, we can generate native…
It’s a general use case for all the applications to know the today’s date in Java. For example, we might need to insert the current or today’s date & time by default when we create a transaction. In this article,…
JSON also known as JavaScript Object Notation is a widely used format for exchanging data between a server and a client. In this article, we will see how to parse a JSON input stream using the Jackson library in Java….
In Java, we might need to perform various modifications on the dates, such as adding or subtracting days from them, to know the future scheduled date or the past. In this article, we will see how to add days to…
In every web application, it is a common requirement to include some parameters in the HTTP requests. In most cases, these parameters are retrieved from the database and stored internally in some data structures, such as maps. In this article,…
File sizes are usually represented in bytes, but for better understanding, we may often need to display the file size in more human-readable units like MB, KB & GB. In this article, we will see how to get the size…
As developers, we may need to measure the execution time of specific methods to identify their performance and optimize the code. In this article, we will see how to time profile Java method execution. Java’s System library has a method…
In this article, we will see how to load an image from a file path and convert it into a Bitmap or a Drawable. To create a Bitmap we can use the java.awt.Image and javax.swign.ImageIcon for Drawable. These classes provide…
In many applications, it is common to work with time durations represented in seconds. For better user experience, we often need to convert these time durations into a more human-readable format, such as days, hours, minutes, and seconds. In the…
The “java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException” is a common runtime error we may encounter when running applications, particularly in newer Java versions. If you are facing this error then follow this article to know the possible causes of this error and how to…