< prev index next >

test/javax/swing/JTextArea/Test6593649.java

Print this page
rev 14989 : 8160974: [TESTBUG] Mark more headful tests with @key headful.


   4  *
   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
   7  * published by the Free Software Foundation.
   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 /* @test
  25    @bug 6593649
  26    @summary Word wrap does not work in JTextArea: long lines are not wrapped
  27    @author Lillian Angel
  28    @run main Test6593649
  29 */


  30 
  31 import javax.swing.*;
  32 import java.awt.*;
  33 import java.awt.event.ActionEvent;
  34 import java.awt.event.ActionListener;
  35 
  36 public class Test6593649 {
  37     private static JFrame frame;
  38 
  39     private static JTextArea textArea;
  40 
  41     private static final Timer timer = new Timer(1000, new ActionListener() {
  42         public void actionPerformed(ActionEvent e) {
  43             boolean failed = !textArea.getParent().getSize().equals(textArea.getSize());
  44 
  45             frame.dispose();
  46 
  47             if (failed) {
  48                 throw new RuntimeException("The test failed");
  49             }




   4  *
   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
   7  * published by the Free Software Foundation.
   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 /*
  25  * @test
  26  * @key headful
  27  * @bug 6593649
  28  * @summary Word wrap does not work in JTextArea: long lines are not wrapped
  29  * @author Lillian Angel
  30  * @run main Test6593649
  31  */
  32 
  33 import javax.swing.*;
  34 import java.awt.*;
  35 import java.awt.event.ActionEvent;
  36 import java.awt.event.ActionListener;
  37 
  38 public class Test6593649 {
  39     private static JFrame frame;
  40 
  41     private static JTextArea textArea;
  42 
  43     private static final Timer timer = new Timer(1000, new ActionListener() {
  44         public void actionPerformed(ActionEvent e) {
  45             boolean failed = !textArea.getParent().getSize().equals(textArea.getSize());
  46 
  47             frame.dispose();
  48 
  49             if (failed) {
  50                 throw new RuntimeException("The test failed");
  51             }


< prev index next >