<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DE8EQ3c7eip7ImA9WhRUFko.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514</id><updated>2012-01-27T08:06:42.902-07:00</updated><category term="AOP" /><category term="Vista" /><category term="JPA" /><category term="OpenLaszlo" /><category term="Lucene" /><category term="Java SE 6" /><category term="POI" /><category term="Noop" /><category term="Spring Framework" /><category term="ActionScript" /><category term="ECMAScript" /><category term="Clojure" /><category term="OpenXML4J" /><category term="JAX-RS" /><category term="IntelliJ IDEA" /><category term="Windows" /><category term="General Development" /><category term="Oracle" /><category term="Swing" /><category term="JAXX" /><category term="JDeveloper" /><category term="Software Development Management" /><category term="Web Development" /><category term="XQuery" /><category term="Scala" /><category term="PowerShell" /><category term="JRuby" /><category term="Guava" /><category term="BlazeDS" /><category term="JAXB" /><category term="Java SE 7" /><category term="Java EE 6" /><category term="Flex" /><category term="JAX-WS" /><category term="JavaOne 2010" /><category term="JUnit" /><category term="JSON" /><category term="Android" /><category term="HTML5" /><category term="VisualVM" /><category term="Book Review" /><category term="Servlets" /><category term="JFreeChart" /><category term="JBoss" /><category term="OSGi" /><category term="MySQL" /><category term="Annotations" /><category term="Cloud Computing" /><category term="REST" /><category term="Java EE 5" /><category term="AIR" /><category term="GlassFish" /><category term="Java SE 8" /><category term="XML" /><category term="NetBeans" /><category term="JEdit" /><category term="NoSQL" /><category term="Groovy" /><category term="JDBC" /><category term="JavaOne 2011" /><category term="JavaFX" /><category term="Blogging" /><category term="properties" /><category term="C#" /><category term="PHP" /><category term="Apache Commons" /><category term="Firefox" /><category term="Gradle" /><category term="RMOUG" /><category term="JMX" /><category term="Ruby" /><category term="Database" /><category term="Linux" /><category term="Eclipse" /><category term="JSF" /><category term="Publications" /><category term="JavaScript" /><category term="Java (General)" /><category term="Ant" /><title>Inspired by Actual Events</title><subtitle type="html">&lt;p&gt;&lt;strong&gt;Dustin's Software Development Cogitations and Speculations&lt;/strong&gt;&lt;/p&gt;

My observations and thoughts concerning software development (general development, Java, JavaFX, Groovy, Flex, ...).</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://marxsoftware.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://marxsoftware.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default?start-index=9&amp;max-results=8&amp;redirect=false&amp;v=2" /><author><name>Dustin</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>785</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>8</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/InspiredByActualEvents" /><feedburner:info uri="inspiredbyactualevents" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DEIGSX88fip7ImA9WhRUFko.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514.post-4562994469082222964</id><published>2012-01-26T23:56:00.000-07:00</published><updated>2012-01-27T08:02:08.176-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-27T08:02:08.176-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaFX" /><title>JavaFX 2.1: JavaFX 2's @DefaultProperty Annotation with FXML</title><content type="html">The &lt;a href="http://java.dzone.com/articles/focus-javafx-2-fxml-netbeans"&gt;JavaLobby/DZone syndicated version&lt;/a&gt; of my blog post &lt;a href="http://marxsoftware.blogspot.com/2012/01/focus-on-javafx-2-fxml-with-netbeans-71.html"&gt;Focus on JavaFX 2 FXML with NetBeans 7.1&lt;/a&gt; was recently published and &lt;a href="http://java.dzone.com/users/md54345"&gt;Mihai Dinca-panaitescu&lt;/a&gt; (author of DZone article &lt;a href="http://java.dzone.com/articles/tuning-your-java-vm"&gt;Tuning Your Java VM&lt;/a&gt;) added an interesting and useful feedback comment. Specifically, he stated:
&lt;blockquote&gt;I needed to put &lt;code&gt;&amp;lt;children&amp;gt;&lt;/code&gt; tag in JavaFx2Menus.fxml
&lt;p /&gt;
before MenuBar tag.
&lt;p /&gt;
otherwise an Exception is raised:
&lt;p /&gt;
javafx.fxml.LoadException: javafx.scene.layout.VBox does not have a default property.&lt;/blockquote&gt;

&lt;p&gt;I'm glad that Mihai posted this response for several reasons. First, it will help anyone else reading my post to be aware of that issue. Second, it has allowed me to speculate on the cause of this message in this blog post.&lt;/p&gt;

&lt;p&gt;My first thought at reading Mihai's comment was that perhaps the difference was that I was using JavaFX 2.1 (still beta) when I ran the example and perhaps Mihai was using production-ready JavaFX 2.0. Assuming this is the case, the next question was, "What changed in JavaFX 2.1 to make this example work without the &lt;code&gt;children&lt;/code&gt; element? Feeling that I need to balance out recent cogitations on my blog with rampant speculation, I decided to do some of that speculation in this post. I speculate that JavaFX 2.1 has applied &lt;a href="http://docs.oracle.com/javafx/2.0/api/javafx/beans/DefaultProperty.html"&gt;@DefaultProperty&lt;/a&gt; to more controls than in JavaFX 2.0 and that &lt;a href="http://docs.oracle.com/javafx/2.0/api/javafx/scene/layout/VBox.html"&gt;VBox&lt;/a&gt; was one of these which now has it applied.&lt;/p&gt;

&lt;p&gt;The Javadoc &lt;a href="http://docs.oracle.com/javafx/2.0/api/javafx/beans/DefaultProperty.html"&gt;description of the DefaultProperty annotation&lt;/a&gt; states, "Specifies a property to which child elements will be added or set when an explicit property is not given." The "&lt;a href="http://docs.oracle.com/javafx/2.0/api/javafx/fxml/doc-files/introduction_to_fxml.html#default_properties"&gt;Default Properties&lt;/a&gt;" section of the highly useful &lt;a href="http://fxexperience.com/wp-content/uploads/2011/08/Introducing-FXML.pdf"&gt;Introducing FXML&lt;/a&gt; adds:&lt;/p&gt;
&lt;blockquote&gt;A class may define a "default property" using the &lt;code&gt;@DefaultProperty&lt;/code&gt; annotation defined in the &lt;code&gt;javafx.fxml&lt;/code&gt; package. If present, the sub-element representing the default property can be omitted from the markup.
&lt;p /&gt;For example, if the &lt;code&gt;Group&lt;/code&gt; class were to define a default property of "children", the &lt;code&gt;&amp;lt;children&amp;gt;&lt;/code&gt; element would no longer be required.&lt;/blockquote&gt;

&lt;p&gt;My speculation was that JavaFX 2.1 had added &lt;code&gt;@DefaultProperty&lt;/code&gt; annotation to the &lt;code&gt;VBox&lt;/code&gt; (among others) control. Although the Javadoc for JavaFX 2.1's &lt;code&gt;VBox&lt;/code&gt; does not show this annotation applied, the JavaFX 2.1 Javadoc documentation for its parent class, &lt;a href="http://docs.oracle.com/javafx/2.0/api/javafx/scene/layout/Pane.html"&gt;Pane&lt;/a&gt;, does indicate the presence of the annotation (and the &lt;code&gt;@DefaultProperty&lt;/code&gt; annotation is itself marked &lt;a href="http://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Inherited.html"&gt;@Inherited&lt;/a&gt;). The next image shows &lt;code&gt;Pane&lt;/code&gt; JavaFX 2.0 and JavaFX 2.1 Javadoc versions side-by-side.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-er6W6BDQX7w/TyJI2lIdMYI/AAAAAAAAC-Y/Tkc1gv3H6fI/s1600/comparingPaneJavadocJavaFx20JavaFx21AnnotationCircled.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="150" width="320" src="http://4.bp.blogspot.com/-er6W6BDQX7w/TyJI2lIdMYI/AAAAAAAAC-Y/Tkc1gv3H6fI/s320/comparingPaneJavadocJavaFx20JavaFx21AnnotationCircled.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;The circled portion of the JavaFX 2.1 API documentation for &lt;code&gt;Pane&lt;/code&gt; shows that this control (and controls inheriting from it such as &lt;code&gt;VBox&lt;/code&gt;) have &lt;code&gt;children&lt;/code&gt; as the component's default property. This explains why &lt;code&gt;children&lt;/code&gt; must be explicitly specified in JavaFX 2.0, but is optional for &lt;code&gt;VBox&lt;/code&gt; in JavaFX 2.1.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;@DefaultProperty&lt;/code&gt; annotation has also been applied to the MenuBar control in JavaFX 2.1. Comparing Javadoc for &lt;a href="http://docs.oracle.com/javafx/2.0/api/javafx/scene/control/MenuBar.html"&gt;MenuBar in JavaFX 2.0&lt;/a&gt; to the Javadoc for MenuBar in 2.1 proves this. The next screen snapshot shows them side-by-side.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-i0nXz6WYg70/TyI7Zv-XOvI/AAAAAAAAC-M/_vD6zZ--IOY/s1600/comparingJavaFx20ToJavaFx21MenuBarJavadocCircledAnnotation.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="192" width="320" src="http://2.bp.blogspot.com/-i0nXz6WYg70/TyI7Zv-XOvI/AAAAAAAAC-M/_vD6zZ--IOY/s320/comparingJavaFx20ToJavaFx21MenuBarJavadocCircledAnnotation.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;The circled portion of the JavaFX 2.1 API documentation shows that an annotation has been added in JavaFX 2.1 to the &lt;code&gt;MenuBar&lt;/code&gt; class to specify that the default sub-element for &lt;code&gt;MenuBar&lt;/code&gt; is now "menus" in JavaFX 2.1. Incidentally, &lt;code&gt;Menu&lt;/code&gt; also has a new &lt;code&gt;@DefaultProperty&lt;/code&gt; with "items" as its default property. With the &lt;code&gt;@DefaultProperty&lt;/code&gt; annotation of &lt;code&gt;MenuBar&lt;/code&gt;, I decided to try removing the &lt;code&gt;&amp;lt;menus&amp;gt;&lt;/code&gt; elements from my FXML and this appeared to work fine, removing a couple lines of XML from my source FXML and allowing many lines to be less indented. It worked and I had a little more concise of an FXML representation of the same menus application layout.&lt;/p&gt;

&lt;p&gt;The more widespread use of the &lt;code&gt;@DefaultProperty&lt;/code&gt; annotation is a small, but very welcome addition to JavaFX 2.1. Although adding opening and closing "children" tags adds only two lines per use, it does increase the indentation as well for a well-formatted FXML file. FXML can be appealing because of its visual similarity to the presentation itself and having fewer "extra" lines for common cases can make it even more readable. Although the &lt;code&gt;@DefaultProperty&lt;/code&gt; annotation itself was available in JavaFX 2.0, it's much more widely applied and can be more widely used in FXML when using JavaFX 2.1.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;Original posting available at &lt;a href="http://marxsoftware.blogspot.com/"&gt;http://marxsoftware.blogspot.com/&lt;/a&gt; (Inspired by Actual Events)&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6517450204508339514-4562994469082222964?l=marxsoftware.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InspiredByActualEvents/~4/IfHawYuY_rk" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6517450204508339514&amp;postID=4562994469082222964" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/4562994469082222964?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/4562994469082222964?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InspiredByActualEvents/~3/IfHawYuY_rk/javafx-21-javafx-2s-defaultproperty.html" title="JavaFX 2.1: JavaFX 2's @DefaultProperty Annotation with FXML" /><author><name>Dustin</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-er6W6BDQX7w/TyJI2lIdMYI/AAAAAAAAC-Y/Tkc1gv3H6fI/s72-c/comparingPaneJavadocJavaFx20JavaFx21AnnotationCircled.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://marxsoftware.blogspot.com/2012/01/javafx-21-javafx-2s-defaultproperty.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkAAQXo-eSp7ImA9WhRUE04.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514.post-6690254032930193842</id><published>2012-01-23T07:59:00.000-07:00</published><updated>2012-01-23T07:59:00.451-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-23T07:59:00.451-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java (General)" /><category scheme="http://www.blogger.com/atom/ns#" term="JavaFX" /><category scheme="http://www.blogger.com/atom/ns#" term="Java SE 7" /><category scheme="http://www.blogger.com/atom/ns#" term="Groovy" /><category scheme="http://www.blogger.com/atom/ns#" term="Java SE 8" /><title>Recent Java-Related Posts Worthy of Special Notice</title><content type="html">&lt;p&gt;In this blog post, I reference and summarize recent Java-related posts that I have found to be particularly interesting and well worth the time spent reading them.&lt;/p&gt;

&lt;strong style="font-size: 125%;"&gt;JDK 8 and Unsigned Integer Arithmetic&lt;/strong&gt;

&lt;p&gt;&lt;a href="http://blogs.oracle.com/darcy/"&gt;Joe Darcy&lt;/a&gt;'s post &lt;a href="http://blogs.oracle.com/darcy/entry/unsigned_api"&gt;Unsigned Integer Arithmetic API now in JDK 8&lt;/a&gt; states that "initial API support for unsigned integer arithmetic" has been pushed into &lt;a href="http://openjdk.java.net/projects/jdk8/"&gt;Java 8&lt;/a&gt;. Darcy explains that this is implemented largely via static methods on classes &lt;a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html"&gt;java.lang.Integer&lt;/a&gt; and &lt;a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html"&gt;java.lang.Long&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Although Darcy's post is not very long, he manages to talk about the specific unsigned arithmetic functionality that is supported (conversion of Strings to unsigned integers, conversion of unsigned integers to Strings, comparing unsigned values, and calculation of unsigned division and remainder) as well as why it was decided to not implement new types such as &lt;code&gt;UnsignedInt&lt;/code&gt;. A consequence of not implementing specific unsigned types is that it is easier to inadvertently mix signed and unsigned values and Darcy suggests some ideas built on naming conventions or new built-in annotations to address this concern.&lt;/p&gt;


&lt;strong style="font-size: 125%;"&gt;Versions, Code Names, and Features of Java Releases&lt;/strong&gt;

&lt;p&gt;Speaking of new versions of Java, another Joe (&lt;a href="http://javapapers.com/about-me/"&gt;Joseph Kulandai&lt;/a&gt;) started 2012 off with a nice post on &lt;a href="http://javapapers.com/core-java/java-features-and-history/"&gt;Java Versions, Features and History&lt;/a&gt;. In this post, Kulandai lists the versions of Java in backwards chronological order (Java SE 7 listed first and JDK Version 1.0 at the bottom of the post). Under each major version of Java, Kulandai provides bullet lists of new features in that release and provides the &lt;a href="http://javachamp.blogspot.com/2008/07/java-code-names_04.html"&gt;code name&lt;/a&gt; of each release.&lt;/p&gt;


&lt;strong style="font-size: 125%;"&gt;Java 8 Status Updates&lt;/strong&gt;

&lt;p&gt;Continuing the theme of Java 8 updates, another post of interest is &lt;a href="http://jthoenes.bergischweb.de/"&gt;Johannes Thönes&lt;/a&gt;'s &lt;a href="http://jthoenes.bergischweb.de/2011/12/23/java-8-status-updates/"&gt;Java 8 Status Updates&lt;/a&gt;. This post looks at the status of "the two big new language features of the upcoming Java SE 8" (&lt;a href="http://openjdk.java.net/projects/lambda/"&gt;Project Lambda&lt;/a&gt; and &lt;a href="http://openjdk.java.net/projects/jigsaw/"&gt;Project Jigsaw&lt;/a&gt;).&lt;/p&gt;


&lt;strong style="font-size: 125%;"&gt;Java 7 Concurrency&lt;/strong&gt;

&lt;p&gt;&lt;a href="http://www.blogger.com/profile/12402045792243894660"&gt;Niklas Schlimm&lt;/a&gt; has written two recent posts on using Java 7 concurrency features. He introduces "a flexible thread synchronization mechanism called &lt;a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Phaser.html"&gt;Phaser&lt;/a&gt;" in the post &lt;a href="http://niklasschlimm.blogspot.com/2011/12/java-7-understanding-phaser.html"&gt;Java 7: Understanding the Phaser&lt;/a&gt; and looks in detail at &lt;a href="http://marxsoftware.blogspot.com/2011/12/java-7s-threadlocalrandom.html"&gt;ThreadLocalRandom&lt;/a&gt; in the post &lt;a href="http://niklasschlimm.blogspot.com/2012/01/java-7-how-to-write-really-fast-java.html"&gt;Java 7: How to write really fast Java code&lt;/a&gt;.&lt;/p&gt;


&lt;strong style="font-size: 125%;"&gt;OutOfMemoryError: Using Command-line Tools&lt;/strong&gt;

&lt;p&gt;&lt;a href="http://forum.plumbr.eu/template/NamlServlet.jtp?macro=user_nodes&amp;user=241253"&gt;Vladimir Šor&lt;/a&gt;'s &lt;a href="http://plumbr.eu/blog/solving-outofmemoryerror-jdk-tools"&gt;Solving OutOfMemoryError (part 5) - JDK Tools&lt;/a&gt; is, as its title suggests, the fifth in a series on Java memory issues available on &lt;a href="http://plumbr.eu/blog"&gt;that blog&lt;/a&gt; ("Solving OutOfMemoryError blog post series"). This post provides a brief summary description and usage information for three &lt;a href="http://docs.oracle.com/javase/7/docs/webnotes/tsg/other/tools-Windows.html"&gt;command-line tools&lt;/a&gt; bundled with the Oracle Java SDK (&lt;a href="http://marxsoftware.blogspot.com/2008/01/jps-java-virtual-machine-process-status.html"&gt;jps&lt;/a&gt;, &lt;a href="http://docs.oracle.com/javase/7/docs/technotes/tools/share/jmap.html"&gt;jmap&lt;/a&gt;, and &lt;a href="http://docs.oracle.com/javase/7/docs/technotes/tools/share/jhat.html"&gt;jhat&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The previous entries in this series are written by Nikita Salnikov-Tarnovski: &lt;a href="http://plumbr.eu/blog/solving-outofmemoryerror-story-of-a-developer"&gt;Solving OutOfMemoryError (part 1) - story of a developer&lt;/a&gt;, &lt;a href="http://plumbr.eu/blog/solving-outofmemoryerror-why-didnt-operations-solve-it"&gt;Solving OutOfMemoryError (part 2)- why didn’t operations solve it?&lt;/a&gt;, &lt;a href="http://plumbr.eu/blog/solving-outofmemoryerror-where-do-you-start"&gt;Solving OutOfMemoryError (part 3) - where do you start?&lt;/a&gt;, and &lt;a href="http://plumbr.eu/blog/solving-outofmemoryerror-memory-profilers"&gt;Solving OutOfMemoryError (part 4) - memory profilers&lt;/a&gt;.&lt;/p&gt;


&lt;strong style="font-size: 125%;"&gt;Debugging the JVM&lt;/strong&gt;

&lt;p&gt;&lt;a href="http://www.transylvania-jug.org/transilvania-jug/despre-noi"&gt;Attila Balazs&lt;/a&gt;'s post &lt;a href="http://www.transylvania-jug.org/archives/331"&gt;Debugging the JVM&lt;/a&gt; provides interesting insight on something that we don't seem to have to do as often these days as in the earlier days of the JVM, but could be a very useful resource on the occasions this does occur. Balazs talks about "crashing the JVM itself" via &lt;a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7105883"&gt;null thread group name&lt;/a&gt; and then goes onto explain using &lt;a href="http://www.ibm.com/developerworks/library/l-gdb/"&gt;gdb in Linux&lt;/a&gt; to debug the issue with the JVM.&lt;/p&gt;


&lt;strong style="font-size: 125%;"&gt;Groovy Introduction&lt;/strong&gt;

&lt;p&gt;&lt;a href="http://www.blogger.com/profile/11632964711752480304"&gt;Alex&lt;/a&gt;'s post provides an &lt;a href="http://alexsotob.blogspot.com/2011/09/soy-el-capitan-de-la-nave-tengo-el.html"&gt;introduction to Groovy&lt;/a&gt; including coverage of &lt;a href="http://marxsoftware.blogspot.com/2009/11/slurping-xml-with-groovy.html"&gt;XML with Groovy&lt;/a&gt;, &lt;a href="http://marxsoftware.blogspot.com/2010/12/regular-expressions-in-groovy-via-java.html"&gt;regular expressions with Groovy&lt;/a&gt;, and &lt;a href="http://marxsoftware.blogspot.com/2009/05/groovysql-groovy-jdbc.html"&gt;SQL with Groovy&lt;/a&gt;.&lt;/p&gt;


&lt;strong style="font-size: 125%;"&gt;A New Java Blog With Two JavaFX Posts&lt;/strong&gt;

&lt;p&gt;I've posted before on why more &lt;a href="http://marxsoftware.blogspot.com/2009/09/more-software-developers-should-write.html"&gt;developers should write blogs&lt;/a&gt;. One of the reasons is the variety of opinions and ideas that are generated that way. With this in mind, I have been interested to read the first two posts of new blog &lt;a href="http://saidandem.blogspot.com/"&gt;Experiments with Java&lt;/a&gt;. Both of the blog's current posts have been written in January 2012 and are on JavaFX 2. The posts are &lt;a href="http://saidandem.blogspot.com/2012/01/percent-width-for-tablecolumn-in-javafx.html"&gt;Percent Width for TableColumn in JavaFX 2.x TableView&lt;/a&gt; and &lt;a href="http://saidandem.blogspot.com/2012/01/sliding-in-javafx-its-all-about.html"&gt;Sliding in JavaFX (It’s all about clipping)&lt;/a&gt;.&lt;/p&gt;

&lt;strong style="font-size: 125%;"&gt;Conclusion&lt;/strong&gt;

&lt;p&gt;There have been several good Java-related posts in recent weeks and a sample of them are highlighted in this post.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;Original posting available at &lt;a href="http://marxsoftware.blogspot.com/"&gt;http://marxsoftware.blogspot.com/&lt;/a&gt; (Inspired by Actual Events)&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6517450204508339514-6690254032930193842?l=marxsoftware.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InspiredByActualEvents/~4/UK0YByKUOBw" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6517450204508339514&amp;postID=6690254032930193842" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/6690254032930193842?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/6690254032930193842?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InspiredByActualEvents/~3/UK0YByKUOBw/recent-java-related-posts-worthy-of.html" title="Recent Java-Related Posts Worthy of Special Notice" /><author><name>Dustin</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://marxsoftware.blogspot.com/2012/01/recent-java-related-posts-worthy-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0UGQ3g9eCp7ImA9WhRUEk0.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514.post-6659861515267164433</id><published>2012-01-16T19:49:00.001-07:00</published><updated>2012-01-21T20:00:22.660-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-21T20:00:22.660-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaFX" /><category scheme="http://www.blogger.com/atom/ns#" term="Book Review" /><title>Book Review: JavaFX 2.0: Introduction by Example</title><content type="html">&lt;p&gt;Although Oracle's changes to &lt;a href="http://javafx.com/"&gt;JavaFX&lt;/a&gt; at &lt;a href="http://marxsoftware.blogspot.com/2010/09/javaone-2010-general-observations-and.html"&gt;JavaOne 2010&lt;/a&gt; and &lt;a href="http://marxsoftware.blogspot.com/2011/10/javaone-2011-overall-impressions-good.html"&gt;JavaOne 2011&lt;/a&gt; have converted me from a &lt;a href="http://marxsoftware.blogspot.com/2010/05/o-javafx-what-art-thou.html"&gt;skeptic&lt;/a&gt; to a &lt;a href="http://marxsoftware.blogspot.com/2011/05/javafx-2-beta-time-to-reevaluate-javafx.html"&gt;believer&lt;/a&gt; when it comes to &lt;a href="http://marxsoftware.blogspot.com/search/label/JavaFX"&gt;JavaFX&lt;/a&gt;, the shift in JavaFX vision has not been &lt;a href="http://marxsoftware.blogspot.com/2011/12/challenges-of-javafx-reboot.html"&gt;without its downsides&lt;/a&gt;. In particular, the JavaFX book market has been tricky because &lt;a href="http://stackoverflow.com/questions/7754803/any-decent-books-on-javafx-2"&gt;nearly all available JavaFX books&lt;/a&gt; have been about version 1.x. In this post, I review the only book that I'm aware of at time of this writing that is completely focused on &lt;a href="http://javafx.com/roadmap/"&gt;JavaFX 2.0&lt;/a&gt;: &lt;a href="http://carlfx.wordpress.com/tag/carl-dea/"&gt;Carl Dea&lt;/a&gt;'s &lt;a href="http://www.apress.com/9781430242574"&gt;JavaFX 2.0: Introduction by Example&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'll start my review by stating the most important observation about &lt;em&gt;JavaFX 2.0: Introduction by Example&lt;/em&gt;: it provided me exactly what I was looking for exactly when I needed it. There are some attributes of the book that might be considered negative by some readers that I felt were positives in my use of the book. I'll attempt in this post to articulate the finer points of these attributes so that prospective readers can make up their own minds.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;JavaFX 2.0 Introduction by Example&lt;/em&gt; does exactly what the title implies: it introduces JavaFX 2.0 via numerous and varied examples. This code-heavy book is roughly similar to a "recipes" or "cookbook" with individual item covered (AKA a "recipe" in a recipes or cookbook) featuring subsections on the problem to be solved, the solution or solutions to that problem, and how those solutions work. Like the best recipes-oriented or cookbook-oriented software development books, this one is constructed so that Chapter 1 ("JavaFX Fundamentals") covers some of the basics of JavaFX early on. In other words, the reader is not dropped into JavaFX without first getting some examples of how to write and deploy basic "Hello World" style JavaFX applications.&lt;/p&gt;

&lt;p&gt;Although &lt;em&gt;JavaFX 2.0: Introduction by Example&lt;/em&gt; does provide introductory examples early on, I really appreciated the author not spending significant time discussing esoteric features of the language or delving into the &lt;a href="http://marxsoftware.blogspot.com/2011/10/coupling-of-javafxs-history-with.html"&gt;history of JavaFX&lt;/a&gt; in tedious detail or providing pages worth of explanation on why JavaFX is the &lt;a href="http://idioms.thefreedictionary.com/the+best+thing+since+sliced+bread"&gt;greatest thing since sliced bread&lt;/a&gt;. I'm usually in a hurry and I have come to resent books wasting my time on such things and this book doesn't do that. In this case, I was already familiar with these aspects of JavaFX (at least its history and why I might be interested in learning more about it), so I was especially appreciative of Dea not wasting paper and my time on that subject. In the book's concise "Introduction," Dea covers in a page and a half some advantages of JavaFX and "some history" of JavaFX along with a simple table articulating features of each release of JavaFX. It's a thing of beauty to be able to read all of this in less than two pages and in the introduction!&lt;/p&gt;

&lt;p&gt;Dea covers some more background on JavaFX in the first chapter, but again limits that discussion to a single page. This page is more detailed than the introductory section and is a nice, brief segue into the technical meat of the book. This first page also contains the sentences that I think best sum up the value of this book:&lt;/p&gt;
&lt;blockquote&gt;Although this book doesn't go through an exhaustive study of all of JavaFX 2.0's capabilities, you will find common use cases that can help you build richer applications. Hopefully, these recipes can lead you in the right direction by providing practical and real-world examples.&lt;/blockquote&gt;

&lt;p&gt;This is exactly what &lt;em&gt;JavaFX 2.0: Introduction by Example&lt;/em&gt; has done for me. It has provided me with a fast start into the world of JavaFX. Although I have since used several aspects of JavaFX not covered in this book, the book gave me the start that I needed and I was able to use &lt;a href="http://www.oracle.com/technetwork/java/javafx/documentation/index.html"&gt;JavaFX documentation&lt;/a&gt; for the areas not covered in this book.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;JavaFX 2.0: Introduction by Example&lt;/em&gt; gets to the point quickly. Besides common things like the very brief introduction and the index, the book contains four chapters (32 "recipes") spanning 174 pages of text, images, and code. Dea doesn't even waste time with a conclusion, but ends the book with "recipe" 4.5 ("Displaying Content from the Database"). Although some readers may need a conclusion to bring closure to their reading experience, I usually little value in this for me as a reader and I didn't miss it here. I typically don't read these types of book cover-to-cover anyway (instead focusing on sections or recipes I am most interested in), so the conclusion is often unnecessary. Lack of a conclusion is another example of how Dea's book focuses most on what I want: the technical meat.&lt;/p&gt;

&lt;p&gt;The four chapters in &lt;em&gt;JavaFX 2.0: Introduction by Example&lt;/em&gt; are "JavaFX Fundamentals," "Graphics with JavaFX," "Media with JavaFX," and "JavaFX on the Web." The first chapter was most useful for quickly immersing myself into the basics of JavaFX and how to apply it. The examples in that chapter tend to be simple and easy to follow. The examples in the other three chapters tend to be more sophisticated because the functionality being covered tends to be more sophisticated. There are numerous lengthy code listings in the book. Although code listings may not be the easiest to read, I like to see actual code in any book on a language. Dea typically follows each code sample with descriptive text on any new feature shown in the code sample that had not been covered previously in the book. The code samples can be downloaded from Apress's site. The book also features numerous screen snapshots, which I consider a must for a book focused on user interfaces.&lt;/p&gt;

&lt;p&gt;The concise and introductory approach of &lt;em&gt;JavaFX 2.0: Introduction by Example&lt;/em&gt; that appealed to me may not appeal to everyone. This book, as advertised in the above cited quotation from the first chapter, is intended to be introductory (hence the title) and not to be exhaustive. Some topics that I have not seen covered in this book include subjects such as &lt;a href="http://marxsoftware.blogspot.com/2012/01/focus-on-javafx-2-fxml-with-netbeans-71.html"&gt;FXML&lt;/a&gt;, the JavaFX &lt;a href="http://marxsoftware.blogspot.com/2011/12/javafx-20-bar-and-scatter-charts-and.html"&gt;charting&lt;/a&gt; functionality, &lt;a href="http://groovy.codehaus.org/GroovyFX"&gt;GroovyFX&lt;/a&gt;, and &lt;a href="http://code.google.com/p/scalafx/"&gt;ScalaFX&lt;/a&gt;. &lt;a href="http://docs.oracle.com/javafx/2.0/deployment/deploy_quick_start.htm"&gt;Deployment&lt;/a&gt; is only lightly covered (and mostly via NetBeans), but Dea does reference &lt;a href="http://docs.oracle.com/javafx/2.0/deployment/jfxpub-deployment.htm"&gt;Deploying JavaFX Applications&lt;/a&gt; for more details on JavaFX deployment. All of these areas, however, are fairly approachable given the JavaFX basics provided in this book. Dea recommends that readers reference forthcoming (&lt;a href="http://learnjavafx.typepad.com/weblog/2012/01/zenpongfx-example-excerpt-from-pro-javafx-2-platform-book.html"&gt;mid-February 2012&lt;/a&gt;, Apress) &lt;a href="http://www.apress.com/9781430268727"&gt;Pro JavaFX 2.0 Platform&lt;/a&gt; for an "invaluable resource" that provides "further insight into JavaFX."&lt;/p&gt;

&lt;p&gt;Although a small number of the items/recipes covered in &lt;em&gt;JavaFX 2.0: Introduction by Example&lt;/em&gt; are based on and assume use of &lt;a href="http://netbeans.org/"&gt;NetBeans&lt;/a&gt;, most examples in no way specific to any tool or IDE. Rather, most examples provide "raw" code that can be used in any IDE or favorite text editor. Indeed, many of the examples can be compiled with the &lt;a href="http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/javac.html"&gt;javac&lt;/a&gt; &lt;a href="http://java.sun.com/javase/technologies/core/toolsapis/javac/index.jsp"&gt;compiler&lt;/a&gt; and executed with the &lt;a href="http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/java.html"&gt;java&lt;/a&gt; &lt;a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html"&gt;application launcher&lt;/a&gt;. I appreciated that in at least one NetBeans-oriented recipe, Dea took the page or two necessary to provide the code listing for code generated by NetBeans. This is invaluable for those who do not use NetBeans or who want to understand the code itself rather than simply understanding how to use NetBeans to generate the code.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;JavaFX 2.0: Introduction by Example&lt;/em&gt; was exactly what I needed for an efficient and effective start to my investigation of JavaFX. It may not provide quite the level of soft introduction someone completely unfamiliar with JavaFX might want (especially if that person's basic Java skills are a little rusty) and it isn't an "exhaustive" JavaFX 2.0 reference either. It falls in between these extremes and seems to be a fast start example-based introduction to JavaFX for those who want to get into the core of JavaFX as quickly as possible. That's what I wanted when I purchased this book and I was happy to find out that's exactly what this book provides. It's completely JavaFX 2.x-oriented and there is no sign of deprecated JavaFX Script in any of the code examples.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;Original posting available at &lt;a href="http://marxsoftware.blogspot.com/"&gt;http://marxsoftware.blogspot.com/&lt;/a&gt; (Inspired by Actual Events)&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6517450204508339514-6659861515267164433?l=marxsoftware.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InspiredByActualEvents/~4/MBVxgOUcrYI" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6517450204508339514&amp;postID=6659861515267164433" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/6659861515267164433?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/6659861515267164433?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InspiredByActualEvents/~3/MBVxgOUcrYI/book-review-javafx-20-introduction-by.html" title="Book Review: JavaFX 2.0: Introduction by Example" /><author><name>Dustin</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><thr:total>6</thr:total><feedburner:origLink>http://marxsoftware.blogspot.com/2012/01/book-review-javafx-20-introduction-by.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEQCQXc4cCp7ImA9WhRVF08.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514.post-5947065025213051525</id><published>2012-01-16T08:06:00.000-07:00</published><updated>2012-01-16T08:06:00.938-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-16T08:06:00.938-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaFX" /><category scheme="http://www.blogger.com/atom/ns#" term="NetBeans" /><title>Focus on JavaFX 2 FXML with NetBeans 7.1</title><content type="html">&lt;p&gt;In &lt;a href="http://marxsoftware.blogspot.com/2011_10_01_archive.html"&gt;October 2011&lt;/a&gt;, I used the post &lt;a href="http://marxsoftware.blogspot.com/2011/10/hello-javafx-20-introduction-by.html"&gt;Hello JavaFX 2.0: Introduction by NetBeans 7.1 beta&lt;/a&gt; to look at using &lt;a href="http://netbeans.org/community/news/show/1539.html"&gt;NetBeans 7.1 beta&lt;/a&gt; to build a simple &lt;a href="http://en.wikipedia.org/wiki/Hello_world_program"&gt;Hello, World&lt;/a&gt; style of &lt;a href="http://javafx.com/roadmap/"&gt;JavaFX 2.0&lt;/a&gt; application. In this post, I look at using &lt;a href="http://wiki.netbeans.org/NewAndNoteworthyNB71#JavaFX_2_Support"&gt;NetBeans 7.1&lt;/a&gt; (&lt;a href="http://marxsoftware.blogspot.com/2012/01/netbeans-71-released.html"&gt;no longer in beta&lt;/a&gt;) to build a slightly more sophisticated JavaFX 2 application that makes heavy use of &lt;a href="http://wiki.netbeans.org/NewAndNoteworthyNB71#FXML"&gt;FXML&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Most of my posts on JavaFX 2 up to this point have emphasized the "pure Java" nature of JavaFX 2. The examples in these posts have been written in standard Java using JavaFX 2 APIs directly from the Java source code. These examples have also been built with the &lt;a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html"&gt;javac compiler&lt;/a&gt; and executed with the &lt;a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html"&gt;java application launcher&lt;/a&gt;. In this post, I take one of those examples [&lt;a href="http://marxsoftware.blogspot.com/2011/12/pure-java-javafx-20-menus.html"&gt;(Pure Java) JavaFX 2.0 Menus&lt;/a&gt;] and "port" it to use &lt;a href="http://docs.oracle.com/javafx/2.0/fxml_get_started/jfxpub-fxml_get_started.htm"&gt;FXML&lt;/a&gt; for presentation layout.&lt;/p&gt;

&lt;p&gt;For convenience, I include the entire Java listing for the "pure Java" implementation of the JavaFX 2 menus demonstration.&lt;/p&gt;

&lt;strong&gt;JavaFX 2.0 Menus Demonstration (Pure Java)&lt;/strong&gt;
&lt;pre name="code" class="java" style="font-size: 9pt; overflow: auto;"&gt;
package dustin.examples;

import static java.lang.System.out;

import javafx.application.Application;
import javafx.beans.property.ReadOnlyDoubleProperty;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyCodeCombination;
import javafx.scene.input.KeyCombination;
import javafx.scene.paint.Color;
import javafx.stage.Stage;

/**
 * Example of creating menus in JavaFX.
 * 
 * @author Dustin
 */
public class JavaFxMenus extends Application
{
   /**
    * Build menu bar with included menus for this demonstration.
    * 
    * @param menuWidthProperty Width to be bound to menu bar width.
    * @return Menu Bar with menus included.
    */
   private MenuBar buildMenuBarWithMenus(final ReadOnlyDoubleProperty menuWidthProperty)
   {
      final MenuBar menuBar = new MenuBar();

      // Prepare left-most 'File' drop-down menu
      final Menu fileMenu = new Menu("File");
      fileMenu.getItems().add(new MenuItem("New"));
      fileMenu.getItems().add(new MenuItem("Open"));
      fileMenu.getItems().add(new MenuItem("Save"));
      fileMenu.getItems().add(new MenuItem("Save As"));
      fileMenu.getItems().add(new SeparatorMenuItem());
      fileMenu.getItems().add(new MenuItem("Exit"));
      menuBar.getMenus().add(fileMenu);

      // Prepare 'Examples' drop-down menu
      final Menu examplesMenu = new Menu("JavaFX 2.0 Examples");
      examplesMenu.getItems().add(new MenuItem("Text Example"));
      examplesMenu.getItems().add(new MenuItem("Objects Example"));
      examplesMenu.getItems().add(new MenuItem("Animation Example"));
      menuBar.getMenus().add(examplesMenu);

      // Prepare 'Help' drop-down menu
      final Menu helpMenu = new Menu("Help");
      final MenuItem searchMenuItem = new MenuItem("Search");
      searchMenuItem.setDisable(true);
      helpMenu.getItems().add(searchMenuItem);
      final MenuItem onlineManualMenuItem = new MenuItem("Online Manual");
      onlineManualMenuItem.setVisible(false);
      helpMenu.getItems().add(onlineManualMenuItem);
      helpMenu.getItems().add(new SeparatorMenuItem());
      final MenuItem aboutMenuItem =
         MenuItemBuilder.create()
                        .text("About")
                        .onAction(
                            new EventHandler&amp;lt;ActionEvent&amp;gt;()
                            {
                               @Override public void handle(ActionEvent e)
                               {
                                  out.println("You clicked on About!");
                               }
                            })
                        .accelerator(
                            new KeyCodeCombination(
                               KeyCode.A, KeyCombination.CONTROL_DOWN))
                        .build();             
      helpMenu.getItems().add(aboutMenuItem);
      menuBar.getMenus().add(helpMenu);

      // bind width of menu bar to width of associated stage
      menuBar.prefWidthProperty().bind(menuWidthProperty);

      return menuBar;
   }

   /**
    * Start of JavaFX application demonstrating menu support.
    * 
    * @param stage Primary stage.
    */
   @Override
   public void start(final Stage stage)
   {
      stage.setTitle("Creating Menus with JavaFX 2.0");
      final Group rootGroup = new Group();
      final Scene scene = new Scene(rootGroup, 800, 400, Color.WHEAT);
      final MenuBar menuBar = buildMenuBarWithMenus(stage.widthProperty());
      rootGroup.getChildren().add(menuBar);
      stage.setScene(scene);
      stage.show();
   }

   /**
    * Main executable function for running examples.
    * 
    * @param arguments Command-line arguments: none expected.
    */
   public static void main(final String[] arguments)
   {
      Application.launch(arguments);
   }
}
&lt;/pre&gt;

&lt;p&gt;Besides adding the ability to write JavaFX applications in "pure Java" as implemented in the last code listing, JavaFX 2 also provides &lt;a href="http://tomsondev.bestsolution.at/2011/09/26/how-to-author-fxml/"&gt;FXML&lt;/a&gt;, an XML grammar for specifying a JavaFX application's layout. This approach is very similar to that provided by &lt;a href="http://learn.adobe.com/wiki/display/Flex/Getting+Started"&gt;Flex&lt;/a&gt;'s &lt;a href="http://learn.adobe.com/wiki/display/Flex/MXML"&gt;MXML&lt;/a&gt;, by &lt;a href="http://wiki.openlaszlo.org/Main_Page"&gt;OpenLaszlo&lt;/a&gt;'s &lt;a href="http://wiki.openlaszlo.org/Editing_LZX"&gt;LZX&lt;/a&gt;, and by &lt;a href="https://developer.mozilla.org/en-US/"&gt;Mozilla&lt;/a&gt;'s &lt;a href="https://developer.mozilla.org/En/XUL"&gt;XUL&lt;/a&gt;. This approach works well with JavaFX's hierarchical Scene Graph.&lt;/p&gt;

&lt;p&gt;The ported FXML code is shown next. It is easy to see the presentation structure in this XML.&lt;/p&gt;

&lt;strong&gt;JavaFx2Menus.fxml&lt;/strong&gt;
&lt;pre name="code" class="xml" style="font-size: 9pt; overflow: auto;"&gt;
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;

&amp;lt;?import java.lang.*?&amp;gt;
&amp;lt;?import javafx.scene.*?&amp;gt;
&amp;lt;?import javafx.scene.control.*?&amp;gt;
&amp;lt;?import javafx.scene.layout.*?&amp;gt;

&amp;lt;VBox id="vbox" prefHeight="400" prefWidth="800"
      xmlns:fx="http://javafx.com/fxml"
      fx:controller="dustin.examples.MenuController"&amp;gt;
   &amp;lt;MenuBar fx:id="menuBar" onKeyPressed="#handleKeyInput"&amp;gt;
      &amp;lt;menus&amp;gt;
         &amp;lt;Menu text="File"&amp;gt;
            &amp;lt;items&amp;gt;
               &amp;lt;MenuItem text="New"/&amp;gt;
               &amp;lt;MenuItem text="Open"/&amp;gt;
               &amp;lt;MenuItem text="Save"/&amp;gt;
               &amp;lt;MenuItem text="Save As"/&amp;gt;
               &amp;lt;SeparatorMenuItem  /&amp;gt;
               &amp;lt;MenuItem text="Exit"/&amp;gt;
            &amp;lt;/items&amp;gt;
         &amp;lt;/Menu&amp;gt;
         &amp;lt;Menu text="JavaFX 2.0 Examples"&amp;gt;
            &amp;lt;items&amp;gt;
               &amp;lt;MenuItem text="Text Example"/&amp;gt;
               &amp;lt;MenuItem text="Objects Example"/&amp;gt;
               &amp;lt;MenuItem text="Animation Example"/&amp;gt;
            &amp;lt;/items&amp;gt;
         &amp;lt;/Menu&amp;gt;
         &amp;lt;Menu text="Help"&amp;gt;
            &amp;lt;items&amp;gt;
               &amp;lt;MenuItem text="Search" disable="true"/&amp;gt;
               &amp;lt;MenuItem text="Online Manual" visible="false"/&amp;gt;
               &amp;lt;SeparatorMenuItem /&amp;gt;
               &amp;lt;MenuItem text="About" onAction="#handleAboutAction"/&amp;gt;
            &amp;lt;/items&amp;gt;
         &amp;lt;/Menu&amp;gt;
      &amp;lt;/menus&amp;gt;
   &amp;lt;/MenuBar&amp;gt;
&amp;lt;/VBox&amp;gt;
&lt;/pre&gt;

&lt;p&gt;The important portion of this simple FXML can be viewed on a single page within NetBeans 7.1 as shown in the next screen snapshot.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-dJsqer3WE7I/TxOJ2RwJUvI/AAAAAAAAC9s/k_N0iQSZ6XQ/s1600/JavaFxMenusFxmlInNetBeans71.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="320" width="302" src="http://4.bp.blogspot.com/-dJsqer3WE7I/TxOJ2RwJUvI/AAAAAAAAC9s/k_N0iQSZ6XQ/s320/JavaFxMenusFxmlInNetBeans71.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;Besides the conciseness of the FXML and the aesthetically pleasing hierarchical presentation, the FXML also should look familiar to anyone who has worked with Flex, OpenLaszlo, or XUL. Most of the presentation structure is easily identified in the FXML document. This example includes an &lt;code&gt;onAction&lt;/code&gt; handler that responds to the "About" menu item and there is an &lt;code&gt;onKeyPressed&lt;/code&gt; action associated with the menu bar as well (I could not figure out a way to easily associate this handler with the menu item itself). Both of these actions reference names that start with the &lt;code&gt;#&lt;/code&gt; symbol. The names following the &lt;code&gt;#&lt;/code&gt; are names of methods on the controller class (defined by the &lt;code&gt;fx:controller&lt;/code&gt; attribute of the &lt;a href="http://docs.oracle.com/javafx/2.0/api/javafx/scene/layout/VBox.html"&gt;VBox&lt;/a&gt; as the class named &lt;code&gt;dustin.examples.MenuController&lt;/code&gt;). The source for this controller class is shown next.&lt;/p&gt;

&lt;strong&gt;MenuController.java&lt;/strong&gt;
&lt;pre name="code" class="java" style="font-size: 9pt; overflow: auto;"&gt;
package dustin.examples;

import static java.lang.System.out;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.MenuBar;
import javafx.scene.input.InputEvent;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;

/**
 * Controller class for JavaFX 2 Menus with FXML post and demonstration.
 * 
 * @author Dustin
 */
public class MenuController implements Initializable
{
   @FXML
   private MenuBar menuBar;

   /**
    * Handle action related to "About" menu item.
    * 
    * @param event Event on "About" menu item.
    */
   @FXML
   private void handleAboutAction(final ActionEvent event)
   {
      provideAboutFunctionality();
   }

   /**
    * Handle action related to input (in this case specifically only responds to
    * keyboard event CTRL-A).
    * 
    * @param event Input event.
    */
   @FXML
   private void handleKeyInput(final InputEvent event)
   {
      if (event instanceof KeyEvent)
      {
         final KeyEvent keyEvent = (KeyEvent) event;
         if (keyEvent.isControlDown() &amp;&amp; keyEvent.getCode() == KeyCode.A)
         {
            provideAboutFunctionality();
         }
      }
   }

   /**
    * Perform functionality associated with "About" menu selection or CTRL-A.
    */
   private void provideAboutFunctionality()
   {
      out.println("You clicked on About!");      
   }

   @Override
   public void initialize(final URL url, final ResourceBundle rb)
   {
      menuBar.setFocusTraversable(true);
   }   
}
&lt;/pre&gt;

&lt;p&gt;The above code from the controller class includes the two methods referenced as action handlers in the FXML with the &lt;code&gt;#&lt;/code&gt; prefixes. These two methods are &lt;code&gt;private&lt;/code&gt; and normally would not be visible to the FXML loader, but the use of the annotation &lt;a href="http://docs.oracle.com/javafx/2.0/api/javafx/fxml/FXML.html"&gt;@FXML&lt;/a&gt; gets around this problem. The &lt;code&gt;menuBar&lt;/code&gt; attribute is also &lt;code&gt;private&lt;/code&gt; but visible to the FXML loader thanks to its own &lt;code&gt;@FXML&lt;/code&gt; annotation.&lt;/p&gt;

&lt;p&gt;To get the application to respond to CTRL-A before any initial access of the menu bar, I found that I needed to have a reference to the menu bar in the controller and call &lt;a href="http://docs.oracle.com/javafx/2.0/api/javafx/scene/control/MenuBar.html"&gt;setFocusTraversable(true)&lt;/a&gt; on that instance. Without doing that, the CTRL-A would only be responded to if I had first clicked on the menu bar once. The hook from the FXML to this attribute in the controller is the &lt;code&gt;fx:id&lt;/code&gt; attribute used in the FXML. That attribute references the name "menuBar", which is (not coincidentally) also the name of the attribute in the controller class. In other words, the attribute &lt;code&gt;fx:id="menuBar"&lt;/code&gt; ties the XML element that attribute is on in the FXML to the attribute with the same name in the controller.&lt;/p&gt;

&lt;p&gt;I did not show much in this post specific to NetBeans 7.1, but it is worth noting that I had all the pertinent files created in a new project using NetBeans 7.1's New Project wizard and selecting a JavaFX FXML Application as the project type. This created a basic FXML file, a basic controller file, and a main class for loading the FXML and running the application. I modified these to the examples above for the FXML and for the controller class. The modified class that loads the FXML and starts the JavaFX application is shown next. (There's not a lot to it!)&lt;/p&gt;

&lt;strong&gt;JavaFxMenusWithFxmlDemo.java&lt;/strong&gt;
&lt;pre name="code" class="java" style="font-size: 9pt; overflow: auto;"&gt;
package dustin.examples;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

/**
 * Simple example of JavaFX 2 FXML used to demonstrate JavaFX 2 menus. This is a
 * "port" of the example featured using "pure Java" (no FXML) in the post
 * "(Pure Java) JavaFX 2.0 Menus"
 * (http://marxsoftware.blogspot.com/2011/12/pure-java-javafx-20-menus.html).
 * 
 * @author Dustin
 */
public class JavaFxMenusWithFxmlDemo extends Application
{
   /**
    * Main function for running this application.
    * 
    * @param arguments Command-line arguments: none expected.
    */
   public static void main(String[] arguments)
   {
      Application.launch(JavaFxMenusWithFxmlDemo.class, arguments);
   }

   /**
    * Overridden Application.start(Stage) method.
    * 
    * @param stage Primary stage.
    * @throws Exception JavaFX application exception.
    */
   @Override
   public void start(final Stage stage) throws Exception
   {
      final Parent fxmlRoot = FXMLLoader.load(getClass().getResource("JavaFx2Menus.fxml"));
      stage.setScene(new Scene(fxmlRoot));
      stage.show();
   }
}
&lt;/pre&gt;

&lt;p&gt;I won't show the output here because it's essentially what the "pure Java" version produced, which is shown in my post on that approach. Besides generating the files that I adapted for my application, NetBeans 7.1's new project wizard for a JavaFX FXML application also created a project that automatically packages up what I need for my JavaFX application in an executable JAR. The contents of the JAR in this case are shown in the next screen snapshot.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-nALb9zuq8VY/TxOSdnu4omI/AAAAAAAAC94/tTN_lnADn7I/s1600/JavaFxMenusFxmlExampleJarContentsFromNB71Project.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="234" width="320" src="http://4.bp.blogspot.com/-nALb9zuq8VY/TxOSdnu4omI/AAAAAAAAC94/tTN_lnADn7I/s320/JavaFxMenusFxmlExampleJarContentsFromNB71Project.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;The trickiest part about using FXML is the relatively less available documentation. The pure Java APIs have the strong &lt;a href="http://docs.oracle.com/javafx/2.0/api/index.html"&gt;Javadoc API documentation&lt;/a&gt;, but I know of no such thing for FXML (including no documentation or schema for the namespace &lt;a href="http://javafx.com/fxml"&gt;http://javafx.com/fxml&lt;/a&gt;). There are some great resources of FXML such as &lt;a href="http://docs.oracle.com/javafx/2.0/fxml_get_started/jfxpub-fxml_get_started.htm"&gt;Getting Started with FXML&lt;/a&gt; and &lt;a href="http://docs.oracle.com/javafx/2.0/api/javafx/fxml/doc-files/introduction_to_fxml.html"&gt;Introduction to FXML&lt;/a&gt;. Perhaps the best document for figuring out what elements and attributes FXML provides is &lt;a href="http://fxexperience.com/wp-content/uploads/2011/08/Introducing-FXML.pdf"&gt;Introducing FXML: A Markup Language for JavaFX&lt;/a&gt;, which explains the "mapping" of JavaFX standard Java API classes to JavaFX FXML elements and attributes.&lt;/p&gt;

&lt;p&gt;FXML appears to be a fairly attractive approach for building a JavaFX application because it nicely separates presentation (FXML) from business logic (controller class and classes that would be called by controller methods). This can make it easier to visually see the GUI layout in the hierarchical XML and keep the logic and presentation from cluttering each other.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;Original posting available at &lt;a href="http://marxsoftware.blogspot.com/"&gt;http://marxsoftware.blogspot.com/&lt;/a&gt; (Inspired by Actual Events)&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6517450204508339514-5947065025213051525?l=marxsoftware.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InspiredByActualEvents/~4/nct__92lHGQ" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6517450204508339514&amp;postID=5947065025213051525" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/5947065025213051525?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/5947065025213051525?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InspiredByActualEvents/~3/nct__92lHGQ/focus-on-javafx-2-fxml-with-netbeans-71.html" title="Focus on JavaFX 2 FXML with NetBeans 7.1" /><author><name>Dustin</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-dJsqer3WE7I/TxOJ2RwJUvI/AAAAAAAAC9s/k_N0iQSZ6XQ/s72-c/JavaFxMenusFxmlInNetBeans71.png" height="72" width="72" /><thr:total>5</thr:total><feedburner:origLink>http://marxsoftware.blogspot.com/2012/01/focus-on-javafx-2-fxml-with-netbeans-71.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYHSXc8cCp7ImA9WhRVFE4.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514.post-8318244361010602655</id><published>2012-01-12T21:46:00.000-07:00</published><updated>2012-01-12T21:48:58.978-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-12T21:48:58.978-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java (General)" /><title>Revealing Project Naughtiness with Tattletale</title><content type="html">&lt;p&gt;&lt;a href="http://www.jboss.org/tattletale"&gt;Tattletale&lt;/a&gt; is a highly useful development tool that not only has a catchy name, but also has a clever slogan: "Betraying your project's naughty little secrets." &lt;a href="http://docs.jboss.org/tattletale/presentations/tattletale-1.0.pdf"&gt;Tattletale&lt;/a&gt; scours JAR files to find various naught little secrets about dependencies, multiple versions, extraneous versions of classes, JARs in multiple locations, and so forth. It is a simple tool that can be run from the command-line to generate simple HTML reports of multiple characteristics about JARs and classes.&lt;/p&gt;

&lt;p&gt;To demonstrate Tattletale, I will execute it against a &lt;a href="http://www.springsource.org/node/813"&gt;Spring Framework 2.5.6&lt;/a&gt; installation. It is simple to run Tattletale and this is demonstrated in the next screen snapshot.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-eqN4gzxP2Sg/Tw-xfhpJznI/AAAAAAAAC8I/pYRRmvM6QcA/s1600/runningTattletaleAgainstSpring256.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="189" width="320" src="http://1.bp.blogspot.com/-eqN4gzxP2Sg/Tw-xfhpJznI/AAAAAAAAC8I/pYRRmvM6QcA/s320/runningTattletaleAgainstSpring256.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;tattletale.jar&lt;/code&gt; is an executable JAR and so is run with &lt;code&gt;java -jar tattletale.jar&lt;/code&gt;. The first argument passed to it is the directory to be recursively searched (Spring 2.5.6 distribution in this case) and the second argument is the directory to which the HTML reports should be written (&lt;code&gt;spring-output&lt;/code&gt; in this example). The directory listing of the &lt;code&gt;spring-output&lt;/code&gt; directory is shown next.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-eXOSBnipvvE/Tw-yghzAsSI/AAAAAAAAC8U/ChzDen9T1co/s1600/tattletaleSpring256OutputDirectoryListing.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="240" width="320" src="http://4.bp.blogspot.com/-eXOSBnipvvE/Tw-yghzAsSI/AAAAAAAAC8U/ChzDen9T1co/s320/tattletaleSpring256OutputDirectoryListing.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;As the two previous snapshots indicate, it is very straightforward to run Tattletale against a desired directory. A web browser can be used to open the &lt;code&gt;index.html&lt;/code&gt; page as the starting page. This is shown in the next screen snapshot.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-T_1m75Y9buo/Tw-y3xW5jGI/AAAAAAAAC8g/Cf02TBGUslo/s1600/topOfTattletaleOutputForSpring256.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="320" width="203" src="http://2.bp.blogspot.com/-T_1m75Y9buo/Tw-y3xW5jGI/AAAAAAAAC8g/Cf02TBGUslo/s320/topOfTattletaleOutputForSpring256.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;Only a subset of the available reports are shown in the above snapshot. Clicking on links brings up the individual reports. I show portions of select reports (circular dependencies, class locations, multiple copies of JARs, transitive dependencies, and transitive dependents) next.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-uSFumGcmsHc/Tw-zoi4l5KI/AAAAAAAAC8s/jZfnIAv2oDY/s1600/tattletaleSpring256CircularDependency.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="135" width="320" src="http://1.bp.blogspot.com/-uSFumGcmsHc/Tw-zoi4l5KI/AAAAAAAAC8s/jZfnIAv2oDY/s320/tattletaleSpring256CircularDependency.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-L4868wc7_Kw/Tw-z1l8qmKI/AAAAAAAAC84/vkS0NC4heQU/s1600/tattletaleSpring256ClassListing.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="139" width="320" src="http://2.bp.blogspot.com/-L4868wc7_Kw/Tw-z1l8qmKI/AAAAAAAAC84/vkS0NC4heQU/s320/tattletaleSpring256ClassListing.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-dJMlkW5xaF8/Tw-0EU0EdGI/AAAAAAAAC9E/rEwCvZVasQU/s1600/tattletaleSpring256MultipleJars.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="145" width="320" src="http://3.bp.blogspot.com/-dJMlkW5xaF8/Tw-0EU0EdGI/AAAAAAAAC9E/rEwCvZVasQU/s320/tattletaleSpring256MultipleJars.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-GE83tFkgUUw/Tw-0R5UV8WI/AAAAAAAAC9Q/Qcuxe4vZDgw/s1600/tattletaleSpring256TransitiveDependsOn.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="179" width="320" src="http://2.bp.blogspot.com/-GE83tFkgUUw/Tw-0R5UV8WI/AAAAAAAAC9Q/Qcuxe4vZDgw/s320/tattletaleSpring256TransitiveDependsOn.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-csT6vLa2Qps/Tw-0V0QOD6I/AAAAAAAAC9c/O_LKquA8oS8/s1600/tattletaleSpring256TransitiveDependents.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="109" width="320" src="http://3.bp.blogspot.com/-csT6vLa2Qps/Tw-0V0QOD6I/AAAAAAAAC9c/O_LKquA8oS8/s320/tattletaleSpring256TransitiveDependents.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;Tattletale is so easy to use, very little &lt;a href="http://www.jboss.org/tattletale/docs"&gt;documentation&lt;/a&gt; is necessary. However, there is a &lt;a href="http://docs.jboss.org/tattletale/presentations/tattletale-1.0.pdf"&gt;slide presentation&lt;/a&gt; and a &lt;a href="http://docs.jboss.org/tattletale/userguide/1.1/pdf/JBossTattletale-UsersGuide.pdf"&gt;User's Guide&lt;/a&gt; with introductory information. The 32-page User Guide covers running Tattletale (similar to this post) along with providing details on how to configure the tool via &lt;code&gt;jboss-tattletale.properties&lt;/code&gt; and providing an overview of the many reports that &lt;a href="http://blog.carlossanchez.eu/2011/03/23/finding-duplicate-classes-in-your-war-files-with-tattletale/"&gt;Tattletale&lt;/a&gt; provides about one's project.&lt;/p&gt;

&lt;p&gt;To address and correct a project's naughtiest little secrets, one must know what they are. Tattletale is an easy-to-use tool that exposes these naughty secrets so that they can be addressed.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;Original posting available at &lt;a href="http://marxsoftware.blogspot.com/"&gt;http://marxsoftware.blogspot.com/&lt;/a&gt; (Inspired by Actual Events)&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6517450204508339514-8318244361010602655?l=marxsoftware.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InspiredByActualEvents/~4/DF6sfRDApP4" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6517450204508339514&amp;postID=8318244361010602655" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/8318244361010602655?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/8318244361010602655?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InspiredByActualEvents/~3/DF6sfRDApP4/revealing-project-naughtiness-with.html" title="Revealing Project Naughtiness with Tattletale" /><author><name>Dustin</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-eqN4gzxP2Sg/Tw-xfhpJznI/AAAAAAAAC8I/pYRRmvM6QcA/s72-c/runningTattletaleAgainstSpring256.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://marxsoftware.blogspot.com/2012/01/revealing-project-naughtiness-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IDSHc8cSp7ImA9WhRVE0g.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514.post-5714015867394120818</id><published>2012-01-11T22:16:00.000-07:00</published><updated>2012-01-11T23:59:39.979-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-11T23:59:39.979-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="NetBeans" /><title>NetBeans 7.1's Unused Assignment and Dead Branch Hints</title><content type="html">&lt;p&gt;One of the &lt;a href="http://wiki.netbeans.org/NewAndNoteworthyNB71#Hints"&gt;new code hints&lt;/a&gt; provided by &lt;a href="http://wiki.netbeans.org/NewAndNoteworthyNB71"&gt;NetBeans 7.1&lt;/a&gt; is the &lt;a href="http://wiki.netbeans.org/File:Unused-assignment.png"&gt;Unused Assignment&lt;/a&gt; hint. A simple code sample that will cause this hint to be displayed in &lt;a href="http://netbeans.org/community/releases/71/"&gt;NetBeans 7.1&lt;/a&gt; is shown next.&lt;/p&gt;

&lt;strong&gt;Demonstrating Unused Assignment&lt;/strong&gt;
&lt;pre name="code" class="java" style="font-size: 9pt; overflow: auto;"&gt;
   /**
    * Demonstrate NetBeans 7.1 code hint for situation in which variable
    * assignment is made but never used.
    * 
    * @return Integer.
    */
   private static int demoUnusedAssignment()
   {
      int i = 2;
      // ... do some good stuff, but without changing i's assignment or
      //     accessing i's value ...
      i = 3;
      return i;
   }
&lt;/pre&gt;

&lt;p&gt;In the code above, the local variable "i" is initialized to 2, but is never used and then is initialized again, making the first initialization unnecessary. The next image is a screen snapshot that shows NetBeans 7.1 displaying a warning code hint for the unused assignment.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-eHnpaPM_6M4/Tw5x2kZr4MI/AAAAAAAAC7Y/G6_8sGf1sgU/s1600/NetBeans71AssignedValueIsNeverUsed.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="110" width="320" src="http://2.bp.blogspot.com/-eHnpaPM_6M4/Tw5x2kZr4MI/AAAAAAAAC7Y/G6_8sGf1sgU/s320/NetBeans71AssignedValueIsNeverUsed.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;As the above image indicates, NetBeans 7.1 warns of "The assigned value is never used."&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://wiki.netbeans.org/NewAndNoteworthyNB71"&gt;New And Noteworthy in NetBeans IDE 7.1 page&lt;/a&gt; mentions this hint &lt;a href="http://wiki.netbeans.org/NewAndNoteworthyNB71#Hints"&gt;among others&lt;/a&gt; and states:&lt;/p&gt;
&lt;blockquote&gt;&lt;strong&gt;Unused Assignment&lt;/strong&gt;&lt;p /&gt;
A new pair of hints, Unused Assignment and Dead Branch, was introduced. The Unused Assignment finds values that are computed and assigned to a variable, but never used by reading the variable. The Dead Branch hint searches for branches of code that can never be executed.&lt;/blockquote&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-ghItHyo0P-U/Tw50Qi3qeLI/AAAAAAAAC7k/gFm0kYx-iGQ/s1600/NetBeans71AssignedValueIsNeverUsedWikiPageEntryWithDeadBranch.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="122" width="320" src="http://1.bp.blogspot.com/-ghItHyo0P-U/Tw50Qi3qeLI/AAAAAAAAC7k/gFm0kYx-iGQ/s320/NetBeans71AssignedValueIsNeverUsedWikiPageEntryWithDeadBranch.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p /&gt;
&lt;strong style="font-size: 125%;"&gt;Oh Dead Branch Hint, Where Art Thou?&lt;/strong&gt;

&lt;p&gt;The Unused Assignment Hint seems to work as suggested based on the example shown above. However, I have not been able to generate code that demonstrates the "Dead Branch" hint. I wonder if the Dead Branch hint is not yet supported and text related to it is not supposed to be under the "Unused Assignment" heading.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-6K-jUDhuwtM/Tw54ayA7bQI/AAAAAAAAC78/ibgc2_Zhy7g/s1600/NetBeans71NewNoteworthyHintsOnDeadBranchText.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="121" width="320" src="http://3.bp.blogspot.com/-6K-jUDhuwtM/Tw54ayA7bQI/AAAAAAAAC78/ibgc2_Zhy7g/s320/NetBeans71NewNoteworthyHintsOnDeadBranchText.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;The following code contains a listing with several methods that I would expect might potentially lead to a warning about a dead code branch. None of these cause this code hint to appear in any form (warning or error) in my installation of NetBeans 7.1.&lt;/p&gt;

&lt;strong&gt;Methods With Compilable Dead Code Branches&lt;/strong&gt;
&lt;pre name="code" class="java" style="font-size: 9pt; overflow: auto;"&gt;
package dustin.examples;

import static java.lang.System.out;

/**
 * Class demonstrating NetBeans 7.1's hint for dead code.
 * 
 * @author Dustin
 */
public class DeadCode
{
   /**
    * Nonsense method that includes an "else" clause that can never be executed.
    * 
    * @param someInt Any primitive int.
    */
   private static void neverExecutedElse(final int someInt)
   {
      if (someInt &amp;lt; 0)
      {
         out.println("The integer you provided is less than zero.");
      }
      else if (someInt &amp;gt; 0)
      {
         out.println("The integer you provided is greater than zero.");
      }
      else if (someInt == 0)
      {
         out.println("The integer is equal to zero.");
      }
      else
      {
         out.println("Unable to categorize provided integer.");
      }
   }

   /**
    * Nonsense method that has executable code following conditions that are
    * always true and always lead to premature termination of the method.
    */
   private static void codeAfterAlwaysTrueConditional()
   {
      if (true)
      {
         throw new RuntimeException("Ouch!");
      }
      final String nothingHere = "Nothing here.";
      out.println(nothingHere);

      if (true)
      {
         return;
      }
      final String nothingHereEither = "Nothing here either.";
      out.println(nothingHereEither);
   }

   /**
    * Nonsense method that prints text to standard output only if the provided
    * boolean can be both {@code true} and {@code false} at the same time.
    * 
    * @param boolValue Boolean value of no consequence.
    */
   private static void cannotHaveItBothWays(final boolean boolValue)
   {
      if (boolValue)
      {
         if (!boolValue)
         {
            out.println("Make up your mind (true or false)!");
         }
      }
      else
      {
         if (boolValue)
         {
            out.println("Make up your mind (false or true)!");
         }
      }
   }

   /**
    * Runs else-if that is same as previous if such that one conditonal
    * prevents the second conditional's implementation from ever being executed.
    * 
    * @param boolValue A boolean value of no consequence.
    */
   private static void pesterUntilItWorks(boolean boolValue)
   {
      boolValue = true;
      if (boolValue)
      {
         out.println("It matches once.");
      }
      else if (boolValue)
      {
         out.println("It matches twice.");
      }
      else if (!boolValue)
      {
         out.println("No match once.");
      }
      else if (!boolValue)
      {
         out.println("No match twice!");
      }
   }

   /**
    * Cover all conditions in first conditional and include a never-can-happen
    * else portion of conditional.
    */
   private static void completeConditionalCoverage()
   {
      boolean boolValue = true;
      if (boolValue || !boolValue)
      {
         out.println("I'm always going to happen.");
      }
      else
      {
         out.println("I'm never going to happen.");
      }

      if (boolValue &amp;&amp; !boolValue)
      {
         out.println("I'll never happen either.");
      }
      else
      {
         out.println("I'll also always happen.");
      }
   }

   /**
    * Main executable function.
    * 
    * @param arguments Command-line arguments: none expected.
    */
   public static void main(final String[] arguments)
   {
      if (false)
      {
         neverExecutedElse(5);
         codeAfterAlwaysTrueConditional();
         cannotHaveItBothWays(true);
         pesterUntilItWorks(true);
         demoUnusedAssignment();
         completeConditionalCoverage();
      }
   }
}
&lt;/pre&gt;

&lt;p&gt;Although none of the methods in the directly previous code listing lead to the Dead Branch code hint, NetBeans 7.1 does include configuration options for the Dead Branch hint. This is shown in the next screen snapshot (selecting Tools-&amp;gt;Options followed by the "Editor" tab and then selecting "Hints").&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-WthE3CftRQs/Tw52be8_VgI/AAAAAAAAC7w/0LLdi2Ul5rA/s1600/NetBeans71DeadBranchHintWithUnusedAssignmentHintConfiguration.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="259" width="320" src="http://1.bp.blogspot.com/-WthE3CftRQs/Tw52be8_VgI/AAAAAAAAC7w/0LLdi2Ul5rA/s320/NetBeans71DeadBranchHintWithUnusedAssignmentHintConfiguration.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;The &lt;a href="http://wiki.netbeans.org/NewAndNoteworthyNB71"&gt;NetBeans 7.1 News and Noteworthy page&lt;/a&gt; shows examples of &lt;a href="http://wiki.netbeans.org/NewAndNoteworthyNB71#Hints"&gt;other new hints&lt;/a&gt;, but does not show an example of the Dead Branch hint. Also, the text talking about Dead Branch is mixed with the section on Unused Assignment and under a heading that only talks about Unused Assignment. As my previous code listing demonstrates, I attempted to come up with a code sample to demonstrate the Dead Branch hint, but have not been able to do so. The purpose of this hint ("search[ing] for branches of code that can never be executed") sounds like a nice complement to compiler errors such as "&lt;a href="http://stackoverflow.com/questions/3795585/why-does-java-have-an-unreachable-statement-compiler-error"&gt;unreachable statement&lt;/a&gt;" and "&lt;a href="http://stackoverflow.com/questions/3222871/exception-already-caught-error"&gt;exception already caught&lt;/a&gt;" and other NetBeans "green" warnings such as "variable such-and-such is not used."&lt;/p&gt;

&lt;p&gt;I have &lt;a href="http://marxsoftware.blogspot.com/2010/10/seven-indispensable-netbeans-java-hints.html"&gt;blogged about NetBeans hints&lt;/a&gt; before and the &lt;a href="http://wiki.netbeans.org/NewAndNoteworthyNB71#Hints"&gt;addition of new hints&lt;/a&gt; in &lt;a href="http://wiki.netbeans.org/NetBeans_71"&gt;NetBeans 7.1&lt;/a&gt; is welcome. If anyone knows of a code sample that will demonstrate the Dead Branch hint in NetBeans 7.1, please share!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;Original posting available at &lt;a href="http://marxsoftware.blogspot.com/"&gt;http://marxsoftware.blogspot.com/&lt;/a&gt; (Inspired by Actual Events)&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6517450204508339514-5714015867394120818?l=marxsoftware.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InspiredByActualEvents/~4/xXPa0ofQ3YA" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6517450204508339514&amp;postID=5714015867394120818" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/5714015867394120818?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/5714015867394120818?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InspiredByActualEvents/~3/xXPa0ofQ3YA/netbeans-71s-unused-assignment-and-dead.html" title="NetBeans 7.1's Unused Assignment and Dead Branch Hints" /><author><name>Dustin</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-eHnpaPM_6M4/Tw5x2kZr4MI/AAAAAAAAC7Y/G6_8sGf1sgU/s72-c/NetBeans71AssignedValueIsNeverUsed.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://marxsoftware.blogspot.com/2012/01/netbeans-71s-unused-assignment-and-dead.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4AQ3o7eip7ImA9WhRVEUo.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514.post-2784351831669665490</id><published>2012-01-09T22:21:00.002-07:00</published><updated>2012-01-09T22:39:02.402-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-09T22:39:02.402-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="NetBeans" /><title>Comparing Heap Dumps with NetBeans 7.1</title><content type="html">&lt;p&gt;One of the "&lt;a href="http://wiki.netbeans.org/NewAndNoteworthyNB71"&gt;new and noteworthy&lt;/a&gt;" features of &lt;a href="http://wiki.netbeans.org/NetBeans_71"&gt;NetBeans 7.1&lt;/a&gt; is the ability to &lt;a href="http://wiki.netbeans.org/NewAndNoteworthyNB71#Compare_heap_dumps"&gt;compare two heap dumps&lt;/a&gt;. Specifically, the easy-to-use feature allows one to quickly ascertain the difference in number of each class's instances between two dump files. This brief post shows how easy it is to use.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://docs.oracle.com/javase/6/docs/technotes/tools/share/jhat.html"&gt;Heap dumps&lt;/a&gt; can be generated in a &lt;a href="http://docs.oracle.com/javase/6/docs/technotes/tools/share/jhat.html#description"&gt;variety of ways&lt;/a&gt;. For purposes of this post, I have created two heap dumps on two totally separate applications using the Oracle JDK-provided &lt;a href="http://docs.oracle.com/javase/6/docs/technotes/tools/share/jmap.html"&gt;jmap&lt;/a&gt; (Java Memory Map) tool to attach to the processes's Java PIDs and create heap dumps (creatively named &lt;code&gt;Heap1.map&lt;/code&gt; and &lt;code&gt;Heap2.map&lt;/code&gt; in my example). It's probably not useful in most cases to compare heap dumps of two entirely different applications. I only do so in this example to make the differences calculated in the comparison results obvious.&lt;/p&gt;

&lt;p&gt;The next screen snapshot shows &lt;a href="http://marxsoftware.blogspot.com/2012/01/netbeans-71-released.html"&gt;NetBeans 7.1&lt;/a&gt; started with the option "Load heap dump..." being selected under the "Profile" menu. This is done to load the first heap dump of the two to be compared.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-w1IQfVSQOBQ/TwvFoVkUeqI/AAAAAAAAC6E/hZf3VUADRiA/s1600/loadingHeapDumpInNetBeans71.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="229" width="320" src="http://3.bp.blogspot.com/-w1IQfVSQOBQ/TwvFoVkUeqI/AAAAAAAAC6E/hZf3VUADRiA/s320/loadingHeapDumpInNetBeans71.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;The next screen image shows the results of selecting "Load heap dump..." (the popup titled "Open Heap Dump File") and indicates selecting one of the heap dumps (&lt;code&gt;Heap1.map&lt;/code&gt;).&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-xN-spvzmBAg/TwvGWLiOLnI/AAAAAAAAC6Q/75WIFPswzr8/s1600/netbeans71openHeapDumpFileSelector.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="203" width="320" src="http://4.bp.blogspot.com/-xN-spvzmBAg/TwvGWLiOLnI/AAAAAAAAC6Q/75WIFPswzr8/s320/netbeans71openHeapDumpFileSelector.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;The next screen snapshot shows how NetBeans 7.1 looks with the selected heap dump displayed with the "Summary" tab in focus.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-Hek3R_yAVtc/TwvGv7VCX2I/AAAAAAAAC6c/OefRBr7X6Ac/s1600/netbeans71Heap1Displayed.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="155" width="320" src="http://3.bp.blogspot.com/-Hek3R_yAVtc/TwvGv7VCX2I/AAAAAAAAC6c/OefRBr7X6Ac/s320/netbeans71Heap1Displayed.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;The last image showed the heap file loaded in NetBeans 7.1 with the "Summary" tab in focus. The next image is a snapshot of the IDE switched to the "Classes" tab in the heap dump report area.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-Mu6dptEMWLE/TwvHFPm_cuI/AAAAAAAAC6o/dApxbvRjDpc/s1600/netbeans71Heap1DisplayedClassesTab.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="189" width="320" src="http://1.bp.blogspot.com/-Mu6dptEMWLE/TwvHFPm_cuI/AAAAAAAAC6o/dApxbvRjDpc/s320/netbeans71Heap1DisplayedClassesTab.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;The last image indicates that NetBeans shows the number of instances of different classes in the Java application whose heap dump is being analyzed. By default, the instances are listed in descending order of number of instances, but one can click on the "Size" column header to sort by total size. Just above the column headings "Instances" and "Size" is a link that says, "Compare with another heap dump" and that is the main focus of this post.&lt;/p&gt;

&lt;p&gt;Clicking on the "Compare with another heap dump" link in the "Classes" tab of NetBeans 7.1's heap dump analysis tool leads to a popup ("Select Heap Dump to Compare") for selecting the second heap dump to be compared. This is indicated in the next screen snapshot.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-OCtcRzpI3VY/TwvILSyLS_I/AAAAAAAAC60/Gzf-eEq6U78/s1600/netbeans71SelectHeapDumpToCompare.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="190" width="320" src="http://2.bp.blogspot.com/-OCtcRzpI3VY/TwvILSyLS_I/AAAAAAAAC60/Gzf-eEq6U78/s320/netbeans71SelectHeapDumpToCompare.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;In my example, I had two other heap dump files in the same directory as the originally selected one (&lt;code&gt;Heap2.map&lt;/code&gt; and &lt;code&gt;Heap3.map&lt;/code&gt;). Selecting &lt;code&gt;Heap3.map&lt;/code&gt; leads to the comparison being made. This can take a few seconds for the NetBeans IDE to update the representation and it might be worth moving the scroll bar on the right down and back up to make sure it has updated. The next two screen snapshots show the comparison displayed with the first screen snapshot showing the types for which the first heap dump has more instances than the other (top) and the second image showing the types for which the second heap dump has more instances than the other (bottom).&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-sa9YEq0vx5c/TwvI5b7b5_I/AAAAAAAAC7A/yJUrMw8qbkw/s1600/netbeans71showingHeapDumpDifferences.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="189" width="320" src="http://2.bp.blogspot.com/-sa9YEq0vx5c/TwvI5b7b5_I/AAAAAAAAC7A/yJUrMw8qbkw/s320/netbeans71showingHeapDumpDifferences.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-VCLWWvURvvU/TwvJG1C6p8I/AAAAAAAAC7M/JRp9Jp8gMhA/s1600/netbeans71showingHeapDumpDifferencesBottom.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="190" width="320" src="http://3.bp.blogspot.com/-VCLWWvURvvU/TwvJG1C6p8I/AAAAAAAAC7M/JRp9Jp8gMhA/s320/netbeans71showingHeapDumpDifferencesBottom.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;The + and - signs indicate the number of instances greater (+) or fewer (-) in the first heap dump file analyzed (&lt;code&gt;Heap1.map&lt;/code&gt;) as compared to that of the second heap dump file analyzed (&lt;code&gt;Heap3.map&lt;/code&gt;). In other words, types with positive numbers have more instances represented in the originally loaded heap dump and types wiuth negative numbers have fewer instances represented in the originally loaded heap dump.&lt;/p&gt;

&lt;p&gt;When comparing two separate applications, this doesn't provide much that's interesting other than to illustrate the tool. However, given two instances of the same application at the same execution point with different context or data sets might prove more interesting when comparing heap dumps. Perhaps the most enlightening use of this tool is for comparing heap dumps taken from the same application at different points in its execution. With NetBeans 7.1, it is easy to rapidly determine the difference between two heap dumps in terms of instances loaded at the time each heap dump was taken. When it's the delta or difference that matters, this tool can be useful.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;Original posting available at &lt;a href="http://marxsoftware.blogspot.com/"&gt;http://marxsoftware.blogspot.com/&lt;/a&gt; (Inspired by Actual Events)&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6517450204508339514-2784351831669665490?l=marxsoftware.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InspiredByActualEvents/~4/b_6P8FvZ1j0" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6517450204508339514&amp;postID=2784351831669665490" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/2784351831669665490?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/2784351831669665490?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InspiredByActualEvents/~3/b_6P8FvZ1j0/comparing-heap-dumps-with-netbeans-71.html" title="Comparing Heap Dumps with NetBeans 7.1" /><author><name>Dustin</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-w1IQfVSQOBQ/TwvFoVkUeqI/AAAAAAAAC6E/hZf3VUADRiA/s72-c/loadingHeapDumpInNetBeans71.png" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://marxsoftware.blogspot.com/2012/01/comparing-heap-dumps-with-netbeans-71.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0AHQnozeip7ImA9WhRVEE0.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514.post-9221837748482857529</id><published>2012-01-07T22:48:00.000-07:00</published><updated>2012-01-07T22:48:53.482-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-07T22:48:53.482-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JBoss" /><category scheme="http://www.blogger.com/atom/ns#" term="Book Review" /><title>First Impressions of Book 'JBoss AS 7 Configuration, Deployment and Administration'</title><content type="html">&lt;p&gt;&lt;a href="http://www.packtpub.com/"&gt;Packt Publishing&lt;/a&gt; recently invited me to review the book &lt;a href="http://www.packtpub.com/jboss-as-7-configuration-deployment-administration/book"&gt;JBoss AS 7 Configuration, Deployment and Administration&lt;/a&gt;. I readily accepted because I have not used or even read about &lt;a href="http://www.jboss.org/"&gt;JBoss&lt;/a&gt; in several years and welcomed the opportunity to read about its latest features. In this post, I provide a very brief first impression of the PDF version of this book similar to the &lt;a href="http://marxsoftware.blogspot.com/2011/08/first-impressions-of-java-ee-6.html"&gt;brief preliminary review I previously provided&lt;/a&gt; of the Packt book &lt;a href="http://www.packtpub.com/java-ee-6-development-with-netbeans-7/book"&gt;Java EE 6 Development with NetBeans 7&lt;/a&gt;. I intend to provide a more thorough review of &lt;em&gt;JBoss AS 7 Configuration, Deployment and Administration&lt;/em&gt; in a future post with a level of detail &lt;a href="http://marxsoftware.blogspot.com/2011/08/book-review-java-ee-6-development-with.html"&gt;similar to that I provided&lt;/a&gt; for &lt;em&gt;Java EE 6 Development with NetBeans 7&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The subtitle of author Francesco Marchioni's book &lt;em&gt;JBoss AS 7 Configuration, Deployment and Administration&lt;/em&gt; is: "Build a fully-functional, efficient application server using JBoss AS." The "About the Author" section of the book states that Marchioni runs the site &lt;a href="http://www.mastertheboss.com/"&gt;http://www.mastertheboss.com/&lt;/a&gt;, which has a main page with the subtitle "JBoss and Java EE tutorials." Two links currently shown on that main page are to posts about &lt;a href="http://www.mastertheboss.com/jboss-application-server/342-jboss-as-7-book-published-.html"&gt;publication&lt;/a&gt; of &lt;em&gt;JBoss AS 7 Configuration, Deployment and Administration&lt;/em&gt; and about &lt;a href="http://www.mastertheboss.com/component/content/article/349-win-free-copies-of-jboss-as-7-configuration-deployment-and-administration-book.html"&gt;winning a free copy&lt;/a&gt; of &lt;em&gt;JBoss AS 7 Configuration, Deployment and Administration&lt;/em&gt;. Marchioni has also written the books &lt;a href="http://www.packtpub.com/jboss-as-5-development/book"&gt;JBoss AS 5 Development&lt;/a&gt; and &lt;a href="https://www.packtpub.com/jboss-5-performance-tuning/book"&gt;JBoss AS 5 Performance Tuning&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://www.packtpub.com/jboss-as-7-configuration-deployment-administration/book"&gt;Packt Publishing page&lt;/a&gt; for &lt;em&gt;JBoss AS 7 Configuration, Deployment and Administration&lt;/em&gt; provides a look at the book's &lt;a href="http://www.packtpub.com/toc/jboss-7-configuration-deployment-and-administration-table-contents"&gt;Table of Contents&lt;/a&gt;, provides a free sample chapter, and provides more &lt;a href="http://www.packtpub.com/jboss-as-7-configuration-deployment-administration/book#in_detail"&gt;details on what the book covers&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Perusing the &lt;a href="http://www.packtpub.com/toc/jboss-7-configuration-deployment-and-administration-table-contents"&gt;Table of Contents&lt;/a&gt; of &lt;em&gt;JBoss AS 7 Configuration, Deployment and Administration&lt;/em&gt; leads me to believe that the 11 chapters will provide broad coverage of administrating and developing with &lt;a href="http://www.jboss.org/as7"&gt;JBoss AS 7&lt;/a&gt;. The chapters include the titles &lt;a href="http://www.packtpub.com/toc/jboss-7-configuration-deployment-and-administration-table-contents#chapter_1"&gt;Installing JBoss AS 7&lt;/a&gt;, &lt;a href="http://www.packtpub.com/toc/jboss-7-configuration-deployment-and-administration-table-contents#chapter_2"&gt;Configuring the Application Server&lt;/a&gt;, &lt;a href="http://www.packtpub.com/toc/jboss-7-configuration-deployment-and-administration-table-contents#chapter_3"&gt;Configuring Enterprise Services&lt;/a&gt;, &lt;a href="http://www.packtpub.com/toc/jboss-7-configuration-deployment-and-administration-table-contents#chapter_4"&gt;JBoss Web Server Configuration&lt;/a&gt;, &lt;a href="http://www.packtpub.com/toc/jboss-7-configuration-deployment-and-administration-table-contents#chapter_5"&gt;Configuring a JBoss AS Domain&lt;/a&gt;, &lt;a href="http://www.packtpub.com/toc/jboss-7-configuration-deployment-and-administration-table-contents#chapter_6"&gt;Deploying Applications on JBoss AS 7&lt;/a&gt;, &lt;a href="http://www.packtpub.com/toc/jboss-7-configuration-deployment-and-administration-table-contents#chapter_7"&gt;Managing the Application Server&lt;/a&gt;, &lt;a href="http://www.packtpub.com/toc/jboss-7-configuration-deployment-and-administration-table-contents#chapter_8"&gt;Clustering&lt;/a&gt;, &lt;a href="http://www.packtpub.com/toc/jboss-7-configuration-deployment-and-administration-table-contents#chapter_9"&gt;Load-balancing Web Applications&lt;/a&gt;, &lt;a href="http://www.packtpub.com/toc/jboss-7-configuration-deployment-and-administration-table-contents#chapter_10"&gt;Securing JBoss AS 7&lt;/a&gt;, and the particular trendy title &lt;a href="http://www.packtpub.com/toc/jboss-7-configuration-deployment-and-administration-table-contents#chapter_11"&gt;Taking JBoss AS 7 in the Cloud&lt;/a&gt;. The &lt;a href="http://www.packtpub.com/toc/jboss-7-configuration-deployment-and-administration-table-contents#chapter_12"&gt;Appendix&lt;/a&gt; looks useful with sections summarizing options and commands for &lt;a href="http://community.jboss.org/wiki/CommandLineInterface"&gt;JBoss 7 Command Line Interface&lt;/a&gt; (&lt;a href="https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-RunningtheCLI"&gt;CLI&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;I look forward to reading &lt;em&gt;JBoss AS 7 Configuration, Deployment and Administration&lt;/em&gt; and learning more about &lt;a href="http://www.jboss.org/as7"&gt;JBoss AS 7&lt;/a&gt;. I will post a lengthier review based on my experience reading it.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;Original posting available at &lt;a href="http://marxsoftware.blogspot.com/"&gt;http://marxsoftware.blogspot.com/&lt;/a&gt; (Inspired by Actual Events)&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6517450204508339514-9221837748482857529?l=marxsoftware.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InspiredByActualEvents/~4/jB3ZUM2VEok" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6517450204508339514&amp;postID=9221837748482857529" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/9221837748482857529?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/9221837748482857529?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InspiredByActualEvents/~3/jB3ZUM2VEok/first-impressions-of-book-jboss-as-7.html" title="First Impressions of Book 'JBoss AS 7 Configuration, Deployment and Administration'" /><author><name>Dustin</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://marxsoftware.blogspot.com/2012/01/first-impressions-of-book-jboss-as-7.html</feedburner:origLink></entry></feed>

