H
HS1
Hello all
I have a MenuTreeNavigator in a MainWindow that allows users to select
different nodes as the following:
----------------------------------------------------------------------------
----------------------------
public class MenuTreeNavigator implements TreeSelectionListener,
TreeExpansionListener {
......
public MenuTreeNavigator(MainWindow mainWindow) {
this.mainWindow = mainWindow;
.........
public void valueChanged(TreeSelectionEvent treeSelectionEvent) {
Object selectedNode = treeSelectionEvent.getPath().getLastPathComponent();
if (selectedNode.getClass().getName().equals("MainClientNode")) {
//MainClientNode is a class MainClientNode that implements
MutableTreeNode
MainClientNode clientNode = (MainClientNode) selectedNode;
mainWindow.setRightPane(.........);
}
if (selectedNode.getClass().getName().equals("ClientNode")) {
....
}
----------------------------------------------------------------------------
When user click s(or select) a MainClientNode, the MainWindow will set a
object for RightPane. What I want now is that I have a button in the
MainWindow, when I click this button, that MainClienNode is also selected
(as I have only one MainClientNode)
Is it possible to do that?
Please help
Many thanks
S.H1
I have a MenuTreeNavigator in a MainWindow that allows users to select
different nodes as the following:
----------------------------------------------------------------------------
----------------------------
public class MenuTreeNavigator implements TreeSelectionListener,
TreeExpansionListener {
......
public MenuTreeNavigator(MainWindow mainWindow) {
this.mainWindow = mainWindow;
.........
public void valueChanged(TreeSelectionEvent treeSelectionEvent) {
Object selectedNode = treeSelectionEvent.getPath().getLastPathComponent();
if (selectedNode.getClass().getName().equals("MainClientNode")) {
//MainClientNode is a class MainClientNode that implements
MutableTreeNode
MainClientNode clientNode = (MainClientNode) selectedNode;
mainWindow.setRightPane(.........);
}
if (selectedNode.getClass().getName().equals("ClientNode")) {
....
}
----------------------------------------------------------------------------
When user click s(or select) a MainClientNode, the MainWindow will set a
object for RightPane. What I want now is that I have a button in the
MainWindow, when I click this button, that MainClienNode is also selected
(as I have only one MainClientNode)
Is it possible to do that?
Please help
Many thanks
S.H1