Maven Coordinates JavaXT releases are available via Maven using this site. All other Maven repositories, including Maven Central, are out of sync with this site. To add this maven repository to your project, simply update your project pom.xml file. Example: <repositories> <repository> <id>javaxt.com</id> <url>http://www.javaxt.com/maven</url> </repository> </repositories> Next, you will need to add one of the …
How to run a JavaFX project with Scene Builder in intelliJ
1. Check JavaFX plugin 2. Check the JavaFX project 3. Check the necessary dependencies 4. Search "javaFX" and open in preference 5. Configuration path to scenebuilder, and open scenebuilder to import FXML file
Generics in Java
Generics mean parameterized types. The idea is to allow type (Integer, String, … etc, and user-defined types) to be a parameter to methods, classes, and interfaces. Using Generics, it is possible to create classes that work with different data types. For example: // A Simple Java program to show working of user defined // Generic …
How to fix “Caused by: java.lang.NoClassDefFoundErr”
Use code below to compile and run our program: javac -d . Caller.java java com.Caller
How to install JavaFX on Mac
The simplest way I have seen is to use brew: brew tap bell-sw/liberica brew install –cask liberica-jdk15-full Then we could use terminal at least to run our JavaFX program. However, I think here would be more setting steps if you wanna run it in some IDE.
Java Development Configuration in VS Code MacOS
Got jdk path /usr/libexec/java_home -V Set JAVA.HOME VSCode -> Code -> Preference -> setting -> enter java.home -> setting.json
How To Customize Spring Project Launch Banner
When we luanch Spring Project, we could saw Spring Banner in our console as below: What if we want to customize this banner using personal name、company name or even some interesting picture? First we should use this website to transfer text to ASCII. Then we could copy the ASCII content generated and paste it into …
Continue reading “How To Customize Spring Project Launch Banner”
Why do we should use intValue() to compare?
The Integer.intValue() is used to get the primitive int value of Integer. The other test cases pass for you because the int values are low and the auto-unboxing feature of java does the value comparison for you. But for this one test case the int values are pretty large and hence it leads to object …
Continue reading “Why do we should use intValue() to compare?”
Why use Deque over Stack in Java
From JavaDoc for Stack, we could see: "A more complete and consistent set of LIFO stack operations is provided by the Deque interface and its implementations, which should be used in preference to this class. For example:" Deque<Integer> stack = new ArrayDeque<>(); Here are some answers from Why should I use Deque over Stack?. Inconsistency: …
An example to overwrite comparator in method to customize sorting of array
I still feel confused when I want to customize the way of sorting for array and collections in java. And here is a good example of how to write a customized sorting function to sort string array: Comparator<String> comp = new Comparator<String>(){ @Override public int compare(String str1, String str2){ String s1 = str1 + str2; …
Continue reading “An example to overwrite comparator in method to customize sorting of array”