< prev index next >

test/jdk/javax/swing/JFrame/4962534/bug4962534.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 20,42 **** * or visit www.oracle.com if you need additional information or have any * questions. */ /* ! test ! @bug 4962534 7104594 @summary JFrame dances very badly ! @author dav@sparc.spb.su area= ! @run applet bug4962534.html */ ! import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.util.Random; import javax.swing.*; ! public class bug4962534 extends Applet { Robot robot; volatile Point framePosition; volatile Point newFrameLocation; JFrame frame; --- 20,42 ---- * or visit www.oracle.com if you need additional information or have any * questions. */ /* ! @test ! @key headful ! @bug 4962534 @summary JFrame dances very badly ! @run main bug4962534 */ ! import java.awt.*; import java.awt.event.*; import java.util.Random; import javax.swing.*; ! public class bug4962534 { Robot robot; volatile Point framePosition; volatile Point newFrameLocation; JFrame frame;
*** 44,54 **** Component titleComponent; JLayeredPane lPane; volatile boolean titleFound = false; public static Object LOCK = new Object(); ! @Override public void init() { try { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { --- 44,59 ---- Component titleComponent; JLayeredPane lPane; volatile boolean titleFound = false; public static Object LOCK = new Object(); ! public static void main(final String[] args) { ! bug4962534 app = new bug4962534(); ! app.init(); ! app.start(); ! } ! public void init() { try { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() {
*** 58,71 **** } catch (Exception ex) { throw new RuntimeException("Init failed. " + ex.getMessage()); } }//End init() - @Override public void start() { - validate(); - try { setJLayeredPaneEDT(); setTitleComponentEDT(); } catch (Exception ex) { ex.printStackTrace(); --- 63,73 ----
*** 147,156 **** --- 149,159 ---- } JFrame.setDefaultLookAndFeelDecorated(true); frame = new JFrame("JFrame Dance Test"); frame.pack(); frame.setSize(450, 260); + frame.setLocationRelativeTo(null); frame.setVisible(true); } private void setJLayeredPaneEDT() throws Exception {
< prev index next >