Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Swing in SWT
Swing in SWT [message #463783] Tue, 15 November 2005 07:01 Go to next message
Bernhard is currently offline BernhardFriend
Messages: 11
Registered: July 2009
Junior Member
The problem that I have is that if I have multiple views(with Swing Panels
embedded) open in my eclipse environment once I maximize a view and
minimize the view again the current view refreshes but the other views do
not. It still shows the content of the "maximized" view, how can I fix
this?

Thanks in advance
Re: Swing in SWT [message #463869 is a reply to message #463783] Tue, 15 November 2005 13:18 Go to previous messageGo to next message
Haris Peco is currently offline Haris PecoFriend
Messages: 1072
Registered: July 2009
Senior Member
Bernhard wrote:

> The problem that I have is that if I have multiple views(with Swing Panels
> embedded) open in my eclipse environment once I maximize a view and
> minimize the view again the current view refreshes but the other views do
> not. It still shows the content of the "maximized" view, how can I fix
> this?
>
> Thanks in advance
work fine for me on linux - what is your OS and how you add SWT_AWT frame ?
Re: Swing in SWT [message #463890 is a reply to message #463869] Tue, 15 November 2005 14:59 Go to previous messageGo to next message
Bernhard is currently offline BernhardFriend
Messages: 11
Registered: July 2009
Junior Member
Haris Peco wrote:

> Bernhard wrote:

>> The problem that I have is that if I have multiple views(with Swing Panels
>> embedded) open in my eclipse environment once I maximize a view and
>> minimize the view again the current view refreshes but the other views do
>> not. It still shows the content of the "maximized" view, how can I fix
>> this?
>>
>> Thanks in advance
> work fine for me on linux - what is your OS and how you add SWT_AWT frame ?

The OS I am currently using is windows, this is how i added the SWT_AWT
frame

bucketComposite = new Composite(parent, SWT.EMBEDDED);
Frame frame = SWT_AWT.new_Frame(bucketComposite);
frame.add(new BucketerPanel()); // JPanel

That's it the only thing is that the JPanel that I add uses JFreechart to
show some graphs. The other views that I have are initialized exactly the
same way.

thank you
Re: Swing in SWT [message #463909 is a reply to message #463890] Tue, 15 November 2005 17:55 Go to previous messageGo to next message
Haris Peco is currently offline Haris PecoFriend
Messages: 1072
Registered: July 2009
Senior Member
see swt snippets for swing (i think snippet 154, but there are yet another)
you have to add AWT panel to frame and then any Swing
I think that it work fine on windows , too
if you can't find i will send my view
> The OS I am currently using is windows, this is how i added the SWT_AWT
> frame
>
> bucketComposite = new Composite(parent, SWT.EMBEDDED);
> Frame frame = SWT_AWT.new_Frame(bucketComposite);
> frame.add(new BucketerPanel()); // JPanel
>
> That's it the only thing is that the JPanel that I add uses JFreechart to
> show some graphs. The other views that I have are initialized exactly the
> same way.
>
> thank you
Re: Swing in SWT [message #463984 is a reply to message #463909] Wed, 16 November 2005 06:27 Go to previous messageGo to next message
Bernhard is currently offline BernhardFriend
Messages: 11
Registered: July 2009
Junior Member
Haris Peco wrote:

> see swt snippets for swing (i think snippet 154, but there are yet another)
> you have to add AWT panel to frame and then any Swing
> I think that it work fine on windows , too
> if you can't find i will send my view
>> The OS I am currently using is windows, this is how i added the SWT_AWT
>> frame
>>
>> bucketComposite = new Composite(parent, SWT.EMBEDDED);
>> Frame frame = SWT_AWT.new_Frame(bucketComposite);
>> frame.add(new BucketerPanel()); // JPanel
>>
>> That's it the only thing is that the JPanel that I add uses JFreechart to
>> show some graphs. The other views that I have are initialized exactly the
>> same way.
>>
>> thank you
I tried it but it still didn't solve the problem the other views still
don't refresh after the view has been maximized and then minimized.

Thank you
Re: Swing in SWT [message #464014 is a reply to message #463984] Wed, 16 November 2005 15:25 Go to previous message
Haris Peco is currently offline Haris PecoFriend
Messages: 1072
Registered: July 2009
Senior Member
Bernhard wrote:

>>> bucketComposite = new Composite(parent, SWT.EMBEDDED);
>>> Frame frame = SWT_AWT.new_Frame(bucketComposite);
>>> frame.add(new BucketerPanel()); // JPanel
> I tried it but it still didn't solve the problem the other views still
> don't refresh after the view has been maximized and then minimized.
>

try next :

bucketComposite = new Composite(parent, SWT.NO_BACKGROUND | SWT.EMBEDDED);
bucketComposite.setLayout(new FillLayout());
try {
System.setProperty("sun.awt.noerasebackground", "true");
} catch (NoSuchMethodError error) {}
Frame frame = SWT_AWT.new_Frame(bucketComposite);
panel = new Panel(new BorderLayout()) {
public void update(Graphics g) {
paint(g);
}
};
frame.add(panel);
JRootPane root = new JRootPane();
panel.add(root);
contentPane = root.getContentPane();
contentPane.add(new BucketerPanel());
Re: Swing in SWT [message #464032 is a reply to message #464014] Wed, 16 November 2005 15:23 Go to previous message
Bernhard is currently offline BernhardFriend
Messages: 11
Registered: July 2009
Junior Member
Haris Peco wrote:

> Bernhard wrote:

>>>> bucketComposite = new Composite(parent, SWT.EMBEDDED);
>>>> Frame frame = SWT_AWT.new_Frame(bucketComposite);
>>>> frame.add(new BucketerPanel()); // JPanel
>> I tried it but it still didn't solve the problem the other views still
>> don't refresh after the view has been maximized and then minimized.
>>

> try next :

> bucketComposite = new Composite(parent, SWT.NO_BACKGROUND | SWT.EMBEDDED);
> bucketComposite.setLayout(new FillLayout());
> try {
> System.setProperty("sun.awt.noerasebackground", "true");
> } catch (NoSuchMethodError error) {}
> Frame frame = SWT_AWT.new_Frame(bucketComposite);
> panel = new Panel(new BorderLayout()) {
> public void update(Graphics g) {
> paint(g);
> }
> };
> frame.add(panel);
> JRootPane root = new JRootPane();
> panel.add(root);
> contentPane = root.getContentPane();
> contentPane.add(new BucketerPanel());

It works thank you for your time and effort. :)

Regards Bernhard
Previous Topic:tree with exclusive check-box
Next Topic:Bidirection / Right to left documentation for custom widget authors.
Goto Forum:
  


Current Time: Thu Apr 25 10:27:49 GMT 2024

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

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

Back to the top