javax.swing.JTree.setInvokesStopCellEditing()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中javax.swing.JTree.setInvokesStopCellEditing()方法的一些代码示例,展示了JTree.setInvokesStopCellEditing()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.setInvokesStopCellEditing()方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:setInvokesStopCellEditing

JTree.setInvokesStopCellEditing介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

final JTree tree = new JTree();
 tree.setEditable(true);
 // this will often help (see its api doc), but no guarantee
 tree.setInvokesStopCellEditing(true);
 // a focusListener is **not** helping
 FocusListener l = new FocusListener() {
   @Override
   public void focusGained(FocusEvent e) {
   }
   @Override
   public void focusLost(FocusEvent e) {
     // this would prevent editing at all
     // tree.stopEditing();
   }
 };
 tree.addFocusListener(l);
 JComponent panel = new JPanel(new BorderLayout());
 panel.add(new JScrollPane(tree));
 panel.add(new JButton("just something to focus"), BorderLayout.SOUTH);

代码示例来源:origin: stackoverflow.com

tree.setEditable(true);//select a node then press F2 to edit (built in keybinding)
tree.getInputMap().put(KeyStroke.getKeyStroke("SPACE"), "startEditing");//can edit with space now
tree.setInvokesStopCellEditing(true);//this helps stop editing within focus of tree

代码示例来源:origin: atarw/material-ui-swing

@Override
public void installUI (JComponent c) {
  super.installUI (c);
  JTree tree = (JTree) c;
  DefaultTreeCellRenderer renderer = new MaterialTreeCellRenderer ();
  TreeCellEditor editor = new MaterialTreeCellEditor (tree, renderer);
  tree.setCellRenderer (renderer);
  tree.setCellEditor (editor);
  tree.setFont (UIManager.getFont ("Tree.font"));
  tree.setRowHeight (0);
  tree.setInvokesStopCellEditing (true);
  MaterialTreeUI ui = (MaterialTreeUI) tree.getUI ();
  ui.setLeftChildIndent (10);
  ui.setRightChildIndent (10);
}

代码示例来源:origin: org.gephi/directory-chooser

JScrollPane scrollBar = new JScrollPane(tree);
scrollBar.setViewportView(tree);
tree.setInvokesStopCellEditing(true);

代码示例来源:origin: org.netbeans.api/org-openide-explorer

tree.setInvokesStopCellEditing(true);
int rowHeight = rend.getTreeCellRendererComponent(tree, null, false, false, false, 0, true).getPreferredSize().height;
tree.setRowHeight(rowHeight);

代码示例来源:origin: org.biojava.thirdparty/forester

getJTree().setFocusable( true );
getJTree().setToggleClickCount( 1 );
getJTree().setInvokesStopCellEditing( true );
final JScrollPane tree_view = new JScrollPane( getJTree() );
_pane = new JEditorPane();

代码示例来源:origin: org.xworker/xworker_core

comp.setInvokesStopCellEditing(invokesStopCellEditing);

相关文章

JTree类方法