carlw
12/15/2017, 6:00 PMcarlw
12/15/2017, 6:01 PMjavafxpert
12/15/2017, 6:22 PMjavafxpert
12/15/2017, 10:11 PMjavafxpert
12/15/2017, 10:11 PMjavafxpert
12/15/2017, 10:22 PMcarlw
12/15/2017, 10:43 PMcarlw
12/15/2017, 10:44 PMjavafxpert
12/15/2017, 10:53 PMImage uploaded from iOS▾
javafxpert
12/15/2017, 10:53 PMedvin
12/16/2017, 11:50 AMimageview
is an extension function on the node it is executed on. When you write button(graphic = imageview(url))
, you actually call imageview
on the parent container, in this case the toolbar. What you want to do is either to construct an imageview with the ImageView() constructor like this: button(graphic = ImageView(url))
or inside of the button builder, where the parent would be the button anyways: button { graphic = imageview())
. This can be confusing in the beginning, until you realize how the builders work. The distinction is only relevant/important to understand for builders that take nodes as parameters though. You also want to use the toolbar {}
syntax. The vararg support is legacy and will be deprecated in an upcoming release.edvin
12/16/2017, 11:51 AMimageview
builder creates and imageview and attaches it to the Node you called the imageview()
function on. That's why it backfires when passed as a parameter.edvin
12/16/2017, 11:53 AMedvin
12/16/2017, 11:53 AMedvin
12/16/2017, 11:54 AMedvin
12/16/2017, 11:54 AMedvin
12/16/2017, 11:55 AMjavafxpert
12/16/2017, 11:55 AMjavafxpert
12/16/2017, 11:57 AMedvin
12/16/2017, 11:57 AMjavafxpert
12/16/2017, 11:57 AMedvin
12/16/2017, 11:57 AMjavafxpert
12/16/2017, 12:01 PMjavafxpert
12/16/2017, 12:03 PMedvin
12/16/2017, 12:04 PMjavafxpert
12/16/2017, 12:04 PMjavafxpert
12/16/2017, 12:05 PMjavafxpert
12/16/2017, 12:06 PMedvin
12/16/2017, 12:10 PMedvin
12/16/2017, 12:12 PM