Java: In different interface styles JPopupMenu and mouse events mousepressed performance results are different!

Source: Internet
Author: User

Today, I met a depressing thing:

A jlist element is placed on a jframe, and this jlist element adds a mouse event:

mousereleased, mousepressed ...

Among them, in mousereleased, a pop-up menu is displayed primarily. In mousepressed, enter whether the user presses the left or right button.

But I found a strange thing,

When I set the current interface to:
Uimanager.setlookandfeel ("Com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
The mousepressed event cannot be triggered when the popup menu is displayed, followed by the right button.

It is not possible to change to a few other styles, only set as default:
Uimanager.setlookandfeel ("Javax.swing.plaf.basic.BasicLookAndFeel");
Only then, when the pop-up menu is displayed, and then right-click, the Mousepressed event can also be triggered.

Is this a bug? This is all the time, there is no such a low-level bug it?

Recall that year when the use of jdk1.3, JTextArea always unable to set the text at the same time as the coarse italic, then always find out where the problem, later only to know that the original is a bug, Dizzy dead.

This time, I do not know what caused the cause.

2009-10-23

Java: In different interface styles JPopupMenu and mouse events mousepressed performance results are different!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.