Let us think of a simple use case to make this hassle more visual. Let us assume that we want to implement a very basic, annotation-driven security framework. This framework is governed by one single annotation: @Retention(RetentionPolicy.RUNTIME) @interface Secured { String requiredUser(); ...
Example Maven project showing how to make Java WAR files executable like JARs using custom class loader - is-already-taken/executable-war-example
The -splash option is new to Mustang. When you run your Java application (MyJavaApplication in the above example) with -splash option, the spash.png will be displayed when your application runs. In fact, your application may not even be aware that it has been 'splashed'. If your applicat...
I’ll explain how to add toString method to a Java class with code examples. Using toString in Java To string method in Java should be informative to make it easy to read. it’s recommended to override this method in each class. By default Java object toString method implementation looks l...
How to migrate from Java 8 to Java 9 and how to make Java 9 migration easier When to migrate to Java 9 How to use the JDeps tool to inspect the code Migrating to Java Jigsaw modules How to solve migration issues like encapsulated internal APIs, split packages, cyclic dependencies, and mo...
This is an important step because you are going to generate the manifest file, don't forget to choose the main class. This is important to make your JAR an executable JAR file. Remember themain methodis the entry point of any Java application. ...
In this article, you will learn how to make your own clicker game that runs on the Java Spring Boot application. The objective of the clicker game is to count the amount of clicks on a chosen image. In this particular example, we will allow the user to click on an image of a cat ...
These are the same features that JFrame has, and using JDialog directly is very similar to using JFrame. If you're going to use JDialog directly, then you should understand the material in Using Top-Level Containers and How to Make Frames, especially Responding to Window-Closing Events. ...
By default, when the user closes a frame onscreen, the frame is hidden. Although invisible, the frame still exists and the program can make it visible again. If you want different behavior, then you need to either register a window listener that handles window-closing events, or you need ...
Learn how to make a deep copy of an object in Java.Learn different ways to create a deep copy of an object in Java, and why to prefer a deep copy over a shallow copy.