Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
No JavaBeans support!?: [platform-swt-dev] java.awt.Image

Thank you for clarification - but this means that under java2 and eclipse on linux I cannot use classes written according to JavaBeans specification! 

Will there be an efford to fix it or such feature will be available just for windows?

For me this is a blocker - I love javabeans and I want to write more than one platform applications - I guess I should now relax for a while and wait if things get better over time. 

Thank you both for all your answers.
jst


-----Original Message-----
From: "Silenio Quarti/OTT/OTI" <Silenio_Quarti@xxxxxxx>
Date: Tue, 27 Nov 2001 11:24:45 -0500
To: platform-swt-dev@xxxxxxxxxxx
Subject: Re: [platform-swt-dev] java.awt.Image


> Hi Jeff,
> 
> This is a known problem. You will not be able to mix AWT and SWT
> widgets/components on Motif/Linux due to a linkage problem. Basically,
> the AWT library is linked to a different Motif library than SWT is. This
> causes conflicts which result in a GPF.
> 
> Silenio
> 
> 
> 
> 
> 
> "Jess Terr" <jst@xxxxxxxxxxxxx>
> Sent by: platform-swt-dev-admin@xxxxxxxxxxx
> 11/27/01 02:41 AM
> Please respond to platform-swt-dev
> 
>  
>         To:     platform-swt-dev@xxxxxxxxxxx
>         cc: 
>         Subject:        Re: [platform-swt-dev] java.awt.Image
> 
> Thanks for reply Silenio.
> I have tried your suggestion, but my VM crashes. I tried to submit a bug 
> to bugzilla, but I cannot login because of invalid password (the one I 
> received contains space, maybe that is the problem - if somebody can fix 
> it I'll be glad).
> 
> So here is my bug report, see attached ZIP for demonstation case and log 
> file for error I received.
> 
> I am running Linux, sun's jdk1.3.1_01
> 
> Regards.
> jst
> 
> 
> 
> -----Original Message-----
> From: "Silenio Quarti/OTT/OTI" <Silenio_Quarti@xxxxxxx>
> Date: Mon, 26 Nov 2001 16:40:20 -0500
> To: platform-swt-dev@xxxxxxxxxxx
> Subject: Re: [platform-swt-dev] java.awt.Image
> 
> 
> > I believe the only possible way of doing what you want is by
> > getting the data out of the AWT image and create a SWT image
> > using that data. 
> > 
> > The code below shows how to do this. Keep in that the following 
> > code does not handle all images properly. For e
> > 
> > 
> > import java.awt.Frame;
> > import java.awt.MediaTracker;
> > import java.awt.Toolkit;
> > import java.awt.image.*;
> > import org.eclipse.swt.*;
> > import org.eclipse.swt.widgets.*;
> > import org.eclipse.swt.graphics.*;
> > 
> > public class AWTToSWTImage {
> > 
> > public static void main(String[] args) throws Exception {
> >         Frame frame = new Frame();
> > 
> >         java.awt.Image awtImage = 
> Toolkit.getDefaultToolkit().getImage("c:\\temp\\upgray.gif");
> >         MediaTracker tracker = new MediaTracker(frame);
> >         tracker.addImage(awtImage, 0);
> >         tracker.waitForAll();
> > 
> >         int width = awtImage.getWidth(null);
> >         int height = awtImage.getHeight(null);
> >         PixelGrabber grabber = new PixelGrabber(awtImage, 0, 0, width, 
> height, true);
> > 
> >         if (!grabber.grabPixels()) {
> >                 System.out.println("Error");
> >                 return;
> >         }
> > 
> >         DirectColorModel cm = 
> > (DirectColorModel)ColorModel.getRGBdefault();
> >         int[] pixels = (int[])grabber.getPixels();
> > 
> >         PaletteData palette = new PaletteData(cm.getRedMask(), 
> cm.getGreenMask(), cm.getBlueMask());
> >         ImageData data = new ImageData(width, height, cm.getPixelSize(), 
> palette);
> >         data.setPixels(0, 0, width * height, pixels, 0);
> > 
> >         Display display = new Display();
> >         Shell shell = new Shell(); 
> >         final Image swtImage = new Image(display, data); 
> >         shell.addListener(SWT.Paint, new Listener() {
> >                 public void handleEvent(Event e) {
> >                         GC gc = e.gc;
> >                         gc.drawImage(swtImage, 10, 10);
> >                 }
> >         });
> >         shell.setBounds(0, 0, 300, 300);
> >         shell.open();
> > 
> >         while (!shell.isDisposed()) {
> >                 if (!display.readAndDispatch()) display.sleep();
> >         }
> > }
> > 
> > }
> > 
> > 
> > 
> > 
> > 
> > 
> > "Jess Terr" <jst@xxxxxxxxxxxxx>
> > Sent by: platform-swt-dev-admin@xxxxxxxxxxx
> > 11/26/01 11:03 AM
> > Please respond to platform-swt-dev
> > 
> > 
> >         To:     platform-swt-dev@xxxxxxxxxxx
> >         cc: 
> >         Subject:        [platform-swt-dev] java.awt.Image
> > 
> > Hello.
> > I have tried to port my old AWT application to SWT and everything seemed 
> 
> > fine until I realized that AWT Image is not SWT Image.
> > 
> > That also would not be problem, if I was in control of creation of that 
> > image, but I am not. I just have plain reference to java.awt.Image and I 
> 
> > need a way to display it in SWT.
> > 
> > I am not expert in AWT nor SWT, but I expect a lot of such people 
> > subscribed to this mailing list. Can somebody help me, please?
> > 
> > Thank you in advance.
> > jst
> > 
> > -- 
> > 
> > _______________________________________________
> > Sign-up for your own FREE Personalized E-mail at Mail.com
> > http://www.mail.com/?sr=signup
> > 
> > 
> > 1 cent a minute calls anywhere in the U.S.!
> > 
> > http://www.getpennytalk.com/cgi-bin/adforward.cgi?p_key=RG9853KJ&url=http://www.getpennytalk.com
> > 
> > _______________________________________________
> > platform-swt-dev mailing list
> > platform-swt-dev@xxxxxxxxxxx
> > http://dev.eclipse.org/mailman/listinfo/platform-swt-dev
> > 
> > 
> > 
> > _______________________________________________
> > platform-swt-dev mailing list
> > platform-swt-dev@xxxxxxxxxxx
> > http://dev.eclipse.org/mailman/listinfo/platform-swt-dev
> > 
> > 
> 
> -- 
> 
> _______________________________________________
> Sign-up for your own FREE Personalized E-mail at Mail.com
> http://www.mail.com/?sr=signup
> 
> 
> 1 cent a minute calls anywhere in the U.S.!
> 
> http://www.getpennytalk.com/cgi-bin/adforward.cgi?p_key=RG9853KJ&url=http://www.getpennytalk.com
> 
> 
> 
> 
> _______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/platform-swt-dev
> 
> 

-- 

_______________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup


1 cent a minute calls anywhere in the U.S.!

http://www.getpennytalk.com/cgi-bin/adforward.cgi?p_key=RG9853KJ&url=http://www.getpennytalk.com



Back to the top