[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.albireo] Re: Will there be a fix for ...

Here is the example (attached),

click on 'file' -> 'try me' to get the 2nd JOptionPane to come up... this way the gui and embedded swing composite are already loaded when it comes up.

You also need the piccolo library to get this project to work. downloadable at:
http://www.cs.umd.edu/hcil/jazz/download/piccolo/piccolo-1.2.zip


you can add the piccolo jars or put the piccolo portion as a project and link via a buildpath.

Gordon Hirsch wrote:
If you make your example available, I can take a look. There's no specific problem that I know of with JOptionPane, and I have successfully used JOptionPane dialogs in the past.

Cklewis wrote:
I just wrote a seperate program to test if the error was still happening and it is.

Here is exactly what i'm doing.

1)Create a Shell, set layout etc
2)Try JOptionPane.showInputDialog (works fine)
3)Create swing component (a piccolo "canvas", which is an extended JComponent)
4)Add my EmbeddedSwingComposite
5)Let the GUI load
6)Click on "file" menu and click on an item I have preset with an action lisener to call a function that loads another JOptionPane.showInputDialog


The result is the first JoptionPane is fine, but the second one freezes the entire program as soon as I click a button.

If you would like, I could upload the project so you can try it. It's just one file along with the folder with all the swing integration stuff from Gordon's example.

James Peltzer wrote:
You may need to provide a little more information. I know that I have
successfully used JOptionPane and JDialogs both before and after creating
EmbeddedSwingComposites. The code I am working from is modified from
Gordon's original article code.


Originally I was often having this problem when an invisible dialog was
added to the SwtInputBlocker... but I believe the fix for that one has since
been applied to the sample code.


I would also suspect that you are getting pop-under windows (your swing
window could be trapped behind your SWT Window) but it is hard to say. You
could also try the changes Gordon and I discuss in the September 19th post
to this group.


In short, I would hazard a guess that compatibility issues such as this are
vital to the project and will eventually be worked out.


-James

"Cklewis" <chriskwonlewis@xxxxxxx> wrote in message
news:fgg8p4$5ko$1@xxxxxxxxxxxxxxxxxxxx
Will there be a fix for letting you use JOptionPane and JDialogs(etc) ?

I noticed if I use JOptionPane BEFORE creating my EmbeddedSwingComposite
it works just fine. But if I attempt to use JOptionPane or a JDialog
after I've created the EmbeddedSwingComposite that it will display, but
it tends to freeze the whole program.


Not sure if you were aware of this problem, but it would be nice to be
able to use JOptionPane, and in my case a JDialog since the person
before me wrote a lot of code for that particular section which uses a
JDialog and JTrees. Initially i thought the problem was setting the
JDialog's frame owner to the awt frame in EmbeddedSwingComposite. But I
experimented with a regular JOptionPane(doesn't ask for the parent
component/frame) and noticed the same problem.



Attachment: swtSwingProblem.zip
Description: Zip compressed data