0

I need to use JOption pane to prompt users to name the account or portfolio they would like to add to the deafult mutable tree node and then use their input to name and assign a value to the portfolio or account.

This is what I have so far

JMenuItem mntmNewMenuItem_2 = new JMenuItem("Add Account");
    mntmNewMenuItem_2.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
        String name = JOptionPane.showInputDialog(null, "Enter Account Name");
        String value = JOptionPane.showInputDialog(null, "Enter Account Value");
        }
    });

The hierarchy of the project is Client -> Portfolio -> Account I am unsure of how to assign the values to the proper place in the tree.

Andrew Thompson
  • 166,747
  • 40
  • 210
  • 420
  • The devil is in the detail. Start by having a look at [How to Use Trees](https://docs.oracle.com/javase/tutorial/uiswing/components/tree.html). You might also need to have a look at [How to search a particular node in jtree and make that node expanded.?](https://stackoverflow.com/questions/8210630/how-to-search-a-particular-node-in-jtree-and-make-that-node-expanded) – MadProgrammer Dec 16 '21 at 20:40

0 Answers0