Blog– category –
-
Java
Java Finds the current (today's) day of the week
[] This is a sample program that uses the Calendar class in Java to obtain the current (today) day of the week. Use Calendar.DAY_OF_WEEK to retrieve it. Calendar cal = Calendar.getInstance(); int week = cal.get(Calendar.DAY_OF_WEEK); Calendar.DAY_OF_WE... -
Web Conferencing Video Calling
Web conferencing and video calling with desktop and mobile integration Win/Mac/Android/iOS v4.03.07
[Function addition] Chat&Messenger released voice and video call functions exclusively for LAN in 2009 (see Window Forest news article), and about 10 years later, the concept has been renewed with cloud and mobile. The concept is as follows. Chat&Messenger... -
Java
Get Java memory usage
[] Returns the "total", "usage", and "maximum usable" information about the memory information of the Java virtual machine. The explanation of each item is as follows. Total...Runtime.getRuntime().totalMemory() is the amount of memory allocated to the Java virtual machine. amount to use···... -
Java
Output Java system properties in an easy-to-read format
[] Introducing a sample program that outputs system property keys and values in alphabetical order in Java for easy viewing. Once stored in TreeMap, it is sorted alphabetically and then output. Usually, the following methods are well introduced, but the value is... -
Java
Execute Java external command and get 3 results
[Obtain the result of )] Introducing a sample program that launches commands and external executable files such as batch shells in Java. Also, at the same time as the external command is executed, the standard output, error output, and return code are obtained as the return value of the method. Usually, outside of Java... -
Java
Get hostname from Java IP address
[] This is a sample program that obtains the host name (machine name) with the specified IP address. [] /** * Gets the host name with the specified IP address. * @param address IP address * @return host name * *If an unexpected exception occurs, the string "Unk... -
Java
Get the hostname of the machine running Java
[] Introducing a sample program that obtains the host name (machine name) of a machine running in Java. The sample program obtains the host name using the following method. Importing an InetAddress representing the local host using java.net.InetAddress.getLocalHost()... -
Java
Copy to Java Clipboard
[] Introducing sample source for copying a string to the clipboard using JavaSwing. Use java.awt.datatransfer.Clipboard to operate the clipboard in JavaSwing. Clipboard is retrieved like this. Clipboard clipboard = Toolkit.getDefaul... -
Java
Java Get end-of-month date
[] This is a sample program that obtains the end of the month date of a specified date in Java. The end date of the month can be obtained using getActualMaximum(Calendar.DATE) of the java.util.Calendar class. [] /** * The last day of the month in the specified date string (yyyy/MM/dd or yyyy-MM-dd) *... -
Java
Java Date validity/existence check
[] This is a sample program that checks the validity and existence of dates in Java. Checks whether the specified date string (yyyy/MM/dd or yyyy-MM-dd) exists on the calendar. If you specify false for setLenient() of the java.text.DateFormat class, date parsing... -
Java
Java Date/Time Calculation Addition and Subtraction Made Easy
[] Introducing a sample program that easily calculates addition and subtraction of dates and times using Java. The characteristics of the sample program are as follows. Returns the result of adding or subtracting the specified amount of time from the current or arbitrary date/time. If you specify a positive number, the time... -
Java
Java Find the difference between the number of months between two dates
[] Introducing a sample program in Java that calculates the difference in the number of months between two dates. In the sample program, the date to be compared is a string (yyyy/MM/dd) or java.util.Date. The calculation method for calculating the difference in months is as follows. First two... -
Java
Java Find the difference between two dates
[] Introducing a sample program to find the difference between two dates in Java. In the sample program, the date to be compared is a string (yyyy/MM/dd) or java.util.Date. The calculation method to find the difference in dates is as follows. First two days... -
Java
Save objects with Java XMLEncoder
[] Introducing a sample program that saves objects in XML format using Java. Use java.beans.XMLEncoder for XML output. We will also introduce a sample program that uses java.beans.XMLDecoder to restore a saved object. [] Plastic... -
Java
Java recursively searches for files
[] Introducing a sample program in Java that recursively searches for files from a specified directory, including subdirectories, and obtains a list of files that match the search conditions. These are equivalent to the UNIX command ls -R and the Windows command dir /s... -
Java
Java File Copy (easy and fast)
[FileChannel#transferTo] Introducing a sample program to copy files in Java. The sample program uses the New I/O java.nio.channels.FileChannel#transferTo method introduced in J2SE1.4. Buffer required for loading data... -
Java
Java file copy (change buffer size)
[] Introducing a sample program that performs copy processing using input/output streams using java.io.InputStream and java.io.OutputStream in Java. In copy processing using streams, by increasing the read buffer size, even large files can be relatively... -
Java
Displays a list of files in the Java directory
[] Introducing a sample program in Java that displays a list of files in a specified directory. To display the file list, use the following method of the java.io.File class. list()...Files and directories contained in the specified directory... -
Java
Get extension from Java filename
[] This is a sample source for getting the extension from a file name in Java. [] /** * Returns the extension from the file name. * @param fileName File name * @return File extension */ public static String getSuffix(String fileName) { if (fileName == null) ... -
Java
Convert URLs in Java strings to links
[] This is a sample source that converts a URL in a string into a link (a href=...) using regular expressions in Java. 【】 /** Regular expression pattern for extracting URL */ public static final Pattern convURLLinkPtn = Pattern.compile ("(http://|https://){1}[\\w\\.\. ..