Found 1 Articles for Java RMI

Create Toast Message in Java Swing

karthikeya Boyini
Updated on 19-Jun-2020 12:08:08

846 Views

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