1 /* |
1 /* |
2 * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
53 * If the container's {@code ComponentOrientation} property is horizontal |
53 * If the container's {@code ComponentOrientation} property is horizontal |
54 * and left-to-right, the above example produces the output shown in Figure 1. |
54 * and left-to-right, the above example produces the output shown in Figure 1. |
55 * If the container's {@code ComponentOrientation} property is horizontal |
55 * If the container's {@code ComponentOrientation} property is horizontal |
56 * and right-to-left, the example produces the output shown in Figure 2. |
56 * and right-to-left, the example produces the output shown in Figure 2. |
57 * |
57 * |
58 * <table style="float:center;width:600"> |
58 * <div style="margin:0 auto;width:600px;text-align:center;font-weight:bold"> |
59 * <caption style="display:none">Figures</caption> |
59 * <div style="float:left"> |
60 * <tr style="text-align:center"> |
60 * <p><img SRC="doc-files/GridLayout-1.gif" |
61 * <td><img SRC="doc-files/GridLayout-1.gif" |
61 * alt="Shows 6 buttons in rows of 2. Row 1 shows buttons 1 then 2. |
62 * alt="Shows 6 buttons in rows of 2. Row 1 shows buttons 1 then 2. |
62 * Row 2 shows buttons 3 then 4. Row 3 shows buttons 5 then 6."> |
63 * Row 2 shows buttons 3 then 4. Row 3 shows buttons 5 then 6."> |
63 * <p>Figure 1: Horizontal, Left-to-Right |
64 * </td> |
64 * </div> |
65 * |
65 * <div style="float:right"> |
66 * <td style="text-align:center"><img SRC="doc-files/GridLayout-2.gif" |
66 * <p><img SRC="doc-files/GridLayout-2.gif" |
67 * alt="Shows 6 buttons in rows of 2. Row 1 shows buttons 2 then 1. |
67 * alt="Shows 6 buttons in rows of 2. Row 1 shows buttons 2 then 1. |
68 * Row 2 shows buttons 4 then 3. Row 3 shows buttons 6 then 5."> |
68 * Row 2 shows buttons 4 then 3. Row 3 shows buttons 6 then 5."> |
69 * </td> |
69 * <p>Figure 2: Horizontal, Right-to-Left |
70 * </tr> |
70 * </div> |
71 * |
71 * <br style="clear:both;"> |
72 * <tr style="text-align:center"> |
72 * </div> |
73 * <td>Figure 1: Horizontal, Left-to-Right</td> |
|
74 * |
|
75 * <td>Figure 2: Horizontal, Right-to-Left</td> |
|
76 * </tr> |
|
77 * </table> |
|
78 * <p> |
73 * <p> |
79 * When both the number of rows and the number of columns have |
74 * When both the number of rows and the number of columns have |
80 * been set to non-zero values, either by a constructor or |
75 * been set to non-zero values, either by a constructor or |
81 * by the {@code setRows} and {@code setColumns} methods, the number of |
76 * by the {@code setRows} and {@code setColumns} methods, the number of |
82 * columns specified is ignored. Instead, the number of |
77 * columns specified is ignored. Instead, the number of |