christmo / macwidgets

Automatically exported from code.google.com/p/macwidgets
0 stars 0 forks source link

cannot fire mouse events using SourceListClickListener for some cases #54

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. add SourceListClickListener to a source list
2. click a source list item several times

What is the expected output? What do you see instead?
- Table should show file in Music Catagory when Music SourceListItem is
selected
 and also does not show when other SoureListItem is Selected 
-the clicked source list item is selected but sourceListItemClicked method
seems have not processed. It occurs randomly.

What version of the product are you using? On what operating system?
- Mac Widgets for Java 0.9.3 
- Windows XP
- JDK 6u11

Original issue reported on code.google.com by nwoedf@gmail.com on 25 Jan 2009 at 2:57

Attachments:

GoogleCodeExporter commented 8 years ago
Hi nwoedf,

I cannot reproduce this issue. Can you try running 
com.explodingpixels.macwidgets.DSourceListClickListener 
and verify that you see a printout after clicking an item?

-Ken

Original comment by kenneth....@gmail.com on 25 Jan 2009 at 6:34

GoogleCodeExporter commented 8 years ago

Original comment by kenneth....@gmail.com on 25 Jan 2009 at 6:34

GoogleCodeExporter commented 8 years ago
I have changed some code before testing

                SourceList sourceList = DSourceListMail.createSourceList();
To
                SourceListModel sm = new SourceListModel();
                SourceListCategory slc = new SourceListCategory("saasds");
                sm.addCategory(slc);
                sm.addItemToCategory(new SourceListItem("First"),slc);
                sm.addItemToCategory(new SourceListItem("Second"),slc);
                SourceList sourceList = new SourceList(sm);

Original comment by nwoedf@gmail.com on 26 Jan 2009 at 4:09

Attachments:

GoogleCodeExporter commented 8 years ago
This can be reporoduced without using Mac Widgets for Java and looks to be the 
following issue, which has 
been closed as "Not a Defect":

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6504580

The following code demonstrates the problem with a simple JTree:

JTree sourceList = new JTree(new String[]{
                        "Node One", "Node Two", "Node Three", "Node Four",
                        "Node Five"});

                sourceList.addMouseListener(new MouseAdapter() {
                    public void mouseClicked(MouseEvent e) {
                        System.out.println("Node clicked.");
                    }
                });

                JScrollPane scrollPane = new JScrollPane(sourceList);

                JFrame frame = new JFrame();
                frame.add(scrollPane, BorderLayout.CENTER);
                frame.setSize(225, 250);
                frame.setLocationRelativeTo(null);
                frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                frame.setVisible(true);

Original comment by kenneth....@gmail.com on 26 Jan 2009 at 12:05

GoogleCodeExporter commented 8 years ago
I think you want to be using a SourceListSelectionListener instead of the more 
manual SourceListClickListener.

Original comment by kenneth....@gmail.com on 26 Jan 2009 at 12:09

GoogleCodeExporter commented 8 years ago
It is the problem of Java actually.......Thank for your help

Original comment by nwoedf@gmail.com on 26 Jan 2009 at 12:34

GoogleCodeExporter commented 8 years ago
This is a Java issue -- I can't see a way to work around it at this time.

Original comment by kenneth....@gmail.com on 19 Jun 2009 at 11:40