<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title>Bekwam Blog</title><description>More and More Kotlin Code in 2018 w. JavaFX and the TornadoFX Framework</description><managingEditor>noreply@blogger.com (Carl)</managingEditor><pubDate>Mon, 4 May 2026 19:42:35 -0400</pubDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">467</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:itemsPerPage><link>http://bekwam.blogspot.com/</link><language>en-us</language><itunes:explicit>no</itunes:explicit><itunes:image href="http://www.bekwam.com/images/bk_logo2.png"/><itunes:keywords>bekwam,integration,tools,data,etl</itunes:keywords><itunes:summary>For product releases, news, research and events about data integration tools, check out the Integration Tools Podcast episodes listed below. A minute or two a week and you're up-to-speed on the integration tools market.</itunes:summary><itunes:subtitle>Integration Tools Podcast</itunes:subtitle><itunes:owner><itunes:email>sales@bekwam.com</itunes:email></itunes:owner><item><title>Setting the Pivot Point in a JavaFX ScaleTransition</title><link>http://bekwam.blogspot.com/2017/08/setting-pivot-point-in-javafx.html</link><category>animation</category><category>center</category><category>height</category><category>javafx</category><category>layout</category><category>pivot</category><category>point</category><category>scaletransition</category><category>translatetransition</category><category>width</category><category>x</category><category>y</category><pubDate>Wed, 23 Aug 2017 20:54:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-2858398449385705780</guid><description>This article shows how to use a JavaFX ScaleTransition to expand a container of controls from nothing to its full dimensions.  While this is especially easy to do if you are content to scale the container outward from the center, an extra transformation is needed to expand the container from the top left, in this case next to the originating control.&lt;br&gt;
&lt;br&gt;
When working with animations, I like to use the transformations as much as possible over object properties like width and height.  That helps to preserve the integrity of the layout.  For example, a zero-width Node might cause other items to shift undesirably.  If keeping unaffected Nodes in their original place is important, prefer ScaleTransition to animating width and height and prefer TranslateTransition to x and y.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2017/08/setting-pivot-point-in-javafx.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>Sliding Content In With JavaFX TranslateY</title><link>http://bekwam.blogspot.com/2017/08/sliding-content-in-with-javafx.html</link><category>animation</category><category>javafx</category><category>splitpane</category><category>translatetransition</category><category>translatey</category><pubDate>Wed, 23 Aug 2017 09:16:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-3360399850050908496</guid><description>A reader asked about sliding content into a screen via animation.  This blog post uses a Pane to show a slide which is animated in using the slide&amp;#39;s translateY property. I used a Pane because it does not attempt to resize the child&amp;#39;s contents.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2017/08/sliding-content-in-with-javafx.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>Wire Level REST Request Logging in TornadoFX</title><link>http://bekwam.blogspot.com/2017/08/wire-level-rest-request-logging.html</link><category>apache</category><category>header</category><category>http</category><category>javafx</category><category>kotlin</category><category>log</category><category>logging</category><category>request</category><category>rest</category><category>tornadofx</category><category>wire</category><pubDate>Tue, 1 Aug 2017 20:35:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-8175110378734330858</guid><description>TornadoFX&amp;#39;s Rest class integrates RESTful web service calls into your JavaFX app.  There is a switch you can set that will allow you to use the Apache HTTPClient in place of the native Kotlin implementaton typically used in TornadoFX.  One feature that this switch brings is wire-level logging.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2017/08/wire-level-rest-request-logging.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWeFBIYTg0C213Nk7LrQPZYZ9XHerTXnvpHzr2yoKFZykVhtJluEMx04eFxdN839eHjRteZed-JZBb0zaRmWUXRUZK8jdQAXvtAxKqdnohDTuQdqp0FTv0UJIDwfjXoY5D51V2z0ZcW_RR/s72-c/intellij_tornadofx_httpclient.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>Op Amp Frequency Response for Bass Guitar Effects</title><link>http://bekwam.blogspot.com/2017/07/op-amp-frequency-response-shootout.html</link><category>bass</category><category>circuit</category><category>distortion</category><category>fuzz</category><category>guitar</category><category>op amps</category><category>overdrive</category><pubDate>Fri, 14 Jul 2017 10:00:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-9132192938226313591</guid><description>This is a comparison of the frequency response of the OPA2132 and LM358N operational amplifiers.  These are two ICs that vary widly in price.  The OPA2132 is $6 while the LM358N is $0.40.  Both chips each contain a pair of op amps.  A few screenshots visually showing some differences is followed up by a pair of bass guitar effect circuits that highlight some audio application differences.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;&lt;/b&gt;&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2017/07/op-amp-frequency-response-shootout.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9n7EY1dab24GiFfeBCd8B1r1F0sPB2Vz0jvBH5r8bMulpOFtKh91CrdJkVAc7VNuaJjdQhlLZ9EjKccNuZka7KX8yKgn6wlZ5JifmgCnmFtp86fcw57SH4bbFYuKHY2jUjkEieMP3Orp1/s72-c/358_10khz.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>JavaFX Image Error Handling</title><link>http://bekwam.blogspot.com/2017/05/javafx-image-error-handling.html</link><category>blank</category><category>error</category><category>exception</category><category>found</category><category>image</category><category>imageview</category><category>javafx</category><category>not</category><category>progress</category><pubDate>Tue, 30 May 2017 07:21:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-3722441643946478760</guid><description>ImageView is a JavaFX node that contains an Image.  When working with a classpath resource, an error is thrown immediately if an Image resource is not found.  However, you need to have the background flag set if your Image source is an absolute URL.&lt;br&gt;
&lt;br&gt;
The following code will throw an exception if the resource is not on the classpath&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;        Image badImage = new Image(&amp;quot;images/NOTFOUND.png&amp;quot;);
&lt;/pre&gt;
&lt;br&gt;
A stack trace will look something like this&lt;br&gt;
&lt;br&gt;
&lt;span style="color: #cc0000;"&gt;Caused by: java.lang.IllegalArgumentException: Invalid URL or resource not found&lt;/span&gt;&lt;br&gt;
&lt;span style="color: #cc0000;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;at javafx.scene.image.Image.validateUrl(Image.java:1110)&lt;/span&gt;&lt;br&gt;
&lt;span style="color: #cc0000;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;... 11 more&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
Similar code using an absolute URL will fail without throwing an error.  If using an ImageView, this results in either a blank area where the images should be shown or nothing, depending on the container.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2017/05/javafx-image-error-handling.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>Kotlin RadioButtons and Enumerated Types in TornadoFX</title><link>http://bekwam.blogspot.com/2017/04/kotlin-radiobuttons-and-enumerated.html</link><category>bind</category><category>binding</category><category>button</category><category>enum</category><category>enumerated</category><category>javafx</category><category>kotlin</category><category>property</category><category>togglegroup</category><pubDate>Wed, 26 Apr 2017 10:28:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-7948449478219181115</guid><description>A &lt;a href="http://bekwam.blogspot.com/2017/04/javafx-radiobuttons-and-enumerated-types.html"&gt;previous post&lt;/a&gt; showed how to create a JavaFX property based on an Enum linked to a set of RadioButtons.  Selecting a RadioButton changed the Enum property.  Changing the Enum property selected (and de-selected) a RadioButton.  This Kotlin code shows a recent enhancement in  TornadoFX 1.7.4 which wraps this functionality up using an extension function.&lt;br&gt;
&lt;br&gt;
An example usage of this new function follows.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2017/04/kotlin-radiobuttons-and-enumerated.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>JavaFX RadioButtons and Enumerated Types</title><link>http://bekwam.blogspot.com/2017/04/javafx-radiobuttons-and-enumerated-types.html</link><category>binding</category><category>button</category><category>enum</category><category>enumerated</category><category>javafx</category><category>listener</category><category>radio</category><category>radiobutton</category><category>toggle</category><category>togglegroup</category><category>type</category><pubDate>Tue, 25 Apr 2017 13:09:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-4422326093038718860</guid><description>In JavaFX, RadioButtons are usually added to a ToggleGroup to make the selections mutually exclusive.  The RadioButton selection can be bound as a property to another BooleanProperty field.  That pairing also supports bindBidirectional() such that the RadioButton control can update the field and the field can update the control.&lt;br&gt;
&lt;br&gt;
You may want to bind the RadioButton selection to an enumerated type.  Say, you have an enumeration ChoiceType with 3 values.  You want to map each of those 3 values to a RadioButton.  Moreover, you&amp;#39;d like to maintain a single field of ChoiceType for use in a model component.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2017/04/javafx-radiobuttons-and-enumerated-types.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>Kotlin Elements in TorandoFX Type Safe Builders</title><link>http://bekwam.blogspot.com/2017/03/lambda-style-in-torandofx-type-safe.html</link><category>javafx</category><category>kotlin</category><category>torandofx</category><pubDate>Mon, 27 Mar 2017 17:33:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-6066542191353204</guid><description>While the Kotlin-based TornadoFX framework supports many styles to construct a JavaFX UI, the Type Safe Builders are preferred.  Borrowing from a popular Groovy syntax, the TornadoFX Type Safe Builders are Kotlin Extension Functions that use Lambdas to write cleaner programs.&lt;br&gt;
&lt;br&gt;
This is an example TornadoFX View which is an HBox containing three Labels.&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;class GridDemosMainView : View() {

    override val root = hbox {

        label(&amp;quot;Label 1&amp;quot;)
        label(&amp;quot;Label 2&amp;quot;)
        label(&amp;quot;Label 3&amp;quot;)
    }
}&lt;/pre&gt;
&lt;a href="http://bekwam.blogspot.com/2017/03/lambda-style-in-torandofx-type-safe.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>C# WebClient Parsing JSON Array</title><link>http://bekwam.blogspot.com/2017/01/c-webclient-parsing-json-array.html</link><category>array</category><category>C#</category><category>collection</category><category>json</category><category>object</category><category>parse</category><category>rest</category><category>restful</category><pubDate>Mon, 16 Jan 2017 09:25:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-5522329103121234381</guid><description>This is a snippet of code that calls a RESTful web service and parses the JSON result.  The JSON payload is a list of objects.  The solution uses the .NET class DataContractJsonSerializer and an annotated DataContract.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2017/01/c-webclient-parsing-json-array.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>Kotlin Callable Reference Notes</title><link>http://bekwam.blogspot.com/2016/12/kotlin-callable-reference-notes.html</link><category>callable</category><category>empty</category><category>function</category><category>hand</category><category>kotlin</category><category>lambda</category><category>left</category><category>method</category><category>parameter</category><category>receiver</category><category>reference</category><pubDate>Sat, 3 Dec 2016 08:19:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-8490488981214386035</guid><description>Method references were added to Java 8 and you may already be using the double-colon (::) syntax to use a method reference as a parameter.  The semantics in Kotlin are different although a change in 1.1 will address these differences.&lt;br&gt;
&lt;br&gt;
This article presents a few examples of passing function references in Kotlin 1.0.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2016/12/kotlin-callable-reference-notes.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>Securing JavaFX Content Based on Role</title><link>http://bekwam.blogspot.com/2016/11/securing-javafx-content-based-on-role.html</link><category>javafx</category><category>security</category><pubDate>Sun, 6 Nov 2016 17:49:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-2486717539239159448</guid><description>This is an example where a MainView contains two child views, AllAccessView and AdminOnlyView. &amp;nbsp;All of the views are in .fxml and AllAccessView and AdminOnlyView are fx:included in MainView.&lt;br /&gt;
&lt;br /&gt;
A setRole() method is provided by MainViewController. &amp;nbsp;This method sets an internal field which is tied to a ChangeListener. &amp;nbsp;The ChangeListener will decide, based on role, whether or not to show both views (for Admin) or just one (for User).&lt;br /&gt;
&lt;br /&gt;
The fx:include code is wrapped up in Boxes to make the adding and removing easier.&lt;br /&gt;
&lt;br /&gt;
I'll expand upon this later.&lt;br /&gt;
&lt;br /&gt;
The code will explain things better.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://courses.bekwam.net/public_tutorials/source/bkcourse_securedapp_sources.zip"&gt;SecuredApp Source&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>sales@bekwam.com (Carl)</author><enclosure length="7462" type="application/zip" url="https://courses.bekwam.net/public_tutorials/source/bkcourse_securedapp_sources.zip"/><itunes:explicit>no</itunes:explicit><itunes:subtitle>This is an example where a MainView contains two child views, AllAccessView and AdminOnlyView. &amp;nbsp;All of the views are in .fxml and AllAccessView and AdminOnlyView are fx:included in MainView. A setRole() method is provided by MainViewController. &amp;nbsp;This method sets an internal field which is tied to a ChangeListener. &amp;nbsp;The ChangeListener will decide, based on role, whether or not to show both views (for Admin) or just one (for User). The fx:include code is wrapped up in Boxes to make the adding and removing easier. I'll expand upon this later. The code will explain things better. SecuredApp SourceTwitter: @bekwaminc</itunes:subtitle><itunes:author>sales@bekwam.com (Carl)</itunes:author><itunes:summary>This is an example where a MainView contains two child views, AllAccessView and AdminOnlyView. &amp;nbsp;All of the views are in .fxml and AllAccessView and AdminOnlyView are fx:included in MainView. A setRole() method is provided by MainViewController. &amp;nbsp;This method sets an internal field which is tied to a ChangeListener. &amp;nbsp;The ChangeListener will decide, based on role, whether or not to show both views (for Admin) or just one (for User). The fx:include code is wrapped up in Boxes to make the adding and removing easier. I'll expand upon this later. The code will explain things better. SecuredApp SourceTwitter: @bekwaminc</itunes:summary><itunes:keywords>bekwam,integration,tools,data,etl</itunes:keywords></item><item><title>Disambiguiating Nil Arguments in Swift</title><link>http://bekwam.blogspot.com/2016/10/disambiguiating-nil-arguments-in-swift.html</link><category>argument</category><category>function</category><category>method</category><category>nil</category><category>optional</category><category>swift</category><pubDate>Mon, 24 Oct 2016 10:07:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-8412478630226562885</guid><description>Overloading functions in Swift enables you to use the same function name with arguments of different types.  This can lead to an easier-to-use API, especially with code completion.  Instead of having a complement of functions like&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;  saveMyClass(myclass)
  saveAnotherClass(anotherclass), and
  saveYetAnotherClass(yetanotherclass),
&lt;/pre&gt;
&lt;br&gt;
you&amp;#39;d just use a single save() function that would accept the three different types.  The previous example becomes&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;  save(myclass),
  save(anotherclass), and
  save(yetanotherclass).
&lt;/pre&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2016/10/disambiguiating-nil-arguments-in-swift.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>Disambiguating Null Arguments in Kotlin</title><link>http://bekwam.blogspot.com/2016/10/disambiguating-null-arguments-in-kotlin.html</link><category>argument</category><category>fun</category><category>kotlin</category><category>null</category><pubDate>Mon, 24 Oct 2016 09:30:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-6280231306809614478</guid><description>To define a function argument that can accept a null value in Kotlin, you use the question mark (?) operator.  For example,&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;fun bar(name : String?) { // ... do something
&lt;/pre&gt;
&lt;br&gt;
Can accept both a String argument like &amp;quot;Hello, World!&amp;quot; and a null.  If you have another version of bar() that accepts a nullable argument, say&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;fun bar(name : Int?) { // ... do something w. an Int
&lt;/pre&gt;
&lt;br&gt;
You&amp;#39;ll run into a problem if you call
&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;bar(null)
&lt;/pre&gt;
&lt;br&gt;
To disambiguate this, you need to provide type into to Kotlin.  That type info should be a nullable type.  In the following code, a method &amp;quot;foo&amp;quot; is updated with a newer version.  Both functions can coexist when non-null arguments are passed.  The Kotlin as keyword is used to specify exactly which function is to be used for the null value (and the code compiled).
&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;/pre&gt;&lt;a href="http://bekwam.blogspot.com/2016/10/disambiguating-null-arguments-in-kotlin.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>A TornadoFX Kotlin Context Menu with Alert Confirmation</title><link>http://bekwam.blogspot.com/2016/09/a-tornadofx-kotlin-context-menu-with.html</link><category>alert</category><category>anonymous</category><category>contextmenu</category><category>dialog</category><category>function</category><category>kotlin</category><category>lambda</category><category>literal</category><category>menuitem</category><category>tableview</category><category>tornadofx</category><pubDate>Wed, 21 Sep 2016 10:14:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-6116688497707142497</guid><description>This post demonstrates how to specify an action handler for the TornadoFX alert() function.  This code supports a ContextMenu delete operation.  The delete operation requires a confirmation.   &amp;quot;Cancel&amp;quot; will cancel the delete operation, closing the ContextMenu.  &amp;quot;OK&amp;quot; will adjust the TableView and call the back-end logic through a TornadoFX Controller class.&lt;br&gt;
&lt;br&gt;
The purpose of the post is to show the syntax of Kotlin and TornadoFX rather than provide working code.  For that type of tutorial, check out &lt;a href="https://courses.bekwam.net/public_tutorials"&gt;courses.bekwam.net/public_tutorials&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2016/09/a-tornadofx-kotlin-context-menu-with.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjknwzoL-Iu_Q8wdV5iVaSGjpeA2REkkbKMfaQiFYy466IxGnGmWyusgvY1SXBuVlebE-eIN57S6EarRypeLCH19nf_LFOj_FuTe3yQ8N524mc2utFIdnPiuOM0RO-UXo8ubrSioPuXQjf0/s72-c/bk_tornadofx_contextmenu.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>A Kotlin JavaFX TableView Row Factory with a Lambda</title><link>http://bekwam.blogspot.com/2016/09/a-kotlin-javafx-tableview-row-factory.html</link><category>factory</category><category>javafx</category><category>kotlin</category><category>lambda</category><category>row</category><category>rowfactory</category><category>tableview</category><pubDate>Mon, 19 Sep 2016 18:00:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-3375146486137976550</guid><description>This post applies a Kotlin Lambda to a JavaFX TableView control.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2016/09/a-kotlin-javafx-tableview-row-factory.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>A Hello, World Kotlin JavaFX App</title><link>http://bekwam.blogspot.com/2016/09/a-hello-world-kotlin-javafx-app.html</link><category>hello</category><category>javafx</category><category>nullable</category><category>world</category><pubDate>Thu, 15 Sep 2016 11:37:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-4232047091870834906</guid><description>This is a JavaFX Stage displaying a Label using Kotlin.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2016/09/a-hello-world-kotlin-javafx-app.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>Visual Cues Through JavaFX ChangeListeners</title><link>http://bekwam.blogspot.com/2016/09/visual-cues-through-javafx.html</link><category>animation</category><category>binding</category><category>css</category><category>fadetransition</category><category>javafx</category><category>style</category><pubDate>Wed, 14 Sep 2016 11:01:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-3655248101518771548</guid><description>This is the third post in a series on confirming input using JavaFX.  The prior posts demonstrated how to control access to a Save Button and how to integrate a Commons Validator object to validate an email  This post adds a visual cue to the program that guides the user into producing correct input.  A ChangeListener is applied to a custom BooleanBinding which is triggered when the input is changed.&lt;br&gt;
&lt;br&gt;
Also, an animation is applied to smooth the display of the visual cue.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2016/09/visual-cues-through-javafx.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijnOLHtYlEJnYaQ63Iqizk_A0SNRfRMeU3PTP18XWFH-6fUPuvVBkaAVBoo6-v0gVSC905jOmVcej-kJOQ8f1gI9CoMg4vgKFtz8hbaoPvqCt9MLJmPCHgH06iwdqUMqv30oLdIRcPvKd4/s72-c/bk_confirm_redgreen.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>Applying Email Validation to a JavaFX TextField Using Binding</title><link>http://bekwam.blogspot.com/2016/09/applying-email-validation-to-javafx_13.html</link><category>binding</category><category>confirmation</category><category>email</category><category>javafx</category><category>stringbinding</category><category>stringexpression</category><pubDate>Tue, 13 Sep 2016 10:33:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-5843594047950229700</guid><description>This example uses the same controller as in a previous post but adds a use case to support email validation.  A Commons Validator object is used to apply the email validation rules to a TextField.  This is hooked in to the JavaFX program using a compound Binding expression.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2016/09/applying-email-validation-to-javafx_13.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>Disabling a Save Button with JavaFX Confirmation Binding Controls</title><link>http://bekwam.blogspot.com/2016/09/disabling-save-button-with-javafx.html</link><category>binding</category><category>button</category><category>compare</category><category>confirm</category><category>empty</category><category>equals</category><category>javafx</category><category>TextField</category><pubDate>Tue, 13 Sep 2016 09:38:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-415811335995651485</guid><description>This post demonstrates a one-line JavaFX Binding expression that disables a Save Button until a confirmed input is entered into a pair of TextFields.&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;btnSave.disableProperty().bind(
    txtEmail.textProperty().isEqualTo(txtConfirmEmail.textProperty()).not()
    .or(
        txtEmail.textProperty().isEmpty()
    )
);
&lt;/pre&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2016/09/disabling-save-button-with-javafx.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg256Q13mRwBglnClft63iy4YkOGTzkNi9FQfn2DB0pVjF4NmGiHBKbLxrs_BgDbojCa8hVYaYgV-ITzuftWr3q6kyUBZHdVpNP0qKe7H4wIwVIN41j-5NhxXW56PWQnrhpphW-nF6ZhXA6/s72-c/bk_confirm_sb.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">11</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>Rewriting Nested Loops as Java Streams</title><link>http://bekwam.blogspot.com/2016/09/rewriting-nested-loops-as-java-streams.html</link><category>collections</category><category>java</category><category>lambda</category><category>loops</category><category>nested</category><category>streams</category><pubDate>Thu, 8 Sep 2016 10:24:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-8333211639803989093</guid><description>This post rewrites a nested loop as a pair of Java Streams. &amp;nbsp;While there isn't much savings in comparing each statement in isolation, there will be more value if the first Stream's output is retained for other logic. &amp;nbsp;For example, if there are several blocks of code that need "activeRolesIds", then it's worthwhile to factor out that code in a Stream.&lt;br /&gt;
&lt;br /&gt;
This statement sets one or more ToggleButton to selected if that ToggleButton's userData is found in the activeRoles list which is returned from the JavaFX ListProperty roles.getValue().&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;       
for( RoleDTO activeRole : roles.getValue() ) {
    for( Node availableRoleNode : hboxRoles.getChildren() ) {
        if( availableRoleNode.getUserData().equals( activeRole.getRoleId() ) ) {
            ( (ToggleButton) availableRoleNode ).setSelected( true );
            break;
            }
        }
}
&lt;/pre&gt;
&lt;br /&gt;
This can be replaced with two Streams. &amp;nbsp;The first Stream maps a List of Integer values that is used in the second Stream's filter predicate.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;List&amp;lt;Integer&amp;gt; activeRoleIds = roles.getValue()
    .stream()
    .map( (r) -&amp;gt; r.getRoleId() )
    .collect(Collectors.toList());

hboxRoles.getChildren()
    .stream()
    .filter( (n) -&amp;gt; activeRoleIds.contains(n.getUserData()) )
    .forEach( (n) -&amp;gt; ((ToggleButton)n).setSelected(true) );
&lt;/pre&gt;
&lt;br /&gt;
Both the nested loops and the pair of Streams will set the appropriate ToggleButton state. &amp;nbsp;The Streams versions will offer a savings if later blocks of code also can use the activeRoleIds List.&lt;br /&gt;
&lt;h1&gt;
Update&lt;/h1&gt;
Here's another example of a loop (not a nested loop) rewritten as a Lambda.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;hboxRoles.getChildren().clear();
for( RoleDTO role : availableRoles ) {
    ToggleButton tb = new ToggleButton( role.getRoleName() );
    tb.setUserData( role.getRoleId() );
    hboxRoles.getChildren().add( tb );
}
&lt;/pre&gt;
&lt;br /&gt;
The Lambda uses the map() method to convert transfer objects (RoleDTO) into JavaFX controls (ToggleButton).
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;hboxRoles.getChildren().setAll(

    availableRoles
        .stream()
        .map( (r) -&amp;gt;l; {
            ToggleButton tb = new ToggleButton(r.getRoleName());
            tb.setUserData( r.getRoleId() );
            return tb;
        })
        .collect(Collectors.toList())

);
&lt;/pre&gt;
&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>SLF4J Over Log4j in TornadoFX (Kotlin)</title><link>http://bekwam.blogspot.com/2016/09/slf4j-over-log4j-in-tornadofx.html</link><category>java</category><category>javafx</category><category>kotlin</category><category>log4j</category><category>slf4j</category><category>tornadofx</category><pubDate>Sat, 3 Sep 2016 21:31:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-2767858886474090145</guid><description>TornadoFX is a JavaFX framework for the Kotlin programming language.  The TornadoFX documentation mentions Java logging, but you can use the popular SLF4J / Log4j combination.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2016/09/slf4j-over-log4j-in-tornadofx.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>org.dom4j ClassCastException on WildFly Deployment</title><link>http://bekwam.blogspot.com/2016/09/orgdom4j-classcastexception-on-wildfly.html</link><category>classcastexception</category><category>DocumentFactory</category><category>dom4j</category><category>ejb</category><category>hibernate</category><category>jar</category><category>jpa</category><category>rest</category><category>war</category><category>wildfly</category><pubDate>Sat, 3 Sep 2016 14:31:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-3235509772115675458</guid><description>When forming a WAR file containing JPA entities for deployment in WildFly, I sometimes get get the following error.&lt;br&gt;
&lt;br&gt;
Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory&lt;br&gt;
&lt;br&gt;
Despite recommendations to the contrary, I add a jboss-deployment-structure.xml that excludes this module.  See this &lt;a href="https://issues.jboss.org/browse/WFLY-5549"&gt;WildFly issue&lt;/a&gt;.  I did some A/B testing with exhaustive cleans and re-deploys and wasn&amp;#39;t able to get this to dispel the ClassCastException.&lt;br&gt;
&lt;br&gt;
I used two different fixes on different occasions.&lt;br&gt;
&lt;br&gt;
1. Make sure the datasource is good.&lt;br&gt;
&lt;br&gt;
2. Make sure that you&amp;#39;re not packing your own Hibernate.&lt;br&gt;
&lt;br&gt;
The newer versions of Gradle let you exclude Hibernate libs from your deployable using the compileOnly (not the compile) task.  This works exactly like the maven provided scope.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2016/09/orgdom4j-classcastexception-on-wildfly.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>GTK Macro to Reduce Boilerplate Callback Code</title><link>http://bekwam.blogspot.com/2016/08/gtk-macro-to-reduce-boilerplate.html</link><category>c</category><category>g_signal_connect</category><category>g_signal_swappable</category><category>gobject</category><category>gtk</category><pubDate>Sat, 27 Aug 2016 09:01:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-5921730744301817583</guid><description>When working with GTK, you tie callbacks to signals.  For example, you might have an app_exit() function that you want to be invoked when a window&amp;#39;s delete event is posted.  To do this, you&amp;#39;ll write the callback and use g_signal_connect() make the event/function association.&lt;br&gt;
&lt;br&gt;
If your callback is an existing GTK function, you can use the GObject macro g_signal_connect_swapped() to reduce the boilerplate.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2016/08/gtk-macro-to-reduce-boilerplate.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>Windows Hack for JavaFX UNDECORATED Stages</title><link>http://bekwam.blogspot.com/2016/07/windows-hack-for-javafx-undecorated.html</link><category>hack</category><category>linux</category><category>mac</category><category>opacity</category><category>scene</category><category>shadow</category><category>stage</category><category>transparent</category><category>undecorated</category><category>windows</category><pubDate>Sat, 16 Jul 2016 20:43:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-3662587393921081493</guid><description>Stages initialized with StageStyle.UNDECORATED display a shadow on the Mac and Linux, making the custom window standout from the apps running in the background.  On Windows, UNDECORATED does not display a shadow, so if the window is a light color, it may bleed into the background if there is no border.&lt;br&gt;
&lt;br&gt;
This hack wraps up the Parent from an FXML file into a VBox.  A DropShadow is added to the Parent (&amp;quot;your content&amp;quot;) and the VBox is padded to allow for the DropShadow display.  Then both the Scene and the VBox are set to be completely transparent.&lt;br&gt;
&lt;br&gt;
The StageStyle for this Windows hack must be TRANSPARENT.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2016/07/windows-hack-for-javafx-undecorated.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><author>sales@bekwam.com (Carl)</author></item><item><title>Calling a Swing Listener from JavaFX</title><link>http://bekwam.blogspot.com/2016/07/calling-swing-listener-from-javafx.html</link><category>actionlistener</category><category>javafx</category><category>jfxpanel</category><category>setonaction</category><category>swing</category><pubDate>Wed, 13 Jul 2016 08:28:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-6266231010760265271.post-2057104710079551878</guid><description>This blog post demonstrates how to call a legacy Swing ActionListener from JavaFX.  A JButton ActionListener increments a variable and sets a JTextField to the incremented value.  A JavaFX Button is added to the form that calls the same ActionListener object used by the Swing code.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://bekwam.blogspot.com/2016/07/calling-swing-listener-from-javafx.html#more"&gt;Read more »&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Twitter: @bekwaminc&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><author>sales@bekwam.com (Carl)</author></item></channel></rss>