B4J Question Multiple panes on Form

Discussion in 'B4J Questions' started by TomDuncan, Jul 3, 2015.

Similar threads

B4J Tutorial Accordion container
B4J Tutorial Pagination Container
B4J Tutorial [B4X] Resumable Subs - Sleep / Wait For
B4J Tutorial SQL Tutorial
B4J Tutorial Customized ListView
B4J Tutorial TabPane Example
  1. TomDuncan

    TomDuncan Active Member Licensed User

    Hi All,
    Have a question related to design.
    In Delphi if I have multiple forms that I wanted pasted onto my main form I would.
    Create the form.
    Create a base panel on my main form.
    Then set the sub-forms parent to the one on the main form.

    Anyway, with my latest app, I have 3 forms that I would like to show
    on the same Master form. I do not want modal or any other types.

    Or do I have to create all my panes on the main form, then hide and show to suite.

    Tom
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Both options are possible. You can add multiple panes to the RootPane or you can show multiple windows (forms).
     
  3. johnB

    johnB Active Member Licensed User

    Is there an example on the forum of adding and removing layouts using the New Internal Designer in B4J.

    I'm able to do it but on removing the first from and add adding the second I'm getting errors but the 2nd form still displays and is usable

    When I reload the original form, I'm having trouble filling in some of the (original) TextField values on it

    I'm trying to incorporate the New Designer into an app that currently uses the Scene Builder screen designer and also uses modal forms
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Why aren't you using multiple forms? It will be simpler. I will soon upload several examples including an example with multiple forms.
     
    ilan likes this.
  5. johnB

    johnB Active Member Licensed User

    I've changed to display the form as a Modal Form and am getting this error mesage which is similar to what I was getting before

    Code:
    java.lang.RuntimeException: JSON Array expected.
        at anywheresoftware.b4j.objects.collections.JSONParser.NextArray(
    JSONParser.java:62)
        at anywheresoftware.b4j.objects.MenuItemWrapper$MenuBarWrapper.parseMenusJson(MenuItemWrapper.java:
    247)
        at anywheresoftware.b4j.objects.NodeWrapper$ControlWrapper.build(NodeWrapper.java:
    863)
        at anywheresoftware.b4j.objects.ComboBoxWrapper.build(ComboBoxWrapper.java:
    108)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
    62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
    43)
        at java.lang.reflect.Method.invoke(Method.java:
    497)
        at anywheresoftware.b4a.DynamicBuilder.build(DynamicBuilder.java:
    16)
        at anywheresoftware.b4j.objects.LayoutBuilder.loadLayoutHeader(LayoutBuilder.java:
    113)
        at anywheresoftware.b4j.objects.LayoutBuilder.loadLayoutHeader(LayoutBuilder.java:
    154)
        at anywheresoftware.b4j.objects.LayoutBuilder.loadLayoutHeader(LayoutBuilder.java:
    154)
        at anywheresoftware.b4j.objects.LayoutBuilder.loadLayout(LayoutBuilder.java:
    77)
        at anywheresoftware.b4j.objects.PaneWrapper.LoadLayout(PaneWrapper.java:
    76)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
    62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
    43)
        at java.lang.reflect.Method.invoke(Method.java:
    497)
        at anywheresoftware.b4a.shell.Shell.runMethod(
    Shell.java:563)
        at anywheresoftware.b4a.shell.Shell.raiseEventImpl(
    Shell.java:224)
        at anywheresoftware.b4a.shell.Shell.raiseEvent(
    Shell.java:156)
        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
    43)
        at java.lang.reflect.Method.invoke(Method.java:
    497)
        at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
    93)
        at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:
    82)
        at anywheresoftware.b4a.BA$
    2.run(BA.java:165)
        at com.sun.javafx.application.PlatformImpl.lambda$
    null$170(PlatformImpl.java:295)
        at com.sun.javafx.application.PlatformImpl$$Lambda$
    48/692303464.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$
    171(PlatformImpl.java:294)
        at com.sun.javafx.application.PlatformImpl$$Lambda$
    47/1915503092.run(Unknown Source)
        at com.sun.glass.ui.InvokeLaterDispatcher$
    Future.run(InvokeLaterDispatcher.java:95)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$
    null$145(WinApplication.java:101)
        at com.sun.glass.ui.win.WinApplication$$Lambda$
    36/1963387170.run(Unknown Source)
        at java.lang.Thread.run(
    Thread.java:745)
    Again the Form display and I can process the fields and exit the Form and return to the Main form

    Soryy but the eroor message is well beyond my expertise in java code
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    This error message means that the context menu json string set to the combobox is not a valid json.
     
  7. johnB

    johnB Active Member Licensed User

    Thanks Erel, I missed the earlier message about the multiple screens. I can wait until you post some examples, what I've got works but it's pretty ugly.

    I don't understand about the JSON String in the ComboBox but I'll look on the forum.

    Thanks again for your invaluable help
     
  8. johnB

    johnB Active Member Licensed User

    Thanks, I've solved the JSON string errors
     
  9. johnB

    johnB Active Member Licensed User

    I've also (some time ago) solved the second screen problem and I'm pleased with the result

    Thanks again for your help
     
Loading...