Re: can gwt work with javax.swing.* ?

2009-01-11 Thread DaBlick

GWT gets translated to Javascript.

Now, you might argue So?  I heard Swing is pure Java.   Why can't
SWING by translated by the compiler to JS?

The answer is because while Swing is pure Java, it is layered on top
of AWT which is anything BUT pure Java.

Thinking SWT?  Don't go there.  Like Swing it also uses native methods
(real native methods (calls to C code), not JSNI) too.

Where Swing and SWT ultimately make calls to native heavyweight
platform specific components, GWT makes calls to the browsers dom
handling interfaces via Javascript.

   db

On Jan 10, 2:31 pm, mikedshaf...@gmail.com mikedshaf...@gmail.com
wrote:
 OK, one of the things that you have to wrap your head around is how
 GWT works.  You write GWT using Java, but then the GWT compiler
 converts this into Javascript  HTML.  It can only do this to Java
 that it specifically knows about.  Your Swing JLabel component is not
 something GWT understands and therefore it can't compile it out into
 Javascript.  The strength of GWT is that you develop in Java, but if
 your code is going to be run in the browser, it has to be Java that is
 compatible with the GWT Compiler.

 Hope this helps.

 Later,

 Shaffer

 On Jan 10, 1:32 am, mars marsg...@gmail.com wrote:

  hi, all

  i m developing an gwt(actually gwt-ext) application, and need to use
  an external package which is mainly written with java awt and javax
  swing.  when i try to add that swing component to gwt panel, it won't
  pass through my question is 'does gwt work with swing'?

  my code is as below:

              ChartViewer viewer = new ChartViewer(); (ChartViewer is a
  subclass of the SWING JLabel component.)

              createChart(viewer, 0);
              VerticalPanel mainPanel = new VerticalPanel();
              mainPanel.add(viewer);  --- this one won't pass
  through

  please give me some help. thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: can gwt work with javax.swing.* ?

2009-01-11 Thread Tom Schindl

Hi,

Though what you are saying is perfectly right there are on going efforts
in Eclipse 4.x (short e4) to
provide an SWT-implementation for RIA toolkits like GWT, Flex, ... .

Tom

DaBlick schrieb:
 GWT gets translated to Javascript.

 Now, you might argue So?  I heard Swing is pure Java.   Why can't
 SWING by translated by the compiler to JS?

 The answer is because while Swing is pure Java, it is layered on top
 of AWT which is anything BUT pure Java.

 Thinking SWT?  Don't go there.  Like Swing it also uses native methods
 (real native methods (calls to C code), not JSNI) too.

 Where Swing and SWT ultimately make calls to native heavyweight
 platform specific components, GWT makes calls to the browsers dom
 handling interfaces via Javascript.

db

 On Jan 10, 2:31 pm, mikedshaf...@gmail.com mikedshaf...@gmail.com
 wrote:
   
 OK, one of the things that you have to wrap your head around is how
 GWT works.  You write GWT using Java, but then the GWT compiler
 converts this into Javascript  HTML.  It can only do this to Java
 that it specifically knows about.  Your Swing JLabel component is not
 something GWT understands and therefore it can't compile it out into
 Javascript.  The strength of GWT is that you develop in Java, but if
 your code is going to be run in the browser, it has to be Java that is
 compatible with the GWT Compiler.

 Hope this helps.

 Later,

 Shaffer

 On Jan 10, 1:32 am, mars marsg...@gmail.com wrote:

 
 hi, all
   
 i m developing an gwt(actually gwt-ext) application, and need to use
 an external package which is mainly written with java awt and javax
 swing.  when i try to add that swing component to gwt panel, it won't
 pass through my question is 'does gwt work with swing'?
   
 my code is as below:
   
 ChartViewer viewer = new ChartViewer(); (ChartViewer is a
 subclass of the SWING JLabel component.)
   
 createChart(viewer, 0);
 VerticalPanel mainPanel = new VerticalPanel();
 mainPanel.add(viewer);  --- this one won't pass
 through
   
 please give me some help. thanks!
   
 

   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: can gwt work with javax.swing.* ?

2009-01-10 Thread mikedshaf...@gmail.com

OK, one of the things that you have to wrap your head around is how
GWT works.  You write GWT using Java, but then the GWT compiler
converts this into Javascript  HTML.  It can only do this to Java
that it specifically knows about.  Your Swing JLabel component is not
something GWT understands and therefore it can't compile it out into
Javascript.  The strength of GWT is that you develop in Java, but if
your code is going to be run in the browser, it has to be Java that is
compatible with the GWT Compiler.

Hope this helps.

Later,

Shaffer

On Jan 10, 1:32 am, mars marsg...@gmail.com wrote:
 hi, all

 i m developing an gwt(actually gwt-ext) application, and need to use
 an external package which is mainly written with java awt and javax
 swing.  when i try to add that swing component to gwt panel, it won't
 pass through my question is 'does gwt work with swing'?

 my code is as below:

             ChartViewer viewer = new ChartViewer(); (ChartViewer is a
 subclass of the SWING JLabel component.)

             createChart(viewer, 0);
             VerticalPanel mainPanel = new VerticalPanel();
             mainPanel.add(viewer);  --- this one won't pass
 through

 please give me some help. thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---