23
24 /*
25 * Portions Copyright (c) 2013 IBM Corporation
26 */
27 import java.awt.BorderLayout;
28 import java.awt.Toolkit;
29
30 import java.awt.event.ActionListener;
31 import javax.swing.DefaultButtonModel;
32 import javax.swing.JEditorPane;
33 import javax.swing.JFrame;
34 import javax.swing.SwingUtilities;
35 import javax.swing.text.StyleConstants;
36 import javax.swing.text.StyleContext;
37 import javax.swing.text.html.HTMLEditorKit;
38 import sun.awt.SunToolkit;
39
40
41 /*
42 * @test
43 * @bug 8008289
44 * @summary Shared ButtonModel instance should deregister previous listeners.
45 * @author Frank Ding
46 */
47 public class bug7189299 {
48
49 private static JEditorPane html;
50 private static JFrame frame;
51
52 private static void setup() {
53 /**
54 * Note the input type is not restricted to "submit". Types "image",
55 * "checkbox", "radio" have the same problem.
56 */
57 html = new JEditorPane("text/html",
58 "<html><body><form action=\"http://localhost.cgi\">"
59 + "<input type=submit name=submit value=\"submit\"/>"
60 + "</form></body></html>");
61 frame = new JFrame();
62 frame.setLayout(new BorderLayout());
|
23
24 /*
25 * Portions Copyright (c) 2013 IBM Corporation
26 */
27 import java.awt.BorderLayout;
28 import java.awt.Toolkit;
29
30 import java.awt.event.ActionListener;
31 import javax.swing.DefaultButtonModel;
32 import javax.swing.JEditorPane;
33 import javax.swing.JFrame;
34 import javax.swing.SwingUtilities;
35 import javax.swing.text.StyleConstants;
36 import javax.swing.text.StyleContext;
37 import javax.swing.text.html.HTMLEditorKit;
38 import sun.awt.SunToolkit;
39
40
41 /*
42 * @test
43 * @key headful
44 * @bug 8008289
45 * @summary Shared ButtonModel instance should deregister previous listeners.
46 * @author Frank Ding
47 */
48 public class bug7189299 {
49
50 private static JEditorPane html;
51 private static JFrame frame;
52
53 private static void setup() {
54 /**
55 * Note the input type is not restricted to "submit". Types "image",
56 * "checkbox", "radio" have the same problem.
57 */
58 html = new JEditorPane("text/html",
59 "<html><body><form action=\"http://localhost.cgi\">"
60 + "<input type=submit name=submit value=\"submit\"/>"
61 + "</form></body></html>");
62 frame = new JFrame();
63 frame.setLayout(new BorderLayout());
|