Java Rectangle Create Parse stringToRectangle(String s)

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

Description

string To Rectangle

License

Open Source License

Declaration

public static Rectangle stringToRectangle(String s) 

Method Source Code


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

Related

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