Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT_AWT bridge problems
SWT_AWT bridge problems [message #455166] Mon, 09 May 2005 14:24 Go to next message
Robert Bacs is currently offline Robert BacsFriend
Messages: 165
Registered: July 2009
Senior Member
Hi,

I'm using the SWT_AWT bridge to create an AWT frame. On this frame I've
created a JScrollPane and added a custom scrollable Label to this pane. The
problem is that when I push the ALT key down I get the following stacktrace:

java.lang.NullPointerException
at javax.swing.SwingUtilities.getWindowAncestor(SwingUtilities. java:63)
at
com.sun.java.swing.plaf.windows.WindowsRootPaneUI$AltProcess or.postProcessKe
yEvent(WindowsRootPaneUI.java:158)
at
java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Defaul tKeyboardFocusMa
nager.java:637)
at
java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Def aultKeyboardFocu
sManager.java:831)
at
java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Def aultKeyboardFocu
sManager.java:741)
at
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKe yboardFocusManag
er.java:592)
at java.awt.Component.dispatchEventImpl(Component.java:3506)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventD ispatchThread.ja
va:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDis patchThread.java
:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:10 0)


Anyone could help me ?

Best regards,
Boby
Re: SWT_AWT bridge problems [message #455185 is a reply to message #455166] Mon, 09 May 2005 23:07 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Can you enter a bug report with the code? Thanks.

"Robert Bacs" <boby@zerosoft.ro> wrote in message
news:d5ns9l$5vu$1@news.eclipse.org...
> Hi,
>
> I'm using the SWT_AWT bridge to create an AWT frame. On this frame I've
> created a JScrollPane and added a custom scrollable Label to this pane.
The
> problem is that when I push the ALT key down I get the following
stacktrace:
>
> java.lang.NullPointerException
> at javax.swing.SwingUtilities.getWindowAncestor(SwingUtilities. java:63)
> at
>
com.sun.java.swing.plaf.windows.WindowsRootPaneUI$AltProcess or.postProcessKe
> yEvent(WindowsRootPaneUI.java:158)
> at
>
java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Defaul tKeyboardFocusMa
> nager.java:637)
> at
>
java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Def aultKeyboardFocu
> sManager.java:831)
> at
>
java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Def aultKeyboardFocu
> sManager.java:741)
> at
>
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKe yboardFocusManag
> er.java:592)
> at java.awt.Component.dispatchEventImpl(Component.java:3506)
> at java.awt.Container.dispatchEventImpl(Container.java:1627)
> at java.awt.Window.dispatchEventImpl(Window.java:1606)
> at java.awt.Component.dispatchEvent(Component.java:3477)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
> at
>
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventD ispatchThread.ja
> va:201)
> at
>
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDis patchThread.java
> :151)
> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:145)
> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:137)
> at java.awt.EventDispatchThread.run(EventDispatchThread.java:10 0)
>
>
> Anyone could help me ?
>
> Best regards,
> Boby
>
>
Re: SWT_AWT bridge problems [message #455193 is a reply to message #455185] Tue, 10 May 2005 08:23 Go to previous messageGo to next message
Robert Bacs is currently offline Robert BacsFriend
Messages: 165
Registered: July 2009
Senior Member
Hi Steve,

I wrote a snippet to introduce a bug report and found out that this
exception is generated only if I set the look and feel to system LF.

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClass Name());


Bellow is the snippet:

import java.awt.Frame;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import org.eclipse.swt.SWT;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class SWTAWTTest {
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new FillLayout());

Composite container = new Composite(shell, SWT.EMBEDDED);
container.setLayout(new FillLayout());

Frame frame = SWT_AWT.new_Frame(container);

try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClass Name());
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnsupportedLookAndFeelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

shell.pack();
shell.open();

while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
}

If you still think that this is a SWT_AWT bridge problem I will enter a bug
report with this snippet attached to it.

Thanks and regards,
Boby


"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:d5oqua$efh$1@news.eclipse.org...
> Can you enter a bug report with the code? Thanks.
>
> "Robert Bacs" <boby@zerosoft.ro> wrote in message
> news:d5ns9l$5vu$1@news.eclipse.org...
> > Hi,
> >
> > I'm using the SWT_AWT bridge to create an AWT frame. On this frame I've
> > created a JScrollPane and added a custom scrollable Label to this pane.
> The
> > problem is that when I push the ALT key down I get the following
> stacktrace:
> >
> > java.lang.NullPointerException
> > at javax.swing.SwingUtilities.getWindowAncestor(SwingUtilities. java:63)
> > at
> >
>
com.sun.java.swing.plaf.windows.WindowsRootPaneUI$AltProcess or.postProcessKe
> > yEvent(WindowsRootPaneUI.java:158)
> > at
> >
>
java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Defaul tKeyboardFocusMa
> > nager.java:637)
> > at
> >
>
java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Def aultKeyboardFocu
> > sManager.java:831)
> > at
> >
>
java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Def aultKeyboardFocu
> > sManager.java:741)
> > at
> >
>
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKe yboardFocusManag
> > er.java:592)
> > at java.awt.Component.dispatchEventImpl(Component.java:3506)
> > at java.awt.Container.dispatchEventImpl(Container.java:1627)
> > at java.awt.Window.dispatchEventImpl(Window.java:1606)
> > at java.awt.Component.dispatchEvent(Component.java:3477)
> > at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
> > at
> >
>
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventD ispatchThread.ja
> > va:201)
> > at
> >
>
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDis patchThread.java
> > :151)
> > at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:145)
> > at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:137)
> > at java.awt.EventDispatchThread.run(EventDispatchThread.java:10 0)
> >
> >
> > Anyone could help me ?
> >
> > Best regards,
> > Boby
> >
> >
>
>
Re: SWT_AWT bridge problems [message #455207 is a reply to message #455193] Tue, 10 May 2005 17:04 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Yes please do.

"Robert Bacs" <boby@zerosoft.ro> wrote in message
news:d5prh5$d7p$1@news.eclipse.org...
> Hi Steve,
>
> I wrote a snippet to introduce a bug report and found out that this
> exception is generated only if I set the look and feel to system LF.
>
> UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClass Name());
>
>
> Bellow is the snippet:
>
> import java.awt.Frame;
>
> import javax.swing.UIManager;
> import javax.swing.UnsupportedLookAndFeelException;
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.awt.SWT_AWT;
> import org.eclipse.swt.layout.FillLayout;
> import org.eclipse.swt.widgets.Composite;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
>
> public class SWTAWTTest {
> public static void main(String[] args) {
> final Display display = new Display();
> final Shell shell = new Shell(display);
> shell.setLayout(new FillLayout());
>
> Composite container = new Composite(shell, SWT.EMBEDDED);
> container.setLayout(new FillLayout());
>
> Frame frame = SWT_AWT.new_Frame(container);
>
> try {
> UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClass Name());
> } catch (ClassNotFoundException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> } catch (InstantiationException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> } catch (IllegalAccessException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> } catch (UnsupportedLookAndFeelException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>
> shell.pack();
> shell.open();
>
> while (!shell.isDisposed ()) {
> if (!display.readAndDispatch ()) display.sleep ();
> }
> display.dispose ();
> }
> }
>
> If you still think that this is a SWT_AWT bridge problem I will enter a
bug
> report with this snippet attached to it.
>
> Thanks and regards,
> Boby
>
>
> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> news:d5oqua$efh$1@news.eclipse.org...
> > Can you enter a bug report with the code? Thanks.
> >
> > "Robert Bacs" <boby@zerosoft.ro> wrote in message
> > news:d5ns9l$5vu$1@news.eclipse.org...
> > > Hi,
> > >
> > > I'm using the SWT_AWT bridge to create an AWT frame. On this frame
I've
> > > created a JScrollPane and added a custom scrollable Label to this
pane.
> > The
> > > problem is that when I push the ALT key down I get the following
> > stacktrace:
> > >
> > > java.lang.NullPointerException
> > > at
javax.swing.SwingUtilities.getWindowAncestor(SwingUtilities. java:63)
> > > at
> > >
> >
>
com.sun.java.swing.plaf.windows.WindowsRootPaneUI$AltProcess or.postProcessKe
> > > yEvent(WindowsRootPaneUI.java:158)
> > > at
> > >
> >
>
java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Defaul tKeyboardFocusMa
> > > nager.java:637)
> > > at
> > >
> >
>
java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Def aultKeyboardFocu
> > > sManager.java:831)
> > > at
> > >
> >
>
java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Def aultKeyboardFocu
> > > sManager.java:741)
> > > at
> > >
> >
>
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKe yboardFocusManag
> > > er.java:592)
> > > at java.awt.Component.dispatchEventImpl(Component.java:3506)
> > > at java.awt.Container.dispatchEventImpl(Container.java:1627)
> > > at java.awt.Window.dispatchEventImpl(Window.java:1606)
> > > at java.awt.Component.dispatchEvent(Component.java:3477)
> > > at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
> > > at
> > >
> >
>
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventD ispatchThread.ja
> > > va:201)
> > > at
> > >
> >
>
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDis patchThread.java
> > > :151)
> > > at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:145)
> > > at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:137)
> > > at java.awt.EventDispatchThread.run(EventDispatchThread.java:10 0)
> > >
> > >
> > > Anyone could help me ?
> > >
> > > Best regards,
> > > Boby
> > >
> > >
> >
> >
>
>
Re: SWT_AWT bridge problems [message #455261 is a reply to message #455207] Wed, 11 May 2005 08:02 Go to previous message
Robert Bacs is currently offline Robert BacsFriend
Messages: 165
Registered: July 2009
Senior Member
Hi Steve,

Done it, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94618

Best regards,
Boby

"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:d5qq0t$olh$1@news.eclipse.org...
> Yes please do.
>
> "Robert Bacs" <boby@zerosoft.ro> wrote in message
> news:d5prh5$d7p$1@news.eclipse.org...
> > Hi Steve,
> >
> > I wrote a snippet to introduce a bug report and found out that this
> > exception is generated only if I set the look and feel to system LF.
> >
> > UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClass Name());
> >
> >
> > Bellow is the snippet:
> >
> > import java.awt.Frame;
> >
> > import javax.swing.UIManager;
> > import javax.swing.UnsupportedLookAndFeelException;
> >
> > import org.eclipse.swt.SWT;
> > import org.eclipse.swt.awt.SWT_AWT;
> > import org.eclipse.swt.layout.FillLayout;
> > import org.eclipse.swt.widgets.Composite;
> > import org.eclipse.swt.widgets.Display;
> > import org.eclipse.swt.widgets.Shell;
> >
> > public class SWTAWTTest {
> > public static void main(String[] args) {
> > final Display display = new Display();
> > final Shell shell = new Shell(display);
> > shell.setLayout(new FillLayout());
> >
> > Composite container = new Composite(shell, SWT.EMBEDDED);
> > container.setLayout(new FillLayout());
> >
> > Frame frame = SWT_AWT.new_Frame(container);
> >
> > try {
> >
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClass Name());
> > } catch (ClassNotFoundException e) {
> > // TODO Auto-generated catch block
> > e.printStackTrace();
> > } catch (InstantiationException e) {
> > // TODO Auto-generated catch block
> > e.printStackTrace();
> > } catch (IllegalAccessException e) {
> > // TODO Auto-generated catch block
> > e.printStackTrace();
> > } catch (UnsupportedLookAndFeelException e) {
> > // TODO Auto-generated catch block
> > e.printStackTrace();
> > }
> >
> > shell.pack();
> > shell.open();
> >
> > while (!shell.isDisposed ()) {
> > if (!display.readAndDispatch ()) display.sleep ();
> > }
> > display.dispose ();
> > }
> > }
> >
> > If you still think that this is a SWT_AWT bridge problem I will enter a
> bug
> > report with this snippet attached to it.
> >
> > Thanks and regards,
> > Boby
> >
> >
> > "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> > news:d5oqua$efh$1@news.eclipse.org...
> > > Can you enter a bug report with the code? Thanks.
> > >
> > > "Robert Bacs" <boby@zerosoft.ro> wrote in message
> > > news:d5ns9l$5vu$1@news.eclipse.org...
> > > > Hi,
> > > >
> > > > I'm using the SWT_AWT bridge to create an AWT frame. On this frame
> I've
> > > > created a JScrollPane and added a custom scrollable Label to this
> pane.
> > > The
> > > > problem is that when I push the ALT key down I get the following
> > > stacktrace:
> > > >
> > > > java.lang.NullPointerException
> > > > at
> javax.swing.SwingUtilities.getWindowAncestor(SwingUtilities. java:63)
> > > > at
> > > >
> > >
> >
>
com.sun.java.swing.plaf.windows.WindowsRootPaneUI$AltProcess or.postProcessKe
> > > > yEvent(WindowsRootPaneUI.java:158)
> > > > at
> > > >
> > >
> >
>
java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Defaul tKeyboardFocusMa
> > > > nager.java:637)
> > > > at
> > > >
> > >
> >
>
java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Def aultKeyboardFocu
> > > > sManager.java:831)
> > > > at
> > > >
> > >
> >
>
java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Def aultKeyboardFocu
> > > > sManager.java:741)
> > > > at
> > > >
> > >
> >
>
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKe yboardFocusManag
> > > > er.java:592)
> > > > at java.awt.Component.dispatchEventImpl(Component.java:3506)
> > > > at java.awt.Container.dispatchEventImpl(Container.java:1627)
> > > > at java.awt.Window.dispatchEventImpl(Window.java:1606)
> > > > at java.awt.Component.dispatchEvent(Component.java:3477)
> > > > at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
> > > > at
> > > >
> > >
> >
>
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventD ispatchThread.ja
> > > > va:201)
> > > > at
> > > >
> > >
> >
>
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDis patchThread.java
> > > > :151)
> > > > at
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:145)
> > > > at
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:137)
> > > > at java.awt.EventDispatchThread.run(EventDispatchThread.java:10 0)
> > > >
> > > >
> > > > Anyone could help me ?
> > > >
> > > > Best regards,
> > > > Boby
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Previous Topic:Sash Form allignment
Next Topic:Selection event not fired for tree.setSelection()
Goto Forum:
  


Current Time: Tue Sep 24 01:02:40 GMT 2024

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

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

Back to the top