Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

how to use field()? | and why field() cant' be used without form()? #1357

Closed
MicheleSaltori opened this issue May 17, 2022 · 2 comments
Closed

Comments

@MicheleSaltori
Copy link

MicheleSaltori commented May 17, 2022

Hi, I’m a newbie in tornadofx.
I want create a wide form with many input fields, starting with followed source code, using
tornadofx 1.7.20, Kotlin 1.6.20, sdk Oracle OpenJDK 1.8:

class test : View("Titolo")
{
    override val root = flowpane() {
        form() {
            fieldset("grup") {
                field("label") {
                    textfield ()
                }
            }
        }
    }
}

but executing it I get these errors:

mag 16, 2022 6:45:05 PM tornadofx.DefaultErrorHandler uncaughtException
GRAVE: Uncaught error
java.lang.NoClassDefFoundError: kotlin/reflect/full/KClasses
	at tornadofx.NodesKt.findParentOfType(Nodes.kt:988)
	at tornadofx.AbstractField.getFieldset(Forms.kt:340)
	at tornadofx.AbstractField.computePrefWidth(Forms.kt:284)
	at javafx.scene.Parent.prefWidth(Parent.java:915)
	at javafx.scene.layout.Region.prefWidth(Region.java:1468)
	at javafx.scene.layout.Region.computeChildPrefAreaWidth(Region.java:1776)
	at javafx.scene.layout.Region.getMaxAreaWidth(Region.java:2045)
	at javafx.scene.layout.Region.computeMaxPrefAreaWidth(Region.java:1909)
	at javafx.scene.layout.VBox.computePrefWidth(VBox.java:409)
	at javafx.scene.Parent.prefWidth(Parent.java:915)
	at javafx.scene.layout.Region.prefWidth(Region.java:1468)
	at javafx.scene.layout.Region.computeChildPrefAreaWidth(Region.java:1776)
	at javafx.scene.layout.Region.getMaxAreaWidth(Region.java:2045)
	at javafx.scene.layout.Region.computeMaxPrefAreaWidth(Region.java:1909)
	at javafx.scene.layout.VBox.computePrefWidth(VBox.java:409)
	at javafx.scene.Parent.prefWidth(Parent.java:915)
	at javafx.scene.layout.Region.prefWidth(Region.java:1468)
	at javafx.scene.layout.Region.computeChildPrefAreaWidth(Region.java:1776)
	at javafx.scene.layout.Region.computeChildPrefAreaWidth(Region.java:1750)
	at javafx.scene.layout.FlowPane.getRuns(FlowPane.java:659)
	at javafx.scene.layout.FlowPane.computePrefWidth(FlowPane.java:599)
	at javafx.scene.Parent.prefWidth(Parent.java:915)
	at javafx.scene.layout.Region.prefWidth(Region.java:1468)
	at javafx.scene.Scene.getPreferredWidth(Scene.java:1700)
	at javafx.scene.Scene.resizeRootToPreferredSize(Scene.java:1680)
	at javafx.scene.Scene.preferredSize(Scene.java:1648)
	at javafx.scene.Scene.impl_preferredSize(Scene.java:1723)
	at javafx.stage.Window$12.invalidated(Window.java:1030)
	at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:109)
	at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:144)
	at javafx.stage.Window.setShowing(Window.java:1118)
	at javafx.stage.Window.show(Window.java:1133)
	at javafx.stage.Stage.show(Stage.java:259)
	at tornadofx.UIComponent.openModal(Component.kt:1046)
	at tornadofx.UIComponent.openWindow(Component.kt:990)
	at tornadofx.UIComponent.openWindow$default(Component.kt:990)
	at nporg.MainView$1$2$2$1.invoke(Main.kt:107)
	at nporg.MainView$1$2$2$1.invoke(Main.kt:107)
	at tornadofx.ControlsKt$action$2.handle(Controls.kt:437)
	at tornadofx.ControlsKt$action$2.handle(Controls.kt)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.Node.fireEvent(Node.java:8411)
	at javafx.scene.control.Button.fire(Button.java:185)
	at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:182)
	at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:96)
	at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:89)
	at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.Scene$MouseHandler.process(Scene.java:3760)
	at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3488)
	at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1765)
	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2497)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:397)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:434)
	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:411)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:433)
	at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
	at com.sun.glass.ui.View.notifyMouse(View.java:941)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$null$10(GtkApplication.java:245)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: kotlin.reflect.full.KClasses
	at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	... 87 more

mag 16, 2022 6:45:05 PM tornadofx.DefaultErrorHandler uncaughtException
GRAVE: Uncaught error
java.lang.NoClassDefFoundError: kotlin/reflect/full/KClasses
	at tornadofx.NodesKt.findParentOfType(Nodes.kt:988)
	at tornadofx.AbstractField.getFieldset(Forms.kt:340)
	at tornadofx.AbstractField.computePrefWidth(Forms.kt:284)
	at javafx.scene.Parent.prefWidth(Parent.java:915)
	at javafx.scene.layout.Region.prefWidth(Region.java:1468)
	at javafx.scene.layout.Region.computeChildPrefAreaWidth(Region.java:1776)
	at javafx.scene.layout.Region.getMaxAreaWidth(Region.java:2045)
	at javafx.scene.layout.Region.computeMaxPrefAreaWidth(Region.java:1909)
	at javafx.scene.layout.VBox.computePrefWidth(VBox.java:409)
	at javafx.scene.Parent.prefWidth(Parent.java:915)
	at javafx.scene.layout.Region.prefWidth(Region.java:1468)
	at javafx.scene.layout.Region.computeChildPrefAreaWidth(Region.java:1776)
	at javafx.scene.layout.Region.getMaxAreaWidth(Region.java:2045)
	at javafx.scene.layout.Region.computeMaxPrefAreaWidth(Region.java:1909)
	at javafx.scene.layout.VBox.computePrefWidth(VBox.java:409)
	at javafx.scene.Parent.prefWidth(Parent.java:915)
	at javafx.scene.layout.Region.prefWidth(Region.java:1468)
	at javafx.scene.layout.Region.computeChildPrefAreaWidth(Region.java:1776)
	at javafx.scene.layout.Region.computeChildPrefAreaWidth(Region.java:1750)
	at javafx.scene.layout.FlowPane.getRuns(FlowPane.java:659)
	at javafx.scene.layout.FlowPane.layoutChildren(FlowPane.java:768)
	at javafx.scene.Parent.layout(Parent.java:1087)
	at javafx.scene.Scene.doLayoutPass(Scene.java:552)
	at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2400)
	at com.sun.javafx.tk.Toolkit.lambda$runPulse$2(Toolkit.java:400)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:399)
	at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:426)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:562)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:542)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:535)
	at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(QuantumToolkit.java:341)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at com.sun.glass.ui.gtk.GtkApplication.enterNestedEventLoopImpl(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication._enterNestedEventLoop(GtkApplication.java:315)
	at com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:515)
	at com.sun.glass.ui.EventLoop.enter(EventLoop.java:107)
	at com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:634)
	at javafx.stage.Stage.showAndWait(Stage.java:474)
	at javafx.scene.control.HeavyweightDialog.showAndWait(HeavyweightDialog.java:162)
	at javafx.scene.control.Dialog.showAndWait(Dialog.java:341)
	at tornadofx.DefaultErrorHandler.showErrorDialog(ErrorHandler.kt:122)
	at tornadofx.DefaultErrorHandler.access$showErrorDialog(ErrorHandler.kt:15)
	at tornadofx.DefaultErrorHandler$uncaughtException$1.run(ErrorHandler.kt:43)
	at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$null$10(GtkApplication.java:245)
	at java.lang.Thread.run(Thread.java:748)

mag 16, 2022 6:45:05 PM tornadofx.DefaultErrorHandler uncaughtException
INFORMAZIONI: Detected cycle handling error, aborting.
java.lang.NoClassDefFoundError: kotlin/reflect/full/KClasses
	at tornadofx.NodesKt.findParentOfType(Nodes.kt:988)
	at tornadofx.AbstractField.getFieldset(Forms.kt:340)
	at tornadofx.AbstractField.computePrefWidth(Forms.kt:284)
	at javafx.scene.Parent.prefWidth(Parent.java:915)
	at javafx.scene.layout.Region.prefWidth(Region.java:1468)
	at javafx.scene.layout.Region.computeChildPrefAreaWidth(Region.java:1776)
	at javafx.scene.layout.Region.getMaxAreaWidth(Region.java:2045)
	at javafx.scene.layout.Region.computeMaxPrefAreaWidth(Region.java:1909)
	at javafx.scene.layout.VBox.computePrefWidth(VBox.java:409)
	at javafx.scene.Parent.prefWidth(Parent.java:915)
	at javafx.scene.layout.Region.prefWidth(Region.java:1468)
	at javafx.scene.layout.Region.computeChildPrefAreaWidth(Region.java:1776)
	at javafx.scene.layout.Region.getMaxAreaWidth(Region.java:2045)
	at javafx.scene.layout.Region.computeMaxPrefAreaWidth(Region.java:1909)
	at javafx.scene.layout.VBox.computePrefWidth(VBox.java:409)
	at javafx.scene.Parent.prefWidth(Parent.java:915)
	at javafx.scene.layout.Region.prefWidth(Region.java:1468)
	at javafx.scene.layout.Region.computeChildPrefAreaWidth(Region.java:1776)
	at javafx.scene.layout.Region.computeChildPrefAreaWidth(Region.java:1750)
	at javafx.scene.layout.FlowPane.getRuns(FlowPane.java:659)
	at javafx.scene.layout.FlowPane.layoutChildren(FlowPane.java:768)
	at javafx.scene.Parent.layout(Parent.java:1087)
	at javafx.scene.Scene.doLayoutPass(Scene.java:552)
	at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2400)
	at com.sun.javafx.tk.Toolkit.lambda$runPulse$2(Toolkit.java:400)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:399)
	at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:426)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:562)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:542)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:535)
	at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(QuantumToolkit.java:341)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at com.sun.glass.ui.gtk.GtkApplication.enterNestedEventLoopImpl(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication._enterNestedEventLoop(GtkApplication.java:315)
	at com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:515)
	at com.sun.glass.ui.EventLoop.enter(EventLoop.java:107)
	at com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:634)
	at javafx.stage.Stage.showAndWait(Stage.java:474)
	at javafx.scene.control.HeavyweightDialog.showAndWait(HeavyweightDialog.java:162)
	at javafx.scene.control.Dialog.showAndWait(Dialog.java:341)
	at tornadofx.DefaultErrorHandler.showErrorDialog(ErrorHandler.kt:122)
	at tornadofx.DefaultErrorHandler.access$showErrorDialog(ErrorHandler.kt:15)
	at tornadofx.DefaultErrorHandler$uncaughtException$1.run(ErrorHandler.kt:43)
	at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$null$10(GtkApplication.java:245)
	at java.lang.Thread.run(Thread.java:748)

why?

Exploring tornadofx source code I notice that the field() function, which allow to creating input object with their label, can be only using in conjunction with form() and fieldset(); while it would be very useful to be able to use the field() function freely!

@MicheleSaltori MicheleSaltori changed the title how to use field() | and why field() cant' be used without form() how to use field()? | and why field() cant' be used without form()? May 17, 2022
@lsivar
Copy link

lsivar commented May 31, 2022

[- [ ] sadASDasd](`

### url

`)

@MicheleSaltori
Copy link
Author

Solved question, including library kotlin.reflect.KClasses in compiling dependence.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants