Hi all,
here is my problem: I'm making an application that shows an xml file as a JTree (and this is done). I want to show some components into a JPanel when double-click a node of the tree...for example, if clicking a node, the JPanel has to show a JButton...
I set the Mouse listener to the tree and here is the code i use for the action of the listener:
private void azione(java.awt.event.MouseEvent evt) {
jPanel2.add(new JButton("hello"));
jPanel2.revalidate();
jPanel2.repaint();
}
The application doesn't show anything.
Tnx all
here is my problem: I'm making an application that shows an xml file as a JTree (and this is done). I want to show some components into a JPanel when double-click a node of the tree...for example, if clicking a node, the JPanel has to show a JButton...
I set the Mouse listener to the tree and here is the code i use for the action of the listener:
private void azione(java.awt.event.MouseEvent evt) {
jPanel2.add(new JButton("hello"));
jPanel2.revalidate();
jPanel2.repaint();
}
The application doesn't show anything.
Tnx all
Last edited: