java focus problem

S

suru

Hi,
At top level problem is:
In Java application embedded with microsoft excel,
how to switch focus between java applet/dialog box and excel aptly?

Details:
I have an java application (basically applet) embedded with Microsoft
excel.
In application, i open Microsoft excel and then open application
workbooks.
These application workbooks are very much similar to excel workbooks,
with some
additional functinalities.
Also, various new menus for my application are added in excel.

Problem:
When i select my application menu from excel,
then i m expecting a dialog box to come.
That dialog (JDialog) is opened properly, but it doen't come in focus
automatically,
since the main applet is not in focus.

e.g.
1. I start my applet from excel (using Java Web Start) . This applet
basically listens
for various events fired from excel.
2. I select a option from my application menu to open dialog box. On
selection of option,
event is captured and passed to applet to open new dialog box.
3. The dialog box is opened, but it doesn't come in focus, since the
main applet is not in focus because currently focus is on excel. I
have to press "ALT+Tab" to get focus on that dialog box.

Any idea,
Q 1. Is there any method in java, by which, even if java application
(in this applet), is not in focus, the new dialog box opened will get
focus automatically?
Q2. Also, any guidelines for focusing issues, in such scenario, that
java application with excel.
Q3. Also, any suggestion for reverse, i.e. when i close dialog box,
the focus doesn't come on excel automatically.

i hope i have clarified the problem. :)

thnx,
suraj
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top