< prev index next >

src/java.desktop/share/classes/java/awt/Rectangle.java

Print this page

        

@@ -920,11 +920,11 @@
      * {@code Rectangle}, {@code contains} returns
      * {@code false} for that point.
      * If the specified point must be contained within the new
      * {@code Rectangle}, a 1x1 rectangle should be added instead:
      * <pre>
-     *     r.add(newx, newy, 1, 1);
+     *     r.add(new Rectangle(newx, newy, 1, 1));
      * </pre>
      * @param newx the X coordinate of the new point
      * @param newy the Y coordinate of the new point
      */
     public void add(int newx, int newy) {

@@ -971,11 +971,11 @@
      * enlarged {@code Rectangle}, {@code contains} returns
      * {@code false} for that {@code Point}.
      * If the specified point must be contained within the new
      * {@code Rectangle}, a 1x1 rectangle should be added instead:
      * <pre>
-     *     r.add(pt.x, pt.y, 1, 1);
+     *     r.add(new Rectangle(pt.x, pt.y, 1, 1));
      * </pre>
      * @param pt the new {@code Point} to add to this
      *           {@code Rectangle}
      */
     public void add(Point pt) {
< prev index next >