treenode

JTree set background of node to non-opaque

守給你的承諾、 提交于 2019-12-22 04:39:15
问题 Please have a look at the SSCCE. How can I make the non-selected tree nodes' background transparent. At the moment the background of non-selected nodes is white. My cell renderer, however, should paint it non-opaque if it is not selected (and green when selected...what it does). In the end I want non-selected nodes to be just text without background, since the area which is red in the SSCCE has a gradient fill in my application. import java.awt.BorderLayout; import java.awt.Color; import java

C# - TreeView: inserting node at certain position

混江龙づ霸主 提交于 2019-12-21 18:13:28
问题 How does one insert a new child to a particular node in a TreeView in C# WinForms? I've been clumsily stabbing at TreeViews for almost an hour and I'd like to use C#'s TreeView like this: treeView.getChildByName("bob").AddChild(new Node("bob's dog")); Here's what I tried last (which I think is at a level of hairiness which C# should never have allowed me to reach): tree.Nodes[item.name].Nodes.Add(new TreeNode("thing")); Needless to say, it doesn't work. Oh, and here's a lazy question: can you

How do I make a TreeNode not visible? (C#)

走远了吗. 提交于 2019-12-20 01:35:10
问题 There is probably a really straightforward answer to this but I'm having difficulty finding it. Simple, I have a TreeNode and I would like to make its visibility false. (or another way of not allowing it to be shown until required). Edit - Another Question? I'm confused as to how there isn't a Visible attribute but then there is the property: Node.PrevVisibleNode; What is the difference between this and Node.PrevNode ? Thanks, 回答1: I don't think you can do that. There is an IsVisible property

C# WinForms highlight treenode when treeview doesnt have focus

為{幸葍}努か 提交于 2019-12-17 15:48:09
问题 Gretings. I'm making an interface to edit scenarios for a game. Basically it consists of events, which have nested conditions and actions. So, i planned using two treeviews - one for selecting the event, and other for selecting the condition/action inside the event to edit. Now, you see, if i select an event (in left treeview) and then try to select something in the right treeview, the left treeview will stop showing the blue selection rectangle. This is obviously bad because now the user

Disable and grey out a check box of treenode

删除回忆录丶 提交于 2019-12-14 03:09:29
问题 I need to create a treeview that some nodes in the tree will have checkbox and other nodes will have a disable checkbox - that looks gray as disable. once the user check the disable check box the check box image will be changed to a different image (-checked but still grey). this treeview will have also icon , besides the check box. (I'm using the winform treeview control) thanks in advance, 回答1: You can set the ShowCheckBox property of the node to False, and the ImageUrl to a picture of a

error: field ‘children’ has incomplete type ‘Node [2]

本秂侑毒 提交于 2019-12-13 22:01:33
问题 When I run this code, i get the error: "Field 'children' has incomplete type 'Node[0]'". I'm coding in C++ and I want to create a Node class which creates in itself two other Node objects and so on, until it reaches the maxDepth. The full error I get: 18:24:16 **** Incremental Build of configuration Debug for project Tests **** make all Building file: ../main.cpp Invoking: Cross G++ Compiler g++ -std=c++0x -O3 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "..

TreeView - Node not expanding

不想你离开。 提交于 2019-12-13 05:13:26
问题 I have a TreeView with several nodes and if a special node (you will see in code) is deleted, the parent node should be expanded after updating the TreeView. Here's how I tried it: public void Remove(){ ... ... else if ((NodeType)n.Tag == NodeType.Attribute) //Here I simply check if it's the "special" parent { Commands.CommandAttributeRemove cmd = (Commands.CommandAttributeRemove)mAppData.CommandFactory.Create("AttributeRemove"); cmd.Data = n.Text; cmd.ObjectClass = mObjectClass; cmd

how does a JTree respond to a changed DefaultMutableTreeNode?

南楼画角 提交于 2019-12-13 00:19:30
问题 Just trying to work out what happens, in terms of threads, if you change the user object of a DefaultMutableTreeNode in a non-EDT thread? I'm not talking about the DefaultTreeModel events, namely insertNodeInto and removeNodeFromParent, which I'm pretty clear should always be run in the EDT... I think... In the case of changes to nodes' user objects, it appears that JTree.TreeModelHandler is the thing which is "listening" for such events... but is there reason to expect that the listener will

How to inherit from the treenode class?

♀尐吖头ヾ 提交于 2019-12-12 21:07:11
问题 I have a class that inherits from TreeNode, called ExtendedTreeNode. To add an object of this type to the treeview is not a problem. But how do I retrieve the object from the treeview? I have tried this: TreeNode node = tvManual.Find("path/to/node"); // tvManual is a treeview return ((ExtendedTreeNode)node).Property; But this doesn't work. I get this error: Unable to cast object of type 'System.Web.UI.WebControls.TreeNode' to type 'PCK_Web_new.Classes.ExtendedTreeNode'. What do I have to do

PrimeFaces 3.0 - How can I set a TreeNode icon programmatically from backing bean?

旧时模样 提交于 2019-12-12 18:07:21
问题 I am trying to create a treeview using the PrimeFaces <p:tree> component. I copied the sample code from the PrimeFaces 3.0 Showcase and I have a simple treeview displaying very simple static content that is declared programmatically on the backing bean. One of the showcase examples shows how you can assign icons (the JQueryUI type) to a <p:treeNode> in the Facelet code. That's nice eye-candy for the showcase, but how can I assign the icon via the associated TreeNode in the backing bean code?