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

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

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

JTree.setForeground介绍

暂无

代码示例

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

/*******************************************************************************
 *
 ******************************************************************************/
@Override
public void setForeground (final Color color)
 {
  super.setForeground(color);
  if (tree != null)
   {
    tree.setForeground(color);
   }
 }

代码示例来源:origin: ontop/ontop

treSavedQuery.setForeground(new java.awt.Color(51, 51, 51));
treSavedQuery.setModel(queryControllerModel);
treSavedQuery.setCellRenderer(new SavedQueriesTreeCellRenderer());

代码示例来源:origin: net.sf.sfac/sfac-core

@Override
protected void synchronizeEditableState() {
  if (theTree != null) {
    boolean treeEnabled = isEditable() && isEnabled();
    theTree.setEnabled(treeEnabled);
    theTree.setBackground(treeEnabled ? Color.WHITE : Color.LIGHT_GRAY);
    theTree.setForeground(treeEnabled ? Color.BLACK : Color.DARK_GRAY);
    theTree.repaint();
  }
}

代码示例来源: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: elki-project/elki

/**
 * Creates the JList used in the popup to display the items in the combo box
 * model. This method is called when the UI class is created.
 * 
 * @return a <code>JList</code> used to display the combo box items
 */
protected JTree createTree() {
 JTree tree = new JTree(model);
 tree.setName("TreePopup.tree");
 tree.setFont(getFont());
 tree.setForeground(getForeground());
 tree.setBackground(getBackground());
 tree.setBorder(null);
 tree.setFocusable(true);
 tree.addMouseListener(handler);
 tree.addKeyListener(handler);
 tree.setCellRenderer(new Renderer());
 return tree;
}

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki

/**
 * Creates the JList used in the popup to display the items in the combo box
 * model. This method is called when the UI class is created.
 * 
 * @return a <code>JList</code> used to display the combo box items
 */
protected JTree createTree() {
 JTree tree = new JTree(model);
 tree.setName("TreePopup.tree");
 tree.setFont(getFont());
 tree.setForeground(getForeground());
 tree.setBackground(getBackground());
 tree.setBorder(null);
 tree.setFocusable(true);
 tree.addMouseListener(handler);
 tree.addKeyListener(handler);
 tree.setCellRenderer(new Renderer());
 return tree;
}

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-gui-minigui

/**
 * Creates the JList used in the popup to display the items in the combo box
 * model. This method is called when the UI class is created.
 * 
 * @return a <code>JList</code> used to display the combo box items
 */
protected JTree createTree() {
 JTree tree = new JTree(model);
 tree.setName("TreePopup.tree");
 tree.setFont(getFont());
 tree.setForeground(getForeground());
 tree.setBackground(getBackground());
 tree.setBorder(null);
 tree.setFocusable(true);
 tree.addMouseListener(handler);
 tree.addKeyListener(handler);
 tree.setCellRenderer(new Renderer());
 return tree;
}

相关文章

JTree类方法