src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2014, 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. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2015, 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. Oracle designates this
*** 25,34 ****
--- 25,36 ----
package javax.swing.plaf.basic;
+ import sun.awt.AWTAccessor;
+ import sun.awt.AWTAccessor.ComponentAccessor;
import sun.swing.DefaultLookup;
import sun.swing.UIAction;
import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;
*** 1189,1210 ****
/**
* Should be messaged before the dragging session starts, resets
* lastDragLocation and dividerSize.
*/
- @SuppressWarnings("deprecation")
protected void startDragging() {
Component leftC = splitPane.getLeftComponent();
Component rightC = splitPane.getRightComponent();
ComponentPeer cPeer;
beginDragDividerLocation = getDividerLocation(splitPane);
draggingHW = false;
! if(leftC != null && (cPeer = leftC.getPeer()) != null &&
!(cPeer instanceof LightweightPeer)) {
draggingHW = true;
! } else if(rightC != null && (cPeer = rightC.getPeer()) != null
&& !(cPeer instanceof LightweightPeer)) {
draggingHW = true;
}
if(orientation == JSplitPane.HORIZONTAL_SPLIT) {
setLastDragLocation(divider.getBounds().x);
--- 1191,1212 ----
/**
* Should be messaged before the dragging session starts, resets
* lastDragLocation and dividerSize.
*/
protected void startDragging() {
Component leftC = splitPane.getLeftComponent();
Component rightC = splitPane.getRightComponent();
ComponentPeer cPeer;
beginDragDividerLocation = getDividerLocation(splitPane);
draggingHW = false;
! final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
! if(leftC != null && (cPeer = acc.getPeer(leftC)) != null &&
!(cPeer instanceof LightweightPeer)) {
draggingHW = true;
! } else if(rightC != null && (cPeer = acc.getPeer(rightC)) != null
&& !(cPeer instanceof LightweightPeer)) {
draggingHW = true;
}
if(orientation == JSplitPane.HORIZONTAL_SPLIT) {
setLastDragLocation(divider.getBounds().x);