Here you can find the source of rectangleToString(Rectangle r)
public static String rectangleToString(Rectangle r)
//package com.java2s; //License from project: Open Source License import java.awt.*; public class Main { public static String rectangleToString(Rectangle r) { StringBuilder buf = new StringBuilder(); buf.append(String.valueOf(r.x)); buf.append(","); buf.append(String.valueOf(r.y)); buf.append(","); buf.append(String.valueOf(r.width)); buf.append(","); buf.append(String.valueOf(r.height)); return buf.toString(); }/*w ww . ja va 2 s.co m*/ }