Java Rectangle Create Parse stringToRectangle(String str)

Here you can find the source of stringToRectangle(String str)

Description

string To Rectangle

License

Open Source License

Declaration

public static Rectangle stringToRectangle(String str) 

Method Source Code

//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
}

Related

  1. rectangleToString(Rectangle rectangle)
  2. storeBounds(String name, Window window)
  3. stringToBounds(String str, Rectangle defaultRect)
  4. stringToRectangle(String s)
  5. stringToRectangle(String s, Rectangle defaultValue)
  6. stringToRectangle(String string, Rectangle defaultValue)
  7. stringToRectangle(String value)