Found 2 Articles for Java RMI

Compare the two Strings lexicographically in Java

Samual Sam
Updated on 19-Jun-2020 14:37:04
The compareTo() method of the String class. This method compares two Strings lexicographically. The comparison is based on the Unicode value of each character in the strings. The character sequence represented by this String object is compared lexicographically to the character sequence represented by the argument string. This method returnsa negative integer if current String object lexicographically precedes the argument string.a positive integer if current String object lexicographically follows the argument.true when the strings are equal.Exampleimport java.lang.*; public class StringDemo {    public static void main(String[] args) {       String str1 = "tutorials", str2 = "point";     ... Read More

Create Toast Message in Java Swing

karthikeya Boyini
Updated on 19-Jun-2020 12:08:08
A toast message is an alert which disappears with time automatically. With JDK 7, we can create a toast message similar to an alert on android very easily. Following are the steps needed to make a toast message.Make a rounded rectangle shaped frame. Add a component listener to frame and override the componentResized() to change the shape of the frame. This method recalculates the shape of the frame correctly whenever the window size is changed.frame.addComponentListener(new ComponentAdapter() {    @Override    public void componentResized(ComponentEvent e) {       frame.setShape(new  RoundRectangle2D.Double(0, 0, frame.getWidth(),       frame.getHeight(), 20, 20));    } ... Read More
1
Advertisements