Hi,

   Firstly, I'm not sure about the array in Java language. It looks
like you'd like to lay down  six textbox to hold the data. Why don't
you declare one by one (TextBox txtOne = new TextBox(); , TextBox
txtTwo = new TextBox();). I've try this in eclipse and it works.

Hope this help,
Pote,


On Jan 5, 12:02 pm, Abhay Singh <[email protected]> wrote:
> Hi,
>
> Am sorry, but what is problem with arrays, I can't figure it out....
>
> On Jan 4, 6:27 pm, mariyan nenchev <[email protected]> wrote:
>
>
>
> > Could you check your arrays please.
>
> > On Mon, Jan 4, 2010 at 3:17 PM, Abhay Singh <[email protected]> wrote:
> > > Hi All,
>
> > > I am trying to build a DecoratedTabPanel where on click on each tab i
> > > will show different html pages, but
> > > these html pages are not related to each other and can be modified
> > > through html editor...
>
> > > let me be more clear, here is sample project
>
> > > ######### Sample.java  ############
> > > public class Sample implements EntryPoint {
>
> > >    public void onModuleLoad() {
>
> > >       // Create a tab panel
> > >         DecoratedTabPanel tabPanel = new DecoratedTabPanel();
> > >         tabPanel.setWidth("800px");
> > >         tabPanel.setHeight("500px");
> > >         tabPanel.setAnimationEnabled(true);
>
> > >                // Add a home tab
> > >                String[] tabTitles = { "Users", "Group", "Items" };
> > >                AddUser aduser = new AddUser();
> > >                tabPanel.add(aduser, tabTitles[0]);
>
> > >                // Add a tab with an image
> > >                HTML GText = new HTML("This Group tab");
> > >                tabPanel.add(GText, tabTitles[1]);
>
> > >                // Add a tab
> > >                tabPanel.add(hPanel, tabTitles[2]);
>
> > >                // Return the content
> > >                tabPanel.selectTab(0);
> > >                // tabPanel.ensureDebugId("cwTabPanel");
> > >                RootPanel.get().add(tabPanel);
> > >    }
> > > }
>
> > > This will generate one html file named as sample.html, havin 3 tab in
> > > it as Users, Groups, Items.
> > > default Tab "users" is selected,
>
> > > Now am trying to show contents of user tab, and its coming from
> > > AddUser.java
>
> > > ##### AddUser.java  #######
> > > public class AddUser extends HTML implements Constants {
> > >        TextBox[] UserDetails = new TextBox[6];
> > >        ListBox Users = new ListBox();
> > >        Button CopyUser = new Button();
> > >        Button AddButton = new Button();
> > >        Button CancleButton = new Button();
> > >        Button UpdateButton = new Button();
>
> > >        CheckBox CopyF = new CheckBox();
> > >        CheckBox[] UserRoles = new CheckBox[MAX_ROLES + 1];
>
> > >        public AddUser() {
> > >                RootPanel.get().clear();
> > >                RootPanel.get("Userid").add(UserDetails[0]);
> > >                UserDetails[0].setFocus(true);
>
> > >                RootPanel.get("userslist").add(Users);
> > >                RootPanel.get("copyuserbtn").add(CopyUser);
> > >                RootPanel.get("copyfiltchk").add(CopyF);
>
> > >                RootPanel.get("username").add(UserDetails[1]);
> > >                RootPanel.get("emailid").add(UserDetails[2]);
> > >                RootPanel.get("phoneno").add(UserDetails[3]);
> > >                RootPanel.get("title").add(UserDetails[4]);
> > >                RootPanel.get("defaultpwd").add(UserDetails[5]);
> > >        }
> > > }
> > > ################################################################
>
> > > But this is not happening and its throughin exceptions, and exceptions
> > > are
>
> > > ERROR] Unable to load module entry point class sample.client.Sample
> > > (see associated exception for details)
> > > java.lang.NullPointerException: null
> > >        at sample.client.AddUser.<init>(AddUser.java:28)
> > >        at sample.client.Sample.onModuleLoad(Sample.java:171)
> > >        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >        at sun.reflect.NativeMethodAccessorImpl.invoke
> > > (NativeMethodAccessorImpl.java:39)
> > >        at sun.reflect.DelegatingMethodAccessorImpl.invoke
> > > (DelegatingMethodAccessorImpl.java:25)
> > >        at java.lang.reflect.Method.invoke(Method.java:585)
> > >        at 
> > > com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:326)
> > >        at com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace
> > > (BrowserWidget.java:343)
> > >        at com.google.gwt.dev.shell.moz.BrowserWidgetMoz.access$100
> > > (BrowserWidgetMoz.java:35)
> > >        at com.google.gwt.dev.shell.moz.BrowserWidgetMoz
> > > $ExternalObjectImpl.gwtOnLoad(BrowserWidgetMoz.java:58)
> > >        at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native
> > > Method)
> > >        at 
> > > org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:
> > > 1428)
> > >        at
> > > org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2840)
> > >        at com.google.gwt.dev.SwtHostedModeBase.processEvents
> > > (SwtHostedModeBase.java:235)
> > >        at com.google.gwt.dev.HostedModeBase.pumpEventLoop
> > > (HostedModeBase.java:558)
> > >        at com.google.gwt.dev.HostedModeBase.run(HostedModeBase.java:405)
> > >        at com.google.gwt.dev.HostedMode.main(HostedMode.java:232)
>
> > > ___________________________________________________________________________
> > >  ___________________
>
> > > I thought i will create another html file same as sampled.html with
> > > name AddUser.html and this will contain all ids i have written in
> > > AddUser.java for RootPanel...
> > > (I have created seperate html for this tab thinking that it will be
> > > easy if any one wants to do layout changes, we don't have to change
> > > GWT code at that time simply change .html file and it will work, hope
> > > this is achievable)
>
> > > I don't know whether my approch is right or wrong, or where i am doing
> > > wrong here...?
>
> > > --
>
> > > You received this message because you are subscribed to the Google Groups
> > > "Google Web Toolkit" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected]<google-web-toolkit%2Bunsubs
> > >  [email protected]>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-web-toolkit?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


Reply via email to