How can differ mouse event?

In an mouse event, how can i find out whether right_button is clicked or not left_button?

Try the following:
if (e.getModifiers() == MouseEvent.BUTTON1_MASK) {
    System.out.println("Left mouse button was pressed");
} else if (e.getButtonMask == MouseEvent.BUTTON3_MASK) {
    System.out.println("Right mouse button was pressed");
}cheers,
Greg

Similar Messages

  • How can I view my photos in "Events" like in iPhoto? How can I create events?  I have 55,000 photos and 1700 events so the only way I can possibly manage my photos is using events that are one slide in size.

    I have 55,000 images organized into about 1700 events. The only reasonable way to view my library is using events in iPhoto where each event has one image That still leaves 1700 images to sort through but that is a lot easier than 55,000 images.  In the side bar is a folder with "iPhoto Events" but those views still show all of the slides.  How can I create events and view my photos as events as in iPhoto?  Events are critical for large libraries and has been my primary way to sort images.
    Thanks!

    I had a problem a couple of months ago when iPhotos suddenly rearranged the order of my Events (Why won't iPhoto let me arrange my photos?) .  I was told "Use albums not events - events are not a good way to organize - albums and folder are designed for organisation and are very flexible".
    Haha!  I should have paid attention and read between the lines!  My iPhotos were highly organised groupings - not according to date but the way I wanted them - and it was so easy to do!  I see now that if I had them all in albums, as per the Apple Apologist suggestion, I wouldn't have this unholy mess I have been left with just to make iPhone & iCloud users happy.  I am now going through Photos and making Albums (of what used to be in my Events)  ... maybe I'll get this finished before they do another non user friendly update!

  • How can I remove events from my iPhone. I want to delete all the events from my iPhone.

    how can I remove Events from my Photo in iPhone

    Connect to computer iTunes and uncheck under Photos > Events then do a sync.

  • Imported old family video, I seperated different events, how can I save event to put together in a menu like family, vacation, christmas.

    Imported old family video, I seperated different events and named each event, how can I save event to put together in a menu like family, vacation, christmas to make a DVD

    revdhayes wrote:
    I imported 5 1 hour old video in Final Cut Pro X. I spent all day seperating clips with Start and end then naming each clip in properties..
    Sorry, but I don't understand  what "5 1 hour video" means.
    I do understand that you have a lot of clips that you want to group by various subjects, like vacation, etc. That's a perfect job for keywords, which perhaps is what you used when you named them?
    If you did use keywords, go to that TL Index and click Tag at the top and then the keyword icon at the bottom. It should give you a list of only clips in that category. Select clip from the menu and it should highlight them. You could then copy and paste them to a new project for export. Repeat as necessary.
    If you're going to do a lot of these, I'd suggest doing this from the event browser, applying keywords and then the clips into separate projects.  But there are always more than one way to do things, and to each his/her own.
    Again, I don't have any idea how long your footage is and whether it is even possible (or desirable) to fit it on to a single DVD. I mentioned iDVD because of its menu and sub menu capabilities. You will need another app like Compressor to do the chapter makers (unless Apple updates FCP before you finish your project and adds that capability. That would be nice,)
    Good luck.
    Russ

  • HT4759 How can make the events listed in my chalenda become automatically a reminder in the reminder?:

    How can make the events listed in my chalenda become automatically a reminder in the reminder?:

    Welcome to the Apple community.
    Calendar and reminders are two different and separate apps, you cannot transfer information between the two of them.

  • How can I count events during a given time with 2 counters (6025 E)

    Hi, How can I count events during a given time (1 sec for example) with 2 counters:
    what is the best way?
    how should i configurate both counter?
    i have done the 1st counter in ev_counter with the gate being the output of the 2nd; and how can i say to the 2nd to trig the first after 1 sec counting? (trig at start and at end) what are the functoins calls in NIDAQ. i am using Visual C++

    Greetings,
    When you perform event counting a gate signal can be added such that if a low signal occurs on the gate, then the counter will pause. When a high signal is seen, the counter will continue counting edges. When you install the NI-DAQ driver you should have installed the examples for Visual C++. The counter examples are found in \Program Files\National Instruments\NI-DAQ\Examples\VisualC\Ctr. Take a look at STCeventCount.C. Be sure to only use STC examples with your hardware. The E-series boards contain the DAQ-STC chip.
    Now, all you need is a gate signal with a width (high time) of 1 second. You could use an external frequency or pulse generator to do this. Or, you could just use the second counter found on your PCI-6025E board. In this
    case you could configure the second counter to generate a single pulse. Take a look at the STCgenerateSinglePulse.C example. As long as the pulse is in a high state for one second you can use it to gate (or time) your counting of events.
    Regards,
    Justin Britten
    Applications Engineer
    National Instruments

  • How can we impliment event pooling table in 11g

    how can we use event pooling table in obiee11g for the cache seeding .could you please share knowledge.
    Regards
    bethamsetty

    Hi,
    Refer-
    http://docs.oracle.com/cd/E14571_01/bi.1111/e10541/querycaching.htm
    see 7.8 section
    http://obieehome.blogspot.in/2012/07/event-polling-in-obiee-11g.html
    Hope this helped/ answered
    Regards
    MuRam

  • How can launch an event in javascript?

    Hi, i´m doing an app in jsp, but i´m using a framework in javascript, css... my problem is... how can launch an event in javascript?
    I have a menu bar in javascript, and i want launch an event in each option, how?
    Thanks,

    Hi Victor,
    well, onMouseUp("blablup");
    I do not finally get your problem - do you want to send an event? So just add it to the URL and send the URL  -or do you want to excut the form? Why then not add the "event" to a hiden field in the form and execut that form then?
    In the handler you can ask for the details of the hidden field.
    I think it is not exactly what you are fter - but it could be that this is anyay a solution.
    Regards,
    Oliver

  • How can I relay Events to other Listeners?

    Hello,
    I'm writing an application consisting of one JFrame that holds 2 JPanels, a Panel with my "Tools" and a Panel that works as "Worksheet". I implented the feature, that you can drag a Tool from the Tools-Panel to the Worksheet-Panel.
    Now, additionally, I want to implement the feature in the Worksheet-Panel that you can replace an element by mouseDragged(..). I tried to implement this by using the GlasPane from the JFrame ...
    My Problem: The GlassPane seems to catch all events from both Panels and now the Drag&Drop feature from the Tools-Panel don't work any more.
    My Question: How can I relay the Mouse-Events catched by the GlassPane to all other MouseEvent-Listeners?
    Here my Worksheet-Panel, it add itself to the GlasPane-MouseListener List
    public class Worksheet_Panel extends javax.swing.JPanel implements WorksheetInterface {
        public Worksheet_Panel(Component GlasPane) {
             GlasPane.addMouseListener(listener);
             GlasPane.setVisible(true);
        public void mousePressed(MouseEvent e) {
        }Thanks for any help
    Edited by: AddForumListener on Feb 10, 2008 4:06 AM

    AddForumListener wrote:
    thanks. it's an interest method.
    but i think that don't work for my situation because the Class where the event is handled don't know which other components has an interest on that event.
    I think I will try to create an own glasspane which covers my worksheet-panel and its components.
    greetingsI do not know if this will be useful because I did not understand what you are trying to achieve since I did not see your code fully. However you can reach the other components which are interested in listening the mouse events of the source component that created the mouse event. What I mean is you can add the following in the mousePressed method of your glasspane component for instance:
    public void mousePressed(MouseEvent e)
         Component source = (Component) e.getSource();
         MouseListener[] listeners = source.getMouseListeners();
         // Iterate through the mouse listeners, determine to which listener
         // you would like to relay the mouse event and relay it as I mentioned above.
         for (int i = 0; i < listeners.length; i++)
    } Anyway, good luck!!!

  • How to call mouse event on particular treecell

    how to call a mouseevent on a particular Treecell of a Treeview
    I have tried with setcellfactory but the effect is applied to the whole TreeView. How can i apply it to a particular TreeCell

    How can it be? It seems not.
    Please allow me to clarify my problem-
    I have jcomponents on a layer of jlayeredpane.
    Now I can use MouseListener on the layeredpane.
    Like to get coordinates of the mouse and showing in a textfield -
    private void jLayeredPane1MouseDragged(java.awt.event.MouseEvent evt) {
             projectNameID.setText("Mouse dragged");      
        private void jLayeredPane1MouseEntered(java.awt.event.MouseEvent evt) {
            projectNameID.setText("Mouse entered");
        private void jLayeredPane1MouseExited(java.awt.event.MouseEvent evt) {
            projectNameID.setText("Mouse exited");       
        private void jLayeredPane1MouseMoved(java.awt.event.MouseEvent evt) {
            projectNameID.setText("Mouse moved");       
        private void jLayeredPane1MousePressed(java.awt.event.MouseEvent evt) {
            projectNameID.setText("Mouse pressed");
            currentPoint.setText("("+evt.getX()+" , "+evt.getY()+")");
        }                                          But when my mouse moves on the jcomponent created on a layer then the mouse events don't work.
    That means I need to add mouse event for that component.
    Now how can I do that?
    Edited by: fireball003 on Feb 28, 2008 1:12 PM

  • How to adjust mouse event with scaled DesktopPane

    Hi
    I am manjunatha, i am developing Data warehouse product, in this, i am showing inter-related Transforms in desktop pane, i given option to view the content of desktop pane with different scaled factor (ex 100%,50%,25%), when i will scale the content of desktop pane using Graphics class, only content will be scaled, but the events on the Internal frames will be referring 100% view only,(ie mouse event will not effected by scaled factor, so it will be point to 100% view points only, ex at first an Internal Frame will have bounds(10,10,200,200), after i will scale this to 10%, it will be drawn with (1,1,20,20) on the desktop pane, but internally its bounds will be (10,10,200,200) and mouse event will detect Internal Frame at (10,10,200,200) location , instead of scaled (1,1,20,20) location.
    My question is how can i scale the Internal Frames and adjust relevant events to it?
    (You can see screen shot of this page with (Mapplet View as screen name)
    At www.MyDataWarehousing.com)

    Did you ever find a solution to this? How did you scale all the components on resize?

  • How to limited mouse event in JPanel?

    I have a Jpanel with implements mouseListenert(mouseExited), how to limited the mouse event?
    this how to work:
    1. when my mouse exit ( move out) the jpanel, jpanel will disapprear and it's work
    2. in jpanel i add Jtextfield ( jpanel.add(Jtextfield) ). This is the problem, when my mouse over the jtextfield ( where jtextfield is in the jpanel ) my jpanel disapprear. It mean that when my mouse over jtextfield, my mouse exit from jpanel too.
    So how to limited mouse listener or what must i do?

    i don't know how to do that can you modify this sample code, that the child component do nothing when my mouse over it
    JTextField tf = new JTextField();
    JPanel panel = new JPanel();
    panel.addMouseListener(new MouseAdapter() {
             public void mouseExited(MouseEvent e) {
              panel.setInvisible(false);
    panel.add(tf);thx..

  • How to process mouse event in the Label control?

    I am now tring a MorphFx program which would like implements a Squeak-Like-Morph operation for JavaFX nodes( include shapes, controls and others). currently it is only a prototype on [http://code.google.com/p/wangzaixiang/wiki/MorphFx]
    and there is webstart demo: [http://wangzaixiang.googlecode.com/svn/trunk/LearnJFX/dist/LearnJFX.jnlp]
    and a applet demo: [http://wangzaixiang.googlecode.com/svn/trunk/LearnJFX/dist/LearnJFX.html]
    There is a problem for new created Label control, which dont fire the "onMousePressed" or other "onMouseXXXX" event, and i have not found any way to do that.
    Can somebody tell me how can i add a onMousePressed event to a label and make it works?
    Very thanks.

    I can confirm the same behaviour when you try to capture eg the mouse clicking events on a progress indicator (also MouseMove). These kind of things are a bit useless most of the time in apps, but nevertheless in fact their event listeners should be correctly implemented or otherwise well documented if not. And in my opinion the javaFx API as well as the language specification/documentation can be far more written in details as it is now. So actually I don't know if SUN wanted that kind of behaviour for controls like that or not.
    Somebody from the javaFx SUN team can answer perhaps ?
    PS
    Of course a workaround with shadow node behind works well if the events will propagate through the label. I didn't test it but think this will work.
    -G
    Edited by: guyvo on Jan 19, 2010 1:50 PM
    Edited by: guyvo on Jan 19, 2010 1:55 PM

  • How can I mark event as "done" so that I see this at one glance?

    how can I mark an event on ical as "done" so that I see this at one glance? In outlook this was possible, there was a white line on the left once I had marked the event as "done".

    Greetings,
    If you are new iCal user read this: http://support.apple.com/kb/HT2513
    Events are more along the lines of a...well...event   "Appointment with Dr. Smith"..."Travel to Mexico"..."Jon's Birthday".
    What you are describing is what I would call a task.  iCal offers "To Dos" for that purpose which include a check box for completion.
    Cheers!

  • How can I create events dynamic for a Group/List?

    Hey,
    atm I'm programming a little application where i want to add elements to my center-pane.
    Simpyfied I got:
    - Center Pane : here shall the elements appear on right click in bottom-pane. This pane shall be used as anything like a playground where you can drag/drop and connect items from the bottom-pane
    - Bottom Pane: here I got about 180 elements which are quite equal. This is sth like a menu of items which you can use. I realised them in java classes extended from a parent class with differend calulations.
    What I want:
    I want to create an event handler for EACH of the "menu" elements dynamically. Just sth like:
        for (int i = 0; i < basic_menu_list.size(); i++)
          final Element el = hbox_bottom.getChildren().get(i);
          hbox_bottom.getChildren().get(i).setOnMouseClicked(new EventHandler<MouseEvent>()
            public void handle(MouseEvent event)
              if (event.isSecondaryButtonDown())
                playground.add(el);
                redrawPlayground();
        }But as i expected this doesnt work...
    Now my question:
    How can I solve this problem? Is there any option to listen to all elements of a group without hard-coding every single listener?
    Thanks for your help,
    Martin

    Hello User,
    Why did you expect that it wouldn't work?
    You have an example with "transition" apply on a bunch of circles in the Getting Started with JavaFx (http://download.oracle.com/javafx/2.0/get_started/jfxpub-get_started.htm)
    Here a basic example class...
    import javafx.application.Application;
    import javafx.event.EventHandler;
    import javafx.scene.Node;
    import javafx.scene.Scene;
    import javafx.scene.control.TextBox;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.Pane;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class HelloWorld extends Application {
        //~ ----------------------------------------------------------------------------------------------------------------
        //~ Methods
        //~ ----------------------------------------------------------------------------------------------------------------
        public static void main(String[] args) {
            // Entry point
            Application.launch(args);
        @Override
        public void start(Stage mainStage) throws Exception {
            Pane pane = new Pane();
            Scene scene = new Scene(pane, 200, 200);
            VBox vBox = new VBox();
            TextBox input1 = new TextBox();
            TextBox input2 = new TextBox();
            vBox.getChildren().addAll(input1, input2);
            for (Node input : vBox.getChildren()) {
                input.setOnMouseClicked(new EventHandler<MouseEvent>() {
                        public void handle(MouseEvent event) {
                            System.out.println("test click");
            pane.getChildren().add(vBox);
            mainStage.setScene(scene);
            mainStage.setVisible(true);
    }Niculaiu

Maybe you are looking for