Here you can find the source of stringToRectangle(String s)
public static Rectangle stringToRectangle(String s)
//package com.java2s; //License from project: Open Source License import java.awt.Rectangle; public class Main { public static Rectangle stringToRectangle(String s) { try {/*from w w w. j av a 2 s . c o m*/ String[] split = s.split(","); if (split.length >= 4) return new Rectangle(Integer.parseInt(split[0]), Integer.parseInt(split[1]), Integer.parseInt(split[2]), Integer.parseInt(split[3])); } catch (Exception e) { } return null; } }