right click in java


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: right click in java

  1. #1
    Join Date
    Mar 2004
    Posts
    3

    right click in java

    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.

  2. #2
    Join Date
    Feb 2004
    Posts
    541
    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.

  3. #3
    Join Date
    Mar 2004
    Posts
    3

    right click in java

    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
    . maybe because I'm new to all this. hope you can help.

    thank you very much again mikeBarr81.

  4. #4
    Join Date
    Feb 2004
    Posts
    808
    follow his advice.. register a mouse listener with the tree..
    The 6th edict:
    "A thing of reference thing can hold either a null thing or a thing to any thing whose thing is assignment compatible with the thing of the thing" - ArchAngel, www.dictionary.com et al.
    JAR tutorial GridBag tutorial Inherited Shapes Inheritance? String.split(); FTP?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center