Here you can find the source of stringToRectangle(String str)
public static Rectangle stringToRectangle(String str)
//package com.java2s; //License from project: Open Source License import java.awt.*; public class Main { public static Rectangle stringToRectangle(String str) { if (str == null) return null; String[] r = str.split("\\s*,\\s*"); int x = Integer.parseInt(r[0]); int y = Integer.parseInt(r[1]); int width = Integer.parseInt(r[2]); int height = Integer.parseInt(r[3]); return new Rectangle(x, y, width, height); }//from w ww . ja va 2 s . com }