3186N/A/*
3186N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
3186N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3186N/A *
3186N/A * This code is free software; you can redistribute it and/or modify it
3186N/A * under the terms of the GNU General Public License version 2 only, as
3186N/A * published by the Free Software Foundation.
3186N/A *
3186N/A * This code is distributed in the hope that it will be useful, but WITHOUT
3186N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3186N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3186N/A * version 2 for more details (a copy is included in the LICENSE file that
3186N/A * accompanied this code).
3186N/A *
3186N/A * You should have received a copy of the GNU General Public License version
3186N/A * 2 along with this work; if not, write to the Free Software Foundation,
3186N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3186N/A *
3186N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3186N/A * or visit www.oracle.com if you need additional information or have any
3186N/A * questions.
3186N/A */
3186N/A
3186N/A/* @test
3186N/A @bug 6456844
3186N/A @summary Tests that JTextComponent doesn't create drop locations with null bias.
3186N/A @author Shannon Hickey
3186N/A*/
3186N/A
3186N/Aimport sun.swing.SwingAccessor;
3186N/A
3186N/Aimport javax.swing.*;
3186N/Aimport javax.swing.border.EmptyBorder;
3186N/Aimport javax.swing.text.JTextComponent;
3186N/Aimport java.awt.*;
3186N/A
3186N/Apublic class bug6456844 {
3186N/A
3186N/A public static void main(String[] args) {
3186N/A JEditorPane ep = new JEditorPane();
3186N/A ep.setContentType("text/html");
3186N/A ep.setText("<html><body>abc</body></html>");
3186N/A ep.setBorder(new EmptyBorder(20, 20, 20, 20));
3186N/A ep.setBounds(0, 0, 100, 100);
3186N/A
3186N/A JTextComponent.DropLocation location =
3186N/A (JTextComponent.DropLocation) SwingAccessor.getJTextComponentAccessor().dropLocationForPoint(ep,
3186N/A new Point(0, 0));
3186N/A
3186N/A if (location.getBias() == null) {
3186N/A throw new RuntimeException("null bias");
3186N/A }
3186N/A }
3186N/A}