Hi..
I am new to java. how can I make right click on java? because I only found example using javascript, not pure java.
Thank You very much.
Printable View
Hi..
I am new to java. how can I make right click on java? because I only found example using javascript, not pure java.
Thank You very much.
javascript isn't "unpure" java, it's a completely seperate language that just happens to have a similar name :) To recognise a right click in java you will need to implement MouseListener(MouseEvent e). To determine which mouse button was pressed you use e.getButton, which will return an integer representing the button that was pressed. To see the api for MouseListener go here and to see the api for MouseEvent just click on one of the blue MouseEvent links in the MouseListener api :) If you don't know how to use a listener in java just let us know.
Thank you mikeBarr81 for replying my question.
actually my problem is like this. I already create a tree in my program. now what I want to do is put a right click in my node in the tree. I found it's quite hard
:D . maybe because I'm new to all this. hope you can help.
thank you very much again mikeBarr81.
follow his advice.. register a mouse listener with the tree..