2362N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. 1895N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1895N/A * This code is free software; you can redistribute it and/or modify it 1895N/A * under the terms of the GNU General Public License version 2 only, as 1895N/A * published by the Free Software Foundation. 1895N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1895N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1895N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1895N/A * version 2 for more details (a copy is included in the LICENSE file that 1895N/A * You should have received a copy of the GNU General Public License version 1895N/A * 2 along with this work; if not, write to the Free Software Foundation, 1895N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 1895N/A @summary invalidate() must stop when it encounters a validate root 1895N/A @author anthony.petrov@sun.com 4195N/A @run main/othervm -Djava.awt.smartInvalidate=true InvalidateMustRespectValidateRoots 1895N/A // The JRootPane is a validate root. We'll check if 1895N/A // invalidate() stops on the root pane, or goes further 1895N/A // To enable running the test manually: use the Ctrl-Shift-F1 1895N/A // to print the component hierarchy to the console 1895N/A // Now the component hierarchy looks like: 1895N/A // Make all components valid first via showing the frame 1895N/A // We have to make the frame visible. Otherwise revalidate() is 1895N/A // useless (see RepaintManager.addInvalidComponent()). 1895N/A "setVisible(true) failed to validate the frame");
1895N/A // Now invalidate the button 1895N/A // Check if the 'valid' status is what we expect it to be 1895N/A "invalidate() failed to invalidate the root pane");
1895N/A "invalidate() invalidated the frame");
1895N/A // Now validate the hierarchy again 1895N/A // Now let the validation happen on the EDT 1895N/A // Check if the root pane finally became valid 1895N/A "revalidate() failed to validate the hierarchy");