B4J Question Pane and wrong type

Fabrice La

Active Member
Licensed User
Longtime User
I created in JavaFX a form with pane.
In the pane I added radioButtons I used the B4J menu "Generate Members :

B4X:
Private PanePS  As Pane

When I start the form I have :
Error occurred on line: 44 (configf).
java.lang.RuntimeException: java.lang.RuntimeException: Field paneps was declared with the wrong type.
at anywheresoftware.b4a.shell.Shell.sendLayoutViews(Shell.java:555)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:50)
at anywheresoftware.b4j.objects.PaneWrapper.LoadLayout(PaneWrapper.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:468)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:212)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:153)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:69)
at anywheresoftware.b4a.BA$2.run(BA.java:159)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.RuntimeException: Field paneps was declared with the wrong type.
at anywheresoftware.b4a.shell.Shell.sendLayoutViews(Shell.java:534)
... 25 more
 

Fabrice La

Active Member
Licensed User
Longtime User
FXML File
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="607.0" prefWidth="401.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2">
<children>
<TabPane layoutX="0.0" layoutY="0.0" prefHeight="561.0" prefWidth="401.0" style="#root {&#10;-fx-background-color: linear-gradient(lightgray, gray);&#10;-fx-border-color: white;&#10;-fx-border-radius: 20;&#10;-fx-padding: 10 10 10 10;&#10;-fx-background-radius: 20;&#10; &#10;}&#10;&#9; &#10;#bp {&#10;-fx-background-color: linear-gradient(gray,DimGrey );&#10; &#10;}&#10;&#10;#BtnOK {&#10;-fx-background-radius: 30, 30, 29, 28;&#10;-fx-padding: 3px 10px 3px 10px;&#10;-fx-background-color: linear-gradient(orange, orangered );&#10;}" tabClosingPolicy="UNAVAILABLE">
<tabs>
<Tab id="TabIKM" text="Taux Remboursement IKM">
<content>
<AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="522.0" prefWidth="379.0">
<children>
<Pane id="PaneType" layoutX="17.0" layoutY="14.0" prefHeight="158.0" prefWidth="130.00009999999747" style="#PanePS {&#10;-fx-background-radius: 30, 30, 29, 28;&#10;-fx-padding: 3px 10px 3px 10px;&#10;-fx-background-color: linear-gradient(grey, white );&#10;}">
<children>
<Label layoutX="1.0" layoutY="2.0" text="Type de véhicule" textFill="#ffc633">
<font>
<Font size="16.0" fx:id="x1" />
</font>
</Label>
<RadioButton id="RadioBtnVoiture" layoutX="14.0" layoutY="39.0" mnemonicParsing="false" selected="true" text="Voiture">
<toggleGroup>
<ToggleGroup fx:id="TV" />
</toggleGroup>
</RadioButton>
<RadioButton id="RadioBtnMoto" layoutX="14.0" layoutY="68.0" mnemonicParsing="false" text="Moto" toggleGroup="$TV" />
<RadioButton id="RadioBtnCyclo" layoutX="14.0" layoutY="97.0" mnemonicParsing="false" text="Cyclomoteur" toggleGroup="$TV" />
</children>
</Pane>
<Pane id="PanePS" layoutX="17.0" layoutY="183.0" prefHeight="311.0" prefWidth="130.0" style="#PanePS {&#10;-fx-background-radius: 30, 30, 29, 28;&#10;-fx-padding: 3px 10px 3px 10px;&#10;-fx-background-color: linear-gradient(grey, white );&#10;}">
<children>
<Label font="$x1" layoutX="1.0" layoutY="2.0" text="Puissance fiscale">
<textFill>
<Color blue="0.200" green="0.776" red="1.000" fx:id="x2" />
</textFill>
</Label>
<RadioButton id="RadioBtn3cv" layoutX="15.0" layoutY="30.0" mnemonicParsing="false" selected="true" text="3 Cv">
<toggleGroup>
<ToggleGroup fx:id="PF" />
</toggleGroup>
</RadioButton>
<RadioButton id="RadioBtn4cv" layoutX="15.0" layoutY="57.0" mnemonicParsing="false" selected="false" text="4 Cv" toggleGroup="$PF" />
<RadioButton id="RadioBtn5cv" layoutX="15.0" layoutY="82.0" mnemonicParsing="false" selected="false" text="5 Cv">
<toggleGroup>
<ToggleGroup />
</toggleGroup>
</RadioButton>
<RadioButton id="RadioBtn6cv" layoutX="15.0" layoutY="107.0" mnemonicParsing="false" selected="false" text="6 Cv" toggleGroup="$PF" />
<RadioButton id="RadioBtn7cv" layoutX="15.0" layoutY="132.0" mnemonicParsing="false" selected="false" text="7 Cv" toggleGroup="$PF" />
<RadioButton id="RadioBtn8cv" layoutX="15.0" layoutY="157.0" mnemonicParsing="false" selected="false" text="8 Cv" toggleGroup="$PF" />
<RadioButton id="RadioBtn9cv" layoutX="15.0" layoutY="182.0" mnemonicParsing="false" selected="false" text="9 Cv" toggleGroup="$PF" />
<RadioButton id="RadioBtn10cv" layoutX="15.0" layoutY="207.0" mnemonicParsing="false" selected="false" text="10 Cv" toggleGroup="$PF" />
<RadioButton id="RadioBtn11cv" layoutX="15.0" layoutY="232.0" mnemonicParsing="false" selected="false" text="11 Cv" toggleGroup="$PF" />
<RadioButton id="RadioBtn13cv" layoutX="15.0" layoutY="282.0" mnemonicParsing="false" selected="false" text="13 Cv" toggleGroup="$PF" />
<RadioButton id="RadioBtn12cv" layoutX="15.0" layoutY="257.0" mnemonicParsing="false" selected="false" text="12 Cv" toggleGroup="$PF" />
</children>
</Pane>
</children>
</AnchorPane>
</content>
</Tab>
<Tab id="JourF" text="Jours fériers">
<content>
<AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
</content>
</Tab>
<Tab id="BarreO" text="Barre d'outil">
<content>
<AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
</content>
</Tab>
</tabs>
</TabPane>
<Button id="BtnFermer" layoutX="226.0" layoutY="572.0" mnemonicParsing="false" prefWidth="69.0" text="Fermer" />
<Button id="BtnOk" layoutX="318.0" layoutY="571.0" mnemonicParsing="false" prefWidth="69.0" text="OK" />
</children>
</AnchorPane>
 
Upvote 0

Fabrice La

Active Member
Licensed User
Longtime User
<?xml version="1.0" encoding="UTF-8"?>

<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.collections.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.paint.*?>
<?import javafx.scene.text.*?>
<?import javafx.scene.web.*?>

<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="607.0" prefWidth="401.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2">
<children>
<TabPane layoutX="0.0" layoutY="0.0" prefHeight="561.0" prefWidth="401.0" style="#root {&#10;-fx-background-color: linear-gradient(lightgray, gray);&#10;-fx-border-color: white;&#10;-fx-border-radius: 20;&#10;-fx-padding: 10 10 10 10;&#10;-fx-background-radius: 20;&#10; &#10;}&#10;&#9; &#10;#bp {&#10;-fx-background-color: linear-gradient(gray,DimGrey );&#10; &#10;}&#10;&#10;#BtnOK {&#10;-fx-background-radius: 30, 30, 29, 28;&#10;-fx-padding: 3px 10px 3px 10px;&#10;-fx-background-color: linear-gradient(orange, orangered );&#10;}" tabClosingPolicy="UNAVAILABLE">
<tabs>
<Tab id="TabIKM" text="Taux Remboursement IKM">
<content>
<AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="522.0" prefWidth="379.0">
<children>
<Pane id="PaneType" layoutX="17.0" layoutY="14.0" prefHeight="158.0" prefWidth="130.00009999999747" style="#PanePS {&#10;-fx-background-radius: 30, 30, 29, 28;&#10;-fx-padding: 3px 10px 3px 10px;&#10;-fx-background-color: linear-gradient(grey, white );&#10;}">
<children>
<Label layoutX="1.0" layoutY="2.0" text="Type de véhicule" textFill="#ffc633">
<font>
<Font size="16.0" fx:id="x1" />
</font>
</Label>
<RadioButton id="RadioBtnVoiture" layoutX="14.0" layoutY="39.0" mnemonicParsing="false" selected="true" text="Voiture">
<toggleGroup>
<ToggleGroup fx:id="TV" />
</toggleGroup>
</RadioButton>
<RadioButton id="RadioBtnMoto" layoutX="14.0" layoutY="68.0" mnemonicParsing="false" text="Moto" toggleGroup="$TV" />
<RadioButton id="RadioBtnCyclo" layoutX="14.0" layoutY="97.0" mnemonicParsing="false" text="Cyclomoteur" toggleGroup="$TV" />
</children>
</Pane>
<Pane id="PanePS" layoutX="17.0" layoutY="183.0" prefHeight="311.0" prefWidth="130.0" style="#PanePS {&#10;-fx-background-radius: 30, 30, 29, 28;&#10;-fx-padding: 3px 10px 3px 10px;&#10;-fx-background-color: linear-gradient(grey, white );&#10;}">
<children>
<Label font="$x1" layoutX="1.0" layoutY="2.0" text="Puissance fiscale">
<textFill>
<Color blue="0.200" green="0.776" red="1.000" fx:id="x2" />
</textFill>
</Label>
<RadioButton id="RadioBtn3cv" layoutX="15.0" layoutY="30.0" mnemonicParsing="false" selected="true" text="3 Cv">
<toggleGroup>
<ToggleGroup fx:id="PF" />
</toggleGroup>
</RadioButton>
<RadioButton id="RadioBtn4cv" layoutX="15.0" layoutY="57.0" mnemonicParsing="false" selected="false" text="4 Cv" toggleGroup="$PF" />
<RadioButton id="RadioBtn5cv" layoutX="15.0" layoutY="82.0" mnemonicParsing="false" selected="false" text="5 Cv">
<toggleGroup>
<ToggleGroup />
</toggleGroup>
</RadioButton>
<RadioButton id="RadioBtn6cv" layoutX="15.0" layoutY="107.0" mnemonicParsing="false" selected="false" text="6 Cv" toggleGroup="$PF" />
<RadioButton id="RadioBtn7cv" layoutX="15.0" layoutY="132.0" mnemonicParsing="false" selected="false" text="7 Cv" toggleGroup="$PF" />
<RadioButton id="RadioBtn8cv" layoutX="15.0" layoutY="157.0" mnemonicParsing="false" selected="false" text="8 Cv" toggleGroup="$PF" />
<RadioButton id="RadioBtn9cv" layoutX="15.0" layoutY="182.0" mnemonicParsing="false" selected="false" text="9 Cv" toggleGroup="$PF" />
<RadioButton id="RadioBtn10cv" layoutX="15.0" layoutY="207.0" mnemonicParsing="false" selected="false" text="10 Cv" toggleGroup="$PF" />
<RadioButton id="RadioBtn11cv" layoutX="15.0" layoutY="232.0" mnemonicParsing="false" selected="false" text="11 Cv" toggleGroup="$PF" />
<RadioButton id="RadioBtn13cv" layoutX="15.0" layoutY="282.0" mnemonicParsing="false" selected="false" text="13 Cv" toggleGroup="$PF" />
<RadioButton id="RadioBtn12cv" layoutX="15.0" layoutY="257.0" mnemonicParsing="false" selected="false" text="12 Cv" toggleGroup="$PF" />
</children>
</Pane>
</children>
</AnchorPane>
</content>
</Tab>
<Tab id="JourF" text="Jours fériers">
<content>
<AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
</content>
</Tab>
<Tab id="BarreO" text="Barre d'outil">
<content>
<AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
</content>
</Tab>
</tabs>
</TabPane>
<Button id="BtnFermer" layoutX="226.0" layoutY="572.0" mnemonicParsing="false" prefWidth="69.0" text="Fermer" />
<Button id="BtnOk" layoutX="318.0" layoutY="571.0" mnemonicParsing="false" prefWidth="69.0" text="OK" />
</children>
</AnchorPane>

Missed the begining ....
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
There is nothing wrong with that fxml
 

Attachments

  • 2013-12-15_133836.png
    2013-12-15_133836.png
    30.1 KB · Views: 238
Upvote 0

Fabrice La

Active Member
Licensed User
Longtime User
Yes I know it but where you develop in :
B4X:
Sub Class_Globals
    Private PanePS  As Pane 'from "Generate menbers"
......
End Sub
.....
Sub ChangeRadioBouton()
    If RadioBtn4cv.Selected Then
          PanePS.Visible = True
      End If
End Sub

I have this error when the form shows
Error occurred on line: 44 (configf).
java.lang.RuntimeException: java.lang.RuntimeException: Field paneps was declared with the wrong type.
at anywheresoftware.b4a.shell.Shell.sendLayoutViews(Shell.java:555)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:50)
at anywheresoftware.b4j.objects.PaneWrapper.LoadLayout(PaneWrapper.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:468)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:212)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:153)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:69)
at anywheresoftware.b4a.BA$2.run(BA.java:159)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.RuntimeException: Field paneps was declared with the wrong type.
at anywheresoftware.b4a.shell.Shell.sendLayoutViews(Shell.java:534)
... 25 more
 
Upvote 0

Fabrice La

Active Member
Licensed User
Longtime User
I checked with the ModalForm Tutorial and modified it

I have the same error.

Here the appli
 

Attachments

  • ModalExamplePane.zip
    23.4 KB · Views: 250
Upvote 0

Fabrice La

Active Member
Licensed User
Longtime User
It is not working when I click on Choose color .... Why ?
Program started.
Error occurred on line: 14 (modalform).
java.lang.RuntimeException: java.lang.RuntimeException: Field pfs was declared with the wrong type.
at anywheresoftware.b4a.shell.Shell.sendLayoutViews(Shell.java:555)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:50)
at anywheresoftware.b4j.objects.PaneWrapper.LoadLayout(PaneWrapper.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:468)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:212)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:153)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:69)
at anywheresoftware.b4a.BA$2.run(BA.java:159)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.RuntimeException: Field pfs was declared with the wrong type.
at anywheresoftware.b4a.shell.Shell.sendLayoutViews(Shell.java:534)
... 25 more
 
Upvote 0
Top