I am creating a tree's translucent program that allows users to run BFS and DFS traversal, as well as Adds and removes nodes.
The one I'm stuck is getting the node from Jacobombox and sending it to < P> First of all, I add a group of nodes and connect ... ... addNode () adds nodes in the Then I will send all the nodes to JComboBox As you can see above, the nodes have been successfully added to JComboBox. Then I will create a new square: which uses this class ... Which calls My question is: How can I get selected nodes from Jakobobox and pass it to Thanks! addendNode () . I want to receive it:
nodelight .
guardian :
(nodes n: node list) {parents.addItem (n.getValue ( )); }
// send to the selected parents from the combo box; Encoded child ac = new append child (child, parent); This.child.addActionListener (ac); This.AddButton.addActionListener (AC);
class AppendChildren implementation ActionListener {Private TextField child; Private JComboBox parents; Private index index; Public-educated children (Textfield children, Jessimobox parents, int parent index) {this.child = child; This.parents = parent; This.index = parentIndex; } Public Numerology (ActionEvent ae) {// Set maximum input in maximum characters (if child .gettext (). Length () & lt; = 0} {addMoreMessage = "Please give your child name ..."; } And {addMoreMessage = ""; } If (child.gettext (). Length ()> 1) {child.setText (child.getText). Substring (0,1)); } String childName = child.getText (); Parents.setSelectedIndex (index); Nodes newChild = new nodes (childName, nodeX, nodeY, nodewidth, node high); Ependonode (Parentnode, New Child); }}
Ependonodes (nodes parent, nodes child) {<> Connect to the nodes and recreate the adjacency matrix.
appendNode () ? I'm able to fix string values from TextField ...
No comments:
Post a Comment