String color = HTMLColors.decodeColor("00CC00"); // return "#00CC00" color = HTMLColors.decodeColor("#00CC00"); // return "#00CC00" color = HTMLColors.decodeColor("black"); // return "#000000" color = HTMLColors.decodeColor("white"); // return "#FFFFFF" color = HTMLColors.decodeColor("White"); // return "#FFFFFF" color = HTMLColors.decodeColor("cornflowerblue"); // return "#6495ED" color = HTMLColors.decodeColor("cornflowerBlue"); // return "#6495ED"
Color color = HTMLSwingColors.decodeColor("00CC00"); // return Color(0, 204, 0) color = HTMLSwingColors.decodeColor("#00CC00"); // return Color(0, 204, 0) color = HTMLSwingColors.decodeColor("black"); // return Color(0, 0, 0) color = HTMLSwingColors.decodeColor("white"); // return Color(255, 255, 255) color = HTMLSwingColors.decodeColor("White"); // return Color(255, 255, 255) color = HTMLSwingColors.decodeColor("cornflowerblue"); // return Color(100, 149, 237) color = HTMLSwingColors.decodeColor("cornflowerBlue"); // return Color(100, 149, 237)
The é or è
text will be converted to The é or è
text==> my ====> resources ======> resource.xml ====> package ======> MyClass.javaWe can use the following code to retrieve the
resource.xml
resource in the MyClass
class:public class MyClass { public static void main(String[] args) { ResourceLoader loader = new ResourceLoader("my/resources"); URL resourceURL = loader.getURL("resource.xml"); } } ClassLoader parentLoader = Thread.currentThread().getContextClassLoader(); URLClassLoader loader = new URLClassLoader(urls, parentLoader); ResourceLoader loader = new ResourceLoader("my/package", loader); URL resourceURL = loader.getURL("resource.xml");
MessageProvider provider = MessageProvider.getInstance(); provider.createBundle("aKey", "org/myresources/", "messages.properties");or
MessageProvider provider = MessageProvider.getInstance(); provider.createBundle("anotherKey", url);
MessageBundle bundle = MessageProvider.getBundle("aKey"); String message = bundle.getMessage("propertyName");
Class-Path
property.L:/my/JarFile.jar
:Class-Path: myJar1.jar \ myJar2.jarThe JarDependenciesFinder.getJarDependencies(URL, boolean) will return the following URLs with
include
set to false:L:/my/myJar1.jar
L:/my/myJar2.jar
ExecutableFinder finder = new ExecutableFinder(false); finder.addAllRoots(); List<File> files = finder.getExecutables("python*", "*.exe");
ExecutableFinder finder = new ExecutableFinder(false); finder.addRootFromEnv("programfiles"); List<File> files = finder.getExecutables("netbeans*", "bin/*.exe");
PlainDocument
class does not implement the Cloneable interface, but is is serialisable, so we can perform:PlainDocument myDoc = ... SerializingCloner cloner = new SerializingCloner<PlainDocument>(); PlainDocument doc = cloner.deepCopy(myDoc);
java -version
.python
processes sorted by their creation date:ProcessManager manager = new ProcessManager(); SortedMap<Long, List<ExternalProcess>> processes = manager.getProcessByCreationDate("python.exe");Each process found by the ProcessManager have the following methods:
System.currentTimeMillis()
methodgetKillProcessTimeOut()
is less than 0 (the default), then no wait will be performed after the execution of the KILL commandgetKillProcessTimeOutCount()
:getKillProcessTimeOut()
java.library.path
property after the start of the JVM. Note that this method will only work for Java 8 up to Java 14.java.library.path
is read only once when the JVM starts up. If you change this property using System.setProperty
, it won't make any difference.--add-modules
declaration)--add-opens
declarations--add-exports
declarationsCopyright 2006-2024 Herve Girod. All Rights Reserved. Documentation and source under the LGPL v2 and Apache 2.0 licences