cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Java Tool can't load in disply

ddhini
14-Alexandrite

Java Tool can't load in disply

I made a tool using J-link and Java .I successfully loaded my tool in creo Session using Auxiliary Application=>Register an it loaded Successfully.When I click the button to open the tool then it will load but can't get the tool in-front of display. Everytime I am Using Alt+Tab and access the tool.Please help me to solve this .Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
sjuraj
13-Aquamarine
(To:ddhini)

Well, this is matter of Java not a J-link.

Solution could be to set JDialog always on top (see docs Window (Java Platform SE 7 )).

If you need your dialog to be shown on top of Creo only, you will probably have to make windows event hook using JNI (or JNA) and user32.dll library, but I cant give you any example, you will have to search for solution on internet.

View solution in original post

10 REPLIES 10
sjuraj
13-Aquamarine
(To:ddhini)

If you are using Swing tool then it is normal behaviour. You can set Swing dialog AlwaysOnTop.

ddhini
14-Alexandrite
(To:sjuraj)

Sorry ,Give me a brief explanation.

sjuraj
13-Aquamarine
(To:ddhini)

What is the tool which is not in-front ? Is it JOptionPane ?

ddhini
14-Alexandrite
(To:sjuraj)

No it is a JDialog .When i entered first time in proe  i click the button to open my tool .But it cant loading.I am using Alt +tab key to bring that front.But afterwards its working perfect

sjuraj
13-Aquamarine
(To:ddhini)

Well, this is matter of Java not a J-link.

Solution could be to set JDialog always on top (see docs Window (Java Platform SE 7 )).

If you need your dialog to be shown on top of Creo only, you will probably have to make windows event hook using JNI (or JNA) and user32.dll library, but I cant give you any example, you will have to search for solution on internet.

ddhini
14-Alexandrite
(To:sjuraj)

Yes you are absolutely right. j dialog is set to front but   am using j frame to show some message in between process.But it can't load but it opened in background.how to rectify this?

sjuraj
13-Aquamarine
(To:ddhini)

You have to search on the internet. This can be useful java - Is it possible to bring JFrame to front but NOT focus? - Stack Overflow

ddhini
14-Alexandrite
(To:sjuraj)

Thank you, am trying....

ddhini
14-Alexandrite
(To:sjuraj)

skvarka juraj,I set my parent dialog SetAlwaysTop equal to True.But when i use this for JOptionPane.showmessageialog it can't load to front ..Don't know how to overcome this.please help me

sjuraj
13-Aquamarine
(To:ddhini)

Try this: java - JOptionPane won't show its dialog on top of other windows - Stack Overflow

But if you need only to display info use session.UIShowMessageDialog instead.