launching groovy console from button

B

bluerabbit

Hello everyone,

I've been trying to post my question on the groovy groups, however i
haven't had much luck.
I was hoping someone here would be able to help.

I am launching the groovy console after pressing a button.

ie. the following code gets triggered after pressing the button:

**********************************************

private void myButtonActionPerformed(java.awt.event.ActionEvent evt) {

// launching a groovy console
Console console = new Console();
console.run();

}

*********************************************

The problem is that my groovy console does not seem to have focus.
When I click on it, the JDialog containing the button (which launched
the groovy console) has focus instead. This means that I do not have
access to the groovy console I just launched.

How can I solve this issue? Can i make it non-modal somehow?

Help is very much appreciated it!
 
B

bluerabbit

Hello,

Anyone have any idea? I am launching the groovy console from a button
(contained in a JDialog), but the groovy console can not get focus.

I'm really stuck.

Thanks!
 
J

Jeff Higgins

bluerabbit said:
How can I solve this issue? Can i make it non-modal somehow?
Maybe java.awt.Dialog.setModalityType(java.awt.Dialog.ModalityType type)
 
J

Jeff Higgins

Jeff said:
Maybe java.awt.Dialog.setModalityType(java.awt.Dialog.ModalityType type)
Maybe
java.awt.Window.setModalExclusionType(java.awt.Dialog.ModalExclusionType
exclusionType)
 
T

tim.t.ho

bluerabbitwrote:


Maybe java.awt.Dialog.setModalityType(java.awt.Dialog.ModalityType type)

Thank you so much! it worked when I changed it to Modeless!

It's great that the console has focus, however now it seems like the
menu is not clickable/accessbile via mouse (strangely i do have access
to them by using the <alt> key, and also I can type in the
textarea).

Any ideas? This is very weird.

Help is very much appreciated it.
 
B

bluerabbit

bluerabbitwrote:


Maybe java.awt.Dialog.setModalityType(java.awt.Dialog.ModalityType type)

That worked! I used the Modeless modality type.

Now it seems like it has focus however the menus are not clickable/
accessible via mouse. Any ideas?

It's weird since it seems like i have access through the keyboard ie.
<alt>-f to go to the File menu.
 

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,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top