I am working on a OpenOffice Add-on to open a browser when mouse is clicked and Alt key is pressed at the same time, as follows.
public boolean mousePressed(MouseEvent mouseEvent) {
if ((mouseEvent.Buttons == MouseButton.LEFT) && (mouseEvent.ClickCount == 1) && (mouseEvent.Modifiers == com.sun.star.awt.KeyModifier.MOD2)) {
System.out.println("mousePressed, User pressed Alt key and clicked mouse!");
desktop.browse(new URI("www.google.com"));
}
return false;
}
There are two problems:
1, Sometimes only one browser is opened, but sometimes more than one browsers are opened.
Why is desktop.browse() called many times to open many browsers?
2, If only one browser is opened, the focus is not on the browser but still on the OpenOffice application.
How can we make the focus on the browser?
Can anybody give some solutions for the two problems?
Thank you very much!
Too many browsers are opened when mouse pressed
-
- Posts: 3
- Joined: Sun Oct 19, 2008 6:12 pm
Re: Too many browsers are opened when mouse pressed
You would get more response if you posted in the Macros and UNO forum. The Writer forum is for general Writer usage isuues, not programming.
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
Gurkha Welfare Trust
Re: Too many browsers are opened when mouse pressed
[Moved to Macros and UNO API]
AOO4/LO5 • Linux • Fedora 23