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

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

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

JTree.setOpaque介绍

暂无

代码示例

代码示例来源:origin: it.tidalwave.netbeans/it-tidalwave-netbeans-explorer

/*******************************************************************************
 *
 ******************************************************************************/
@Override
public void setOpaque (final boolean opaque)
 {
  super.setOpaque(opaque);
  if (tree != null)
   {
    tree.setOpaque(opaque);
   }
 }

代码示例来源:origin: org.antlr/gunit

public void initComponents() {
  //textArea.setOpaque(false);
  tree.setOpaque(false);
  scroll.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
  scroll.setOpaque(false);
  this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
  this.add(scroll);
  this.setBorder(BorderFactory.createEmptyBorder());
  this.setOpaque(false);
}

代码示例来源:origin: antlr/antlr3

public void initComponents() {
  //textArea.setOpaque(false);
  tree.setOpaque(false);
  scroll.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
  scroll.setOpaque(false);
  this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
  this.add(scroll);
  this.setBorder(BorderFactory.createEmptyBorder());
  this.setOpaque(false);
}

代码示例来源:origin: antlr/antlr3

public void initComponents() {
  //textArea.setOpaque(false);
  tree.setOpaque(false);
  scroll.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
  scroll.setOpaque(false);
  this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
  this.add(scroll);
  this.setBorder(BorderFactory.createEmptyBorder());
  this.setOpaque(false);
}

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

private JTree getJTree() {

  JTree jTree = new JTree();
  jTree.setOpaque(true);
  jTree.setBackground(Color.white);
  UIDefaults paneDefaults = new UIDefaults();
  paneDefaults.put("Tree.selectionBackground",null);

  JTextPane pane = new JTextPane();
  jTree.putClientProperty("Nimbus.Overrides",paneDefaults);
  jTree.putClientProperty("Nimbus.Overrides.InheritDefaults",false);

  jTree.setCellRenderer( new LocalRenderer() );
  return jTree;
}

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

painelRolagemArvore.setOpaque(false);
arvore.setOpaque(false);
painelRolagemArvore.setViewportView(arvore);

代码示例来源:origin: com.projectdarkstar.example.projectsnowman/snowman-world-editor

TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.setShowsRootHandles(true);
tree.setOpaque(true);

代码示例来源:origin: org.java.net.substance/substance

public void propertyChange(PropertyChangeEvent evt) {
  if (SubstanceLookAndFeel.WATERMARK_VISIBLE.equals(evt
      .getPropertyName())) {
    tree.setOpaque(!SubstanceCoreUtilities
        .toDrawWatermark(tree));

代码示例来源:origin: com.github.insubstantial/substance

if (SubstanceLookAndFeel.WATERMARK_VISIBLE.equals(evt
    .getPropertyName())) {
  tree.setOpaque(!SubstanceCoreUtilities
      .toDrawWatermark(tree));

代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij

repositoryTree.setRowHeight(0);
repositoryTree.setRootVisible(false);
repositoryTree.setOpaque(false);
repositoryTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
repositoryTree.expandRow(0);

代码示例来源:origin: it.tidalwave.netbeans/it-tidalwave-netbeans-explorer

/*******************************************************************************
 *
 *
 ******************************************************************************/
private void initializeTree2()
 {
  if (!treeInitialized)
   {
    tree.setOpaque(isOpaque());
    tree.setBackground(getBackground());
    tree.setForeground(getForeground());
    treeInitialized = true;
   }
  patchRenderer();
 }

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

tree.setOpaque(true);
tree.setRootVisible(false);
tree.setShowsRootHandles(true);

代码示例来源:origin: com.github.insubstantial/substance

@Override
protected void installDefaults() {
  super.installDefaults();
  if (SubstanceCoreUtilities.toDrawWatermark(this.tree))
    this.tree.setOpaque(false);
  if (this.tree.getSelectionPaths() != null) {
    for (TreePath selectionPath : this.tree.getSelectionPaths()) {
      TreePathId pathId = new TreePathId(selectionPath);
      selectedPaths.put(pathId, selectionPath.getLastPathComponent());
    }
  }
  setExpandedIcon(new IconUIResource(SubstanceIconFactory.getTreeIcon(
      this.tree, false)));
  setCollapsedIcon(new IconUIResource(SubstanceIconFactory.getTreeIcon(
      this.tree, true)));
  // instead of computing the cell renderer insets on
  // every cell rendering, compute it once and expose to the
  // SubstanceDefaultTreeCellRenderer
  this.cellRendererInsets = SubstanceSizeUtils
      .getTreeCellRendererInsets(SubstanceSizeUtils
          .getComponentFontSize(tree));
}

代码示例来源:origin: org.java.net.substance/substance

@Override
protected void installDefaults() {
  super.installDefaults();
  if (SubstanceCoreUtilities.toDrawWatermark(this.tree))
    this.tree.setOpaque(false);
  if (this.tree.getSelectionPaths() != null) {
    for (TreePath selectionPath : this.tree.getSelectionPaths()) {
      TreePathId pathId = new TreePathId(selectionPath);
      selectedPaths.put(pathId, selectionPath.getLastPathComponent());
    }
  }
  setExpandedIcon(new IconUIResource(SubstanceIconFactory.getTreeIcon(
      this.tree, false)));
  setCollapsedIcon(new IconUIResource(SubstanceIconFactory.getTreeIcon(
      this.tree, true)));
  // instead of computing the cell renderer insets on
  // every cell rendering, compute it once and expose to the
  // SubstanceDefaultTreeCellRenderer
  this.cellRendererInsets = SubstanceSizeUtils
      .getTreeCellRendererInsets(SubstanceSizeUtils
          .getComponentFontSize(tree));
}

代码示例来源:origin: de.sciss/jtreetable

protected JTree createAndConfigureTree() {
  JTree tree = createTree(treeTable.getTreeTableModel());
  if (treeTable.getSelectionModel() == null) {
    treeTable.setSelectionModel(tree.getSelectionModel());
  } else {
    tree.setSelectionModel(treeTable.getSelectionModel());
  }
  tree.setOpaque(false);
  tree.setRowHeight(20);
  tree.putClientProperty("JTree.lineStyle", "None");
  InputMap inputs = tree.getInputMap();
  remap(inputs, KeyEvent.VK_LEFT);
  remap(inputs, KeyEvent.VK_RIGHT);
  updateTreeClientProperties(tree);
  return tree;
}

相关文章

JTree类方法