5194N/A/*
5194N/A * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
5194N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5194N/A *
5194N/A * This code is free software; you can redistribute it and/or modify it
5194N/A * under the terms of the GNU General Public License version 2 only, as
5194N/A * published by the Free Software Foundation.
5194N/A *
5194N/A * This code is distributed in the hope that it will be useful, but WITHOUT
5194N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5194N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5194N/A * version 2 for more details (a copy is included in the LICENSE file that
5194N/A * accompanied this code).
5194N/A *
5194N/A * You should have received a copy of the GNU General Public License version
5194N/A * 2 along with this work; if not, write to the Free Software Foundation,
5194N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5194N/A *
5194N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5194N/A * or visit www.oracle.com if you need additional information or have any
5194N/A * questions.
5194N/A */
5194N/A
5194N/A/*
5194N/A * Portions Copyright (c) 2011 IBM Corporation
5194N/A */
5194N/A
5194N/A/*
5194N/A * @test
5194N/A * @bug 6938583
5194N/A * @summary Unexpected NullPointerException when use CodeIM demo on windows
5194N/A * @author LittleE
5194N/A */
5194N/A
5194N/Aimport javax.swing.*;
5194N/Aimport javax.swing.text.DefaultCaret;
5194N/Aimport java.awt.event.MouseEvent;
5194N/A
5194N/Apublic class bug6938583 {
5194N/A public static void main(String[] args) throws Exception {
5194N/A SwingUtilities.invokeAndWait(new Runnable() {
5194N/A public void run() {
5194N/A JTextArea jta = new JTextArea();
5194N/A DefaultCaret dc = new DefaultCaret();
5194N/A jta.setCaret(dc);
5194N/A dc.deinstall(jta);
5194N/A dc.mouseClicked(new MouseEvent(jta, MouseEvent.MOUSE_CLICKED, 0, 0, 0, 0, 0, false));
5194N/A }
5194N/A });
5194N/A }
5194N/A}