本文整理了Java中javax.swing.JTree.setDropTarget()
方法的一些代码示例,展示了JTree.setDropTarget()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.setDropTarget()
方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:setDropTarget
暂无
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu
public void setDropTarget(DropTarget _dt)
{
super.setDropTarget(_dt);
if(_dt!=null)
{
//FuLog.debug("BTR: setDropTarget");
try { _dt.removeDropTargetListener(DtDragSensible.SINGLETON); }
catch(IllegalArgumentException ex) { }
try { _dt.addDropTargetListener(DtDragSensible.SINGLETON); }
catch(TooManyListenersException ex) { }
}
}
代码示例来源:origin: senbox-org/snap-desktop
public DndBeanTreeView() {
tree.setDropTarget(new DropTarget(tree, new ProductExplorerDropTarget()));
}
代码示例来源:origin: bcdev/beam
@SuppressWarnings("UnusedDeclaration")
private void installTreeDragAndDrop() {
filterTree.setDragEnabled(true);
filterTree.setDropMode(DropMode.INSERT);
filterTree.setDropTarget(new DropTarget(filterTree, DnDConstants.ACTION_MOVE, new DropTargetAdapter() {
@Override
public void dragEnter(DropTargetDragEvent dtde) {
System.out.println("dragEnter: dtde = " + dtde);
}
@Override
public void dragOver(DropTargetDragEvent dtde) {
System.out.println("dragOver: dtde = " + dtde);
}
@Override
public void dropActionChanged(DropTargetDragEvent dtde) {
System.out.println("dropActionChanged: dtde = " + dtde);
}
@Override
public void dragExit(DropTargetEvent dte) {
System.out.println("dragExit: dte = " + dte);
}
@Override
public void drop(DropTargetDropEvent dtde) {
System.out.println("drop: dtde = " + dtde);
}
}));
}
代码示例来源:origin: senbox-org/snap-desktop
@SuppressWarnings("UnusedDeclaration")
private void installTreeDragAndDrop() {
filterTree.setDragEnabled(true);
filterTree.setDropMode(DropMode.INSERT);
filterTree.setDropTarget(new DropTarget(filterTree, DnDConstants.ACTION_MOVE, new DropTargetAdapter() {
@Override
public void dragEnter(DropTargetDragEvent dtde) {
System.out.println("dragEnter: dtde = " + dtde);
}
@Override
public void dragOver(DropTargetDragEvent dtde) {
System.out.println("dragOver: dtde = " + dtde);
}
@Override
public void dropActionChanged(DropTargetDragEvent dtde) {
System.out.println("dropActionChanged: dtde = " + dtde);
}
@Override
public void dragExit(DropTargetEvent dte) {
System.out.println("dragExit: dte = " + dte);
}
@Override
public void drop(DropTargetDropEvent dtde) {
System.out.println("drop: dtde = " + dtde);
}
}));
}
代码示例来源:origin: vasl-developers/vasl
m_objTree.setDropTarget(PieceMover.DragHandler.makeDropTarget(m_objTree, DnDConstants.ACTION_MOVE, this));
代码示例来源:origin: net.java.dev.laf-widget/laf-widget
private void uninstallDnDSupport() {
if (this.cellRendererChangeListener != null) {
this.jcomp
.removePropertyChangeListener(this.cellRendererChangeListener);
this.cellRendererChangeListener = null;
}
TreeCellRenderer tcl = this.jcomp.getCellRenderer();
if (tcl instanceof DnDCellRendererProxy) {
TreeCellRenderer origRenderer = ((DnDCellRendererProxy) tcl)
.getOriginalTreeCellRenderer();
this.jcomp.setCellRenderer(origRenderer);
}
if (this.dropListener != null) {
this.dropTarget.removeDropTargetListener(this.dropListener);
this.dropListener = null;
this.jcomp.setDropTarget(null);
}
if (this.dragGestureRecognizer != null) {
this.dragGestureRecognizer
.removeDragGestureListener(this.gestureListener);
this.gestureListener = null;
this.dragGestureRecognizer = null;
}
}
内容来源于网络,如有侵权,请联系作者删除!