Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Albireo » Re: Control.setParent() under Windows
Re: Control.setParent() under Windows [message #6771] Mon, 26 May 2008 13:02 Go to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6417
Registered: July 2009
Senior Member
If you don't get an answer here I can point you to the albeiro-newsgroup
which deals with Swing/AWT-SWT integration problems and people might
know more about the issues you can run into.

I would also suggest that your message title could have been better by
integrating Swing so people from this project skimming the newsgroups
take a look at your question.

I copied your request to this newsgroup.

See http://www.eclipse.org/albireo/

Tom

Magnus Konze schrieb:
> Sorry for pushing this topic. Perhaps my question was to detailed.
> Basically i'm interested with experiences with setParent() under
> Windows. So in short:
> Do i have to expect problems with setParent()? My application will only
> run under Windows systems.
> Regards Magnus
>
>
> Magnus Konze schrieb:
>> Hi!
>> I'm using the SWT_AWT bridge to add SWT-Controls to Swing.
>> When using the bridge in this direction the Swing Window has to be
>> visible, when adding SWT-Controls, otherwise you get a 'peer not
>> created'-Exception.
>> So i have to call setVisible(), although i don't know the size of the
>> SWT-Controls.
>> Here is my idea:
>> - create a new Shell with the Controls i want to add to the Swing Window
>> - compute the Shells size
>> - setSize() on the Swing Window
>> - setVisible() on the Swing Window
>> - create a new Shell on the Swing Window (SWT_AWT.new_Shell())
>> - set this Shell as the parent of my SWT Controls
>> - dispose first Shell
>>
>> The first Shell is never opened!
>>
>> I'm using Windows XP and it works fine. So my question is:
>> Do i have to expect problems on other systems (especially other
>> Windows systems)? Are there other problems aside from that it's not
>> possible to change the parent on all systems?
>>
>> Regards Magnus


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Control.setParent() under Windows [message #6778 is a reply to message #6771] Mon, 26 May 2008 15:08 Go to previous messageGo to next message
Magnus Konze is currently offline Magnus KonzeFriend
Messages: 35
Registered: July 2009
Member
Thank you very much!
Yes my problem is a very special one. It would be great, if anyone has a
solution for that.
But for now i'm generally interested in the reliability of setParent().
If it isn't recommended even under Windows, i could cancel my current
approach.

Magnus

Tom Schindl schrieb:
> If you don't get an answer here I can point you to the albeiro-newsgroup
> which deals with Swing/AWT-SWT integration problems and people might
> know more about the issues you can run into.
>
> I would also suggest that your message title could have been better by
> integrating Swing so people from this project skimming the newsgroups
> take a look at your question.
>
> I copied your request to this newsgroup.
>
> See http://www.eclipse.org/albireo/
>
> Tom
>
> Magnus Konze schrieb:
>> Sorry for pushing this topic. Perhaps my question was to detailed.
>> Basically i'm interested with experiences with setParent() under
>> Windows. So in short:
>> Do i have to expect problems with setParent()? My application will
>> only run under Windows systems.
>> Regards Magnus
>>
>>
>> Magnus Konze schrieb:
>>> Hi!
>>> I'm using the SWT_AWT bridge to add SWT-Controls to Swing.
>>> When using the bridge in this direction the Swing Window has to be
>>> visible, when adding SWT-Controls, otherwise you get a 'peer not
>>> created'-Exception.
>>> So i have to call setVisible(), although i don't know the size of the
>>> SWT-Controls.
>>> Here is my idea:
>>> - create a new Shell with the Controls i want to add to the Swing Window
>>> - compute the Shells size
>>> - setSize() on the Swing Window
>>> - setVisible() on the Swing Window
>>> - create a new Shell on the Swing Window (SWT_AWT.new_Shell())
>>> - set this Shell as the parent of my SWT Controls
>>> - dispose first Shell
>>>
>>> The first Shell is never opened!
>>>
>>> I'm using Windows XP and it works fine. So my question is:
>>> Do i have to expect problems on other systems (especially other
>>> Windows systems)? Are there other problems aside from that it's not
>>> possible to change the parent on all systems?
>>>
>>> Regards Magnus
>
>
Re: Control.setParent() under Windows [message #6785 is a reply to message #6778] Tue, 27 May 2008 17:54 Go to previous messageGo to next message
Gordon Hirsch is currently offline Gordon HirschFriend
Messages: 100
Registered: July 2009
Senior Member
Why do you need to reparent the shell at all? Couldn't you just resize
the original Swing frame once the preferred size of the shell is known?

Magnus Konze wrote:
> Thank you very much!
> Yes my problem is a very special one. It would be great, if anyone has a
> solution for that.
> But for now i'm generally interested in the reliability of setParent().
> If it isn't recommended even under Windows, i could cancel my current
> approach.
>
> Magnus
>
> Tom Schindl schrieb:
>> If you don't get an answer here I can point you to the
>> albeiro-newsgroup which deals with Swing/AWT-SWT integration problems
>> and people might know more about the issues you can run into.
>>
>> I would also suggest that your message title could have been better by
>> integrating Swing so people from this project skimming the newsgroups
>> take a look at your question.
>>
>> I copied your request to this newsgroup.
>>
>> See http://www.eclipse.org/albireo/
>>
>> Tom
>>
>> Magnus Konze schrieb:
>>> Sorry for pushing this topic. Perhaps my question was to detailed.
>>> Basically i'm interested with experiences with setParent() under
>>> Windows. So in short:
>>> Do i have to expect problems with setParent()? My application will
>>> only run under Windows systems.
>>> Regards Magnus
>>>
>>>
>>> Magnus Konze schrieb:
>>>> Hi!
>>>> I'm using the SWT_AWT bridge to add SWT-Controls to Swing.
>>>> When using the bridge in this direction the Swing Window has to be
>>>> visible, when adding SWT-Controls, otherwise you get a 'peer not
>>>> created'-Exception.
>>>> So i have to call setVisible(), although i don't know the size of
>>>> the SWT-Controls.
>>>> Here is my idea:
>>>> - create a new Shell with the Controls i want to add to the Swing
>>>> Window
>>>> - compute the Shells size
>>>> - setSize() on the Swing Window
>>>> - setVisible() on the Swing Window
>>>> - create a new Shell on the Swing Window (SWT_AWT.new_Shell())
>>>> - set this Shell as the parent of my SWT Controls
>>>> - dispose first Shell
>>>>
>>>> The first Shell is never opened!
>>>>
>>>> I'm using Windows XP and it works fine. So my question is:
>>>> Do i have to expect problems on other systems (especially other
>>>> Windows systems)? Are there other problems aside from that it's not
>>>> possible to change the parent on all systems?
>>>>
>>>> Regards Magnus
>>
>>
Re: Control.setParent() under Windows [message #6799 is a reply to message #6785] Mon, 02 June 2008 08:21 Go to previous message
Magnus Konze is currently offline Magnus KonzeFriend
Messages: 35
Registered: July 2009
Member
Yes, this is possible (it was my first approach), but it looks strange.
The Swing frame has to be visible before you can add SWT Components. So,
after calling setVisible() you can see an empty Window. After a moment
the SWT Components are added and the Window is resized... really an ugly
effect.

In my second approach (with reparenting) there is no resizing and the
SWT Components are added so fast, that you can't recognize the empty Window.

Regards
Magnus

Gordon Hirsch schrieb:
> Why do you need to reparent the shell at all? Couldn't you just resize
> the original Swing frame once the preferred size of the shell is known?
>
> Magnus Konze wrote:
>> Thank you very much!
>> Yes my problem is a very special one. It would be great, if anyone has
>> a solution for that.
>> But for now i'm generally interested in the reliability of
>> setParent(). If it isn't recommended even under Windows, i could
>> cancel my current approach.
>>
>> Magnus
>>
>> Tom Schindl schrieb:
>>> If you don't get an answer here I can point you to the
>>> albeiro-newsgroup which deals with Swing/AWT-SWT integration problems
>>> and people might know more about the issues you can run into.
>>>
>>> I would also suggest that your message title could have been better
>>> by integrating Swing so people from this project skimming the
>>> newsgroups take a look at your question.
>>>
>>> I copied your request to this newsgroup.
>>>
>>> See http://www.eclipse.org/albireo/
>>>
>>> Tom
>>>
>>> Magnus Konze schrieb:
>>>> Sorry for pushing this topic. Perhaps my question was to detailed.
>>>> Basically i'm interested with experiences with setParent() under
>>>> Windows. So in short:
>>>> Do i have to expect problems with setParent()? My application will
>>>> only run under Windows systems.
>>>> Regards Magnus
>>>>
>>>>
>>>> Magnus Konze schrieb:
>>>>> Hi!
>>>>> I'm using the SWT_AWT bridge to add SWT-Controls to Swing.
>>>>> When using the bridge in this direction the Swing Window has to be
>>>>> visible, when adding SWT-Controls, otherwise you get a 'peer not
>>>>> created'-Exception.
>>>>> So i have to call setVisible(), although i don't know the size of
>>>>> the SWT-Controls.
>>>>> Here is my idea:
>>>>> - create a new Shell with the Controls i want to add to the Swing
>>>>> Window
>>>>> - compute the Shells size
>>>>> - setSize() on the Swing Window
>>>>> - setVisible() on the Swing Window
>>>>> - create a new Shell on the Swing Window (SWT_AWT.new_Shell())
>>>>> - set this Shell as the parent of my SWT Controls
>>>>> - dispose first Shell
>>>>>
>>>>> The first Shell is never opened!
>>>>>
>>>>> I'm using Windows XP and it works fine. So my question is:
>>>>> Do i have to expect problems on other systems (especially other
>>>>> Windows systems)? Are there other problems aside from that it's not
>>>>> possible to change the parent on all systems?
>>>>>
>>>>> Regards Magnus
>>>
>>>
Re: Control.setParent() under Windows [message #574086 is a reply to message #6771] Mon, 26 May 2008 15:08 Go to previous message
Magnus Konze is currently offline Magnus KonzeFriend
Messages: 35
Registered: July 2009
Member
Thank you very much!
Yes my problem is a very special one. It would be great, if anyone has a
solution for that.
But for now i'm generally interested in the reliability of setParent().
If it isn't recommended even under Windows, i could cancel my current
approach.

Magnus

Tom Schindl schrieb:
> If you don't get an answer here I can point you to the albeiro-newsgroup
> which deals with Swing/AWT-SWT integration problems and people might
> know more about the issues you can run into.
>
> I would also suggest that your message title could have been better by
> integrating Swing so people from this project skimming the newsgroups
> take a look at your question.
>
> I copied your request to this newsgroup.
>
> See http://www.eclipse.org/albireo/
>
> Tom
>
> Magnus Konze schrieb:
>> Sorry for pushing this topic. Perhaps my question was to detailed.
>> Basically i'm interested with experiences with setParent() under
>> Windows. So in short:
>> Do i have to expect problems with setParent()? My application will
>> only run under Windows systems.
>> Regards Magnus
>>
>>
>> Magnus Konze schrieb:
>>> Hi!
>>> I'm using the SWT_AWT bridge to add SWT-Controls to Swing.
>>> When using the bridge in this direction the Swing Window has to be
>>> visible, when adding SWT-Controls, otherwise you get a 'peer not
>>> created'-Exception.
>>> So i have to call setVisible(), although i don't know the size of the
>>> SWT-Controls.
>>> Here is my idea:
>>> - create a new Shell with the Controls i want to add to the Swing Window
>>> - compute the Shells size
>>> - setSize() on the Swing Window
>>> - setVisible() on the Swing Window
>>> - create a new Shell on the Swing Window (SWT_AWT.new_Shell())
>>> - set this Shell as the parent of my SWT Controls
>>> - dispose first Shell
>>>
>>> The first Shell is never opened!
>>>
>>> I'm using Windows XP and it works fine. So my question is:
>>> Do i have to expect problems on other systems (especially other
>>> Windows systems)? Are there other problems aside from that it's not
>>> possible to change the parent on all systems?
>>>
>>> Regards Magnus
>
>
Re: Control.setParent() under Windows [message #574109 is a reply to message #6778] Tue, 27 May 2008 17:54 Go to previous message
Gordon Hirsch is currently offline Gordon HirschFriend
Messages: 100
Registered: July 2009
Senior Member
Why do you need to reparent the shell at all? Couldn't you just resize
the original Swing frame once the preferred size of the shell is known?

Magnus Konze wrote:
> Thank you very much!
> Yes my problem is a very special one. It would be great, if anyone has a
> solution for that.
> But for now i'm generally interested in the reliability of setParent().
> If it isn't recommended even under Windows, i could cancel my current
> approach.
>
> Magnus
>
> Tom Schindl schrieb:
>> If you don't get an answer here I can point you to the
>> albeiro-newsgroup which deals with Swing/AWT-SWT integration problems
>> and people might know more about the issues you can run into.
>>
>> I would also suggest that your message title could have been better by
>> integrating Swing so people from this project skimming the newsgroups
>> take a look at your question.
>>
>> I copied your request to this newsgroup.
>>
>> See http://www.eclipse.org/albireo/
>>
>> Tom
>>
>> Magnus Konze schrieb:
>>> Sorry for pushing this topic. Perhaps my question was to detailed.
>>> Basically i'm interested with experiences with setParent() under
>>> Windows. So in short:
>>> Do i have to expect problems with setParent()? My application will
>>> only run under Windows systems.
>>> Regards Magnus
>>>
>>>
>>> Magnus Konze schrieb:
>>>> Hi!
>>>> I'm using the SWT_AWT bridge to add SWT-Controls to Swing.
>>>> When using the bridge in this direction the Swing Window has to be
>>>> visible, when adding SWT-Controls, otherwise you get a 'peer not
>>>> created'-Exception.
>>>> So i have to call setVisible(), although i don't know the size of
>>>> the SWT-Controls.
>>>> Here is my idea:
>>>> - create a new Shell with the Controls i want to add to the Swing
>>>> Window
>>>> - compute the Shells size
>>>> - setSize() on the Swing Window
>>>> - setVisible() on the Swing Window
>>>> - create a new Shell on the Swing Window (SWT_AWT.new_Shell())
>>>> - set this Shell as the parent of my SWT Controls
>>>> - dispose first Shell
>>>>
>>>> The first Shell is never opened!
>>>>
>>>> I'm using Windows XP and it works fine. So my question is:
>>>> Do i have to expect problems on other systems (especially other
>>>> Windows systems)? Are there other problems aside from that it's not
>>>> possible to change the parent on all systems?
>>>>
>>>> Regards Magnus
>>
>>
Re: Control.setParent() under Windows [message #574157 is a reply to message #6785] Mon, 02 June 2008 08:21 Go to previous message
Magnus Konze is currently offline Magnus KonzeFriend
Messages: 35
Registered: July 2009
Member
Yes, this is possible (it was my first approach), but it looks strange.
The Swing frame has to be visible before you can add SWT Components. So,
after calling setVisible() you can see an empty Window. After a moment
the SWT Components are added and the Window is resized... really an ugly
effect.

In my second approach (with reparenting) there is no resizing and the
SWT Components are added so fast, that you can't recognize the empty Window.

Regards
Magnus

Gordon Hirsch schrieb:
> Why do you need to reparent the shell at all? Couldn't you just resize
> the original Swing frame once the preferred size of the shell is known?
>
> Magnus Konze wrote:
>> Thank you very much!
>> Yes my problem is a very special one. It would be great, if anyone has
>> a solution for that.
>> But for now i'm generally interested in the reliability of
>> setParent(). If it isn't recommended even under Windows, i could
>> cancel my current approach.
>>
>> Magnus
>>
>> Tom Schindl schrieb:
>>> If you don't get an answer here I can point you to the
>>> albeiro-newsgroup which deals with Swing/AWT-SWT integration problems
>>> and people might know more about the issues you can run into.
>>>
>>> I would also suggest that your message title could have been better
>>> by integrating Swing so people from this project skimming the
>>> newsgroups take a look at your question.
>>>
>>> I copied your request to this newsgroup.
>>>
>>> See http://www.eclipse.org/albireo/
>>>
>>> Tom
>>>
>>> Magnus Konze schrieb:
>>>> Sorry for pushing this topic. Perhaps my question was to detailed.
>>>> Basically i'm interested with experiences with setParent() under
>>>> Windows. So in short:
>>>> Do i have to expect problems with setParent()? My application will
>>>> only run under Windows systems.
>>>> Regards Magnus
>>>>
>>>>
>>>> Magnus Konze schrieb:
>>>>> Hi!
>>>>> I'm using the SWT_AWT bridge to add SWT-Controls to Swing.
>>>>> When using the bridge in this direction the Swing Window has to be
>>>>> visible, when adding SWT-Controls, otherwise you get a 'peer not
>>>>> created'-Exception.
>>>>> So i have to call setVisible(), although i don't know the size of
>>>>> the SWT-Controls.
>>>>> Here is my idea:
>>>>> - create a new Shell with the Controls i want to add to the Swing
>>>>> Window
>>>>> - compute the Shells size
>>>>> - setSize() on the Swing Window
>>>>> - setVisible() on the Swing Window
>>>>> - create a new Shell on the Swing Window (SWT_AWT.new_Shell())
>>>>> - set this Shell as the parent of my SWT Controls
>>>>> - dispose first Shell
>>>>>
>>>>> The first Shell is never opened!
>>>>>
>>>>> I'm using Windows XP and it works fine. So my question is:
>>>>> Do i have to expect problems on other systems (especially other
>>>>> Windows systems)? Are there other problems aside from that it's not
>>>>> possible to change the parent on all systems?
>>>>>
>>>>> Regards Magnus
>>>
>>>
Previous Topic:Alpha 2 is available
Next Topic:Re: Albireo (Swing/SWT integration) alpha available
Goto Forum:
  


Current Time: Mon Nov 19 22:21:51 GMT 2018

Powered by FUDForum. Page generated in 0.02204 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top