|
 |
灌水专区 |
|
|
|
|
|
| 主题:GWT2SWF——Java开源GWT与FLASH/FLEX集成工具包 |
|
|
|
| 狄丝 |
|
 |
等 级:准尉 |
 |
经 验:5345 |
 |
性 别:美女 |
 |
文 章:711 |
 |
精 华:40 |
|
|
|
|
GWT2SWF :GWT与FLASH/FLEX集成工具包。
官方网站:http://gwt2swf.sourceforge.net/
下载地址:http://sourceforge.net/project/showfiles.php?group_id=189157
| Quick start |
First of all you should download:
GWT2SWF Library
GWT2SWF Hello World - sources for following example
| Step 1. |
Let’s create new project in eclipse, name it 'gwt2swf-helloworld'. |
| |
Using gwt tool create project
./projectCreator
-eclipse gwt2swf-helloworld
-ant gwt2swf-helloworld
-out ~/workspace/java-eclipse/gwt2swf-helloworld
-overwrite
|
|
| |
and create new application
./applicationCreator
-eclipse gwt2swf-helloworld
-out ~/workspace/java-eclipse/gwt2swf-helloworld
pl.rmalinowski.gwt2swf.client.GWT2SWFHelloWorld
|
|
| |
Now add new library to project (Eclipse menu-> Project propertis -> java build files -> librarys -> Add Jar -> gwt2swf.jar |
| Step 2. |
Refresh Eclipse. You shold see 'GWT2SWFHelloWorld.java' in 'pl.rmalinowski.gwt2swf.client' package.
package pl.rmalinowski.gwt2swf.client;
import pl.rmalinowski.gwt2swf.client.ui.SWFWidget;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
/**
* Entry point classes define onModuleLoad().
*/
public class GWT2SWFHelloWorld
implements EntryPoint, ClickListener {
private final Button addNewSwf = new Button("Add new SWF");
/**
* This is the entry point method.
*/
public void onModuleLoad() {
RootPanel.get().add(addNewSwf);
addNewSwf.addClickListener(this);
}
public void onClick(Widget sender) {
SWFWidget swfWidget =
new SWFWidget("hello.swf", //swf name
new Integer(200), //swf width
new Integer(150)); //swf height
// Fist you must add swfWidget to RootPanel
RootPanel.get().add(swfWidget);
// And after that you can safety show swf movie
swfWidget.show();
}
}
|
|
| |
and lunch projekt now. You should see this. |
|
|
|
 |
上帝给我大脑于是我思考,上帝给我双腿于是我奔跑,上帝给我十指,于是我上网.经过思考后,我奔跑着来上网! |
|
|
|
|
|
|
|
|
|