本文整理了Java中javax.swing.JTree.setDropMode()
方法的一些代码示例,展示了JTree.setDropMode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.setDropMode()
方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:setDropMode
暂无
代码示例来源:origin: stackoverflow.com
JTree tree = new JTree();
tree.setDragEnabled(true);
tree.setDropMode(DropMode.ON_OR_INSERT);
tree.setTransferHandler(new TreeTransferHandler());
tree.getSelectionModel().setSelectionMode(
代码示例来源:origin: Vhati/Slipstream-Mod-Manager
public ChecklistTreePanel() {
super( new BorderLayout() );
DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode( "Root", true );
treeModel = new DefaultTreeModel( rootNode, true );
tree = new JTree( treeModel );
tree.setCellRenderer( new DefaultTreeCellRenderer() );
tree.setRootVisible( false );
tree.getSelectionModel().setSelectionMode( TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION );
checklistManager = new ChecklistTreeManager( tree, true, null );
JScrollPane scrollPane = new JScrollPane( tree, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
this.add( scrollPane, BorderLayout.CENTER );
tree.setTransferHandler( new TreeTransferHandler( tree ) );
tree.setDropMode( DropMode.ON_OR_INSERT ); // Drop between rows, or onto groups.
tree.setDragEnabled( true );
}
代码示例来源:origin: stackoverflow.com
tree.setRootVisible(false);
tree.setDragEnabled(true);
tree.setDropMode(DropMode.INSERT);
tree.setTransferHandler(...);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
代码示例来源: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: MegaMek/mekhq
orgTree.addTreeSelectionListener(ev -> refreshForceView());
orgTree.setDragEnabled(true);
orgTree.setDropMode(DropMode.ON);
orgTree.setTransferHandler(new TOETransferHandler(getCampaignGui()));
代码示例来源: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: jawi/ols
this.tree.setDropMode( DropMode.INSERT );
this.tree.setTransferHandler( new JLxTreeTransferHandler() );
this.tree.addTreeSelectionListener( new TreeSelectionListener()
代码示例来源:origin: net.sourceforge.jadex/jadex-runtimetools-swing
ftp.getTree().setDropMode(DropMode.ON);
ftp.getTree().setTransferHandler(new TreeTransferHandler());
代码示例来源:origin: org.activecomponents.jadex/jadex-runtimetools-swing
ftp.getTree().setDropMode(DropMode.ON);
ftp.getTree().setTransferHandler(new TreeTransferHandler());
代码示例来源:origin: stackoverflow.com
tree.setDragEnabled(true);
tree.setTransferHandler(hanlder);
tree.setDropMode(DropMode.INSERT);
tree.getSelectionModel().setSelectionMode(
TreeSelectionModel.SINGLE_TREE_SELECTION);
代码示例来源:origin: stackoverflow.com
JTree tree = new JTree();
tree.setDragEnabled(true);
tree.setDropMode(DropMode.ON_OR_INSERT);
DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root");
NodeA child = new NodeA("nodea");
代码示例来源:origin: stackoverflow.com
JTree tree = new JTree();
tree.setDragEnabled(true);
tree.setDropMode(DropMode.ON_OR_INSERT);
tree.setTransferHandler(new TreeTransferHandler());
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.CONTIGUOUS_TREE_SELECTION);
代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core
treevar.setDropMode(DropMode.ON_OR_INSERT);
treevar.setTransferHandler(new JMeterTreeTransferHandler());
代码示例来源:origin: cpesch/RouteConverter
treeCategories.setCellRenderer(new CategoryTreeCellRenderer());
treeCategories.setDragEnabled(true);
treeCategories.setDropMode(ON);
treeCategories.setTransferHandler(new TreeDragAndDropHandler());
treeCategories.getSelectionModel().setSelectionMode(CONTIGUOUS_TREE_SELECTION);
代码示例来源:origin: org.xworker/xworker_core
comp.setDropMode(dropMode);
内容来源于网络,如有侵权,请联系作者删除!