Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6146353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:56:06+00:00 2026-05-23T18:56:06+00:00

How can I create a widget from the Javascript. For example I need to

  • 0

How can I create a widget from the Javascript. For example I need to create a simple button or table . I have some thirdaparty
javascripts which draw tables. Now if I want to create GWT widget by using those javascript what should I do first?
How other frameworks like GWTExt,SmartGWT, are using custom Widgets? Are they starting from the scratch or They reuse the
GWT widget functionality? Like if I want to create one table in my own style, do I need to inherit GWT Table?can anybody
give one example or sample code how to create a widget from the javascript? If my questions are wrong please excuse me.

example:

Mytable table = new Mytable(2,3). then it should draw my own table with 2 columns and 3 rows

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:56:06+00:00Added an answer on May 23, 2026 at 6:56 pm

    You are asking a lot of questions here. In your case you should create as much questions in so as you have qustion marks in your original post.

    Regarding your first question, look at JSNI.

    Edit: So okrasz gave you a number of references to look at. From my side I’ll try to help with your example using JSNI (because you were asking about binding your existing js to GWT).

    Let’s say you have your MyTable defined as

    <script type="text/javascript">
        MyTable = function(a,b){
            this.a = a;
            this.b = b;
        };
    </script>
    

    and your js file is called mytable.js

    Now, we need this to be a component. In your .java file in GWT library project create a class like this:

    public class MyTable extends JavaScriptObject {
        protected MyTable(){}
        public static native MyTable create(double a, double b) /*-{
            return new MyTable(a,b);
        }-*/;
        public final native double getA() /*-{
            return this.a;
        }-*/;
    
        public final native double getB() /*-{
            return this.b;
        }-*/;
    }
    

    Add your original js file to the resources and add a script node to your gwt.xml module like this:

    <module>
      <inherits name="com.google.gwt.core.Core"/>
      <script src="path/to/mytable.js"/>
      <source path="client"/>
      <public path="public"/>
    </module>
    

    That’s pretty much it. I might forgot something but you can reference any oss project that does the same thing you need. For instance, take a look at swfupload-gwt project source code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given an html/javascript 'widget' which needs to have certain fields customized before use. For
I am trying to use a textarea form entry which I have some javascript
this question can create a misunderstanding: I know I have to use CSS to
Is there anyway I can create a not in clause like I would have
I want to know if i can create a custom google maps application,on which
I need to know if I can create a file in a specific folder,
I have some JavaScript code that is supposed to run on document.ready but I
Im trying to find out a good JavaScript library that can create a nice
Please excuse me if I'm simple here, I want to create a simple widget
I have a snippet to create a 'Like' button for our news site: <iframe

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.