8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import java.awt.*;
25
26 /*
27 * @test
28 * @summary An attempt to set non-trivial background, shape, or translucency
29 * to a decorated toplevel should end with an exception.
30 * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
31 * @library ../../../../lib/testlibrary
32 * @build ExtendedRobot
33 * @run main DecoratedExceptions
34 */
35 public class DecoratedExceptions {
36 public static void main(String args[]) throws Exception{
37 ExtendedRobot robot = new ExtendedRobot();
38 Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait(() -> {
39 Frame frame = new Frame("Frame");
40 frame.setBounds(50,50,400,200);
41 try {
42 frame.setOpacity(0.5f);
43 throw new RuntimeException("No exception when Opacity set to a decorated Frame");
44 }catch(IllegalComponentStateException e) {
45 }
46 try {
47 frame.setShape(new Rectangle(50,50,400,200));
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import java.awt.*;
25
26 /*
27 * @test
28 * @key headful
29 * @summary An attempt to set non-trivial background, shape, or translucency
30 * to a decorated toplevel should end with an exception.
31 * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
32 * @library ../../../../lib/testlibrary
33 * @build ExtendedRobot
34 * @run main DecoratedExceptions
35 */
36 public class DecoratedExceptions {
37 public static void main(String args[]) throws Exception{
38 ExtendedRobot robot = new ExtendedRobot();
39 Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait(() -> {
40 Frame frame = new Frame("Frame");
41 frame.setBounds(50,50,400,200);
42 try {
43 frame.setOpacity(0.5f);
44 throw new RuntimeException("No exception when Opacity set to a decorated Frame");
45 }catch(IllegalComponentStateException e) {
46 }
47 try {
48 frame.setShape(new Rectangle(50,50,400,200));
|