<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: More Struggling with JavaFX</title>
	<atom:link href="http://blog.alutam.com/2009/09/09/more-struggling-with-javafx/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.alutam.com/2009/09/09/more-struggling-with-javafx/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
	<description>Sharing useful tips from my &#34;weekend projects&#34;</description>
	<lastBuildDate>Sat, 21 Aug 2010 18:22:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: jckteg</title>
		<link>http://blog.alutam.com/2009/09/09/more-struggling-with-javafx/comment-page-1/#comment-122</link>
		<dc:creator>jckteg</dc:creator>
		<pubDate>Sun, 15 Nov 2009 02:53:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.alutam.com/?p=59#comment-122</guid>
		<description>Look at 
http://weblogs.java.net/blog/aim/archive/2009/09/10/javafx12-layout</description>
		<content:encoded><![CDATA[<p>Look at<br />
<a href="http://weblogs.java.net/blog/aim/archive/2009/09/10/javafx12-layout" rel="nofollow">http://weblogs.java.net/blog/aim/archive/2009/09/10/javafx12-layout</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jasper Potts</title>
		<link>http://blog.alutam.com/2009/09/09/more-struggling-with-javafx/comment-page-1/#comment-58</link>
		<dc:creator>Jasper Potts</dc:creator>
		<pubDate>Thu, 17 Sep 2009 11:09:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.alutam.com/?p=59#comment-58</guid>
		<description>It looks like a rectangle with stroke is reporting the wrong bounds which VBox is using. I will see if we can fix it. Here is a simple fix for now. Because strokes are centered on the shape they add 1px to the overall size so the -1s are needed to make the stroke inside the given size.

var rec1: Rectangle;
var stage: Stage = Stage {
    title: &quot;Rectangles&quot;
    width: 200
    height: 200
    scene: Scene {
        content: [
            rec1 = Rectangle {
                fill: Color.BLACK
                width: bind stage.scene.width
                height: 50
            }
            Rectangle {
                fill: Color.GRAY
                stroke: Color.BLACK
                y: bind rec1.height
                width: bind stage.scene.width - 1
                height: bind stage.scene.height - rec1.height -1
            }
        ]
    }
}

It is also recommended to move the width: 200 height:200 into the scene rather than stage as that will make the content area (Scene) 200x200 and make the stage 200x200 + any platform decorations, like the titlebar.</description>
		<content:encoded><![CDATA[<p>It looks like a rectangle with stroke is reporting the wrong bounds which VBox is using. I will see if we can fix it. Here is a simple fix for now. Because strokes are centered on the shape they add 1px to the overall size so the -1s are needed to make the stroke inside the given size.</p>
<p>var rec1: Rectangle;<br />
var stage: Stage = Stage {<br />
    title: &#8220;Rectangles&#8221;<br />
    width: 200<br />
    height: 200<br />
    scene: Scene {<br />
        content: [<br />
            rec1 = Rectangle {<br />
                fill: Color.BLACK<br />
                width: bind stage.scene.width<br />
                height: 50<br />
            }<br />
            Rectangle {<br />
                fill: Color.GRAY<br />
                stroke: Color.BLACK<br />
                y: bind rec1.height<br />
                width: bind stage.scene.width - 1<br />
                height: bind stage.scene.height - rec1.height -1<br />
            }<br />
        ]<br />
    }<br />
}</p>
<p>It is also recommended to move the width: 200 height:200 into the scene rather than stage as that will make the content area (Scene) 200&#215;200 and make the stage 200&#215;200 + any platform decorations, like the titlebar.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://blog.alutam.com/2009/09/09/more-struggling-with-javafx/comment-page-1/#comment-49</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Fri, 11 Sep 2009 07:32:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.alutam.com/?p=59#comment-49</guid>
		<description>Thanks Andy, good try! :) It still does not solve the issue though - the white strip is still there (not sure if it is platform specific - I am using MacOS). Anyway, my main point was - it feels something is not right when seemingly simple things take a lot of effort. When problems such as this one appear it is quite time consuming to debug and resolve. Maybe there are some tricks for how to identify and fix this type of problems efficiently? The NetBeans debugger currently does not seem to be usable for JavaFX, so right now I am debugging by printing out layoutBounds or pref. height/width etc. of objects in a response to certain events to see what&#039;s going on, then doing trial-error approach trying to fix it. Originally I was hoping I can be more productive with JavaFX than with plain Java when it comes to building UI.</description>
		<content:encoded><![CDATA[<p>Thanks Andy, good try! <img src='http://blog.alutam.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It still does not solve the issue though &#8211; the white strip is still there (not sure if it is platform specific &#8211; I am using MacOS). Anyway, my main point was &#8211; it feels something is not right when seemingly simple things take a lot of effort. When problems such as this one appear it is quite time consuming to debug and resolve. Maybe there are some tricks for how to identify and fix this type of problems efficiently? The NetBeans debugger currently does not seem to be usable for JavaFX, so right now I am debugging by printing out layoutBounds or pref. height/width etc. of objects in a response to certain events to see what&#8217;s going on, then doing trial-error approach trying to fix it. Originally I was hoping I can be more productive with JavaFX than with plain Java when it comes to building UI.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andy xie</title>
		<link>http://blog.alutam.com/2009/09/09/more-struggling-with-javafx/comment-page-1/#comment-47</link>
		<dc:creator>andy xie</dc:creator>
		<pubDate>Fri, 11 Sep 2009 02:27:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.alutam.com/?p=59#comment-47</guid>
		<description>var rec1: Rectangle;
var tmp1 = Rectangle { stroke: Color.BLACK };
var tmp2 = Rectangle { };
var gap = tmp1.layoutBounds.width-tmp2.layoutBounds.width;

var stage: Stage = Stage {
    title: &quot;Rectangles&quot;
    width: 200
    height: 200
    scene: Scene {
        content: [
            VBox {
                spacing: 0
                content: [
                    rec1 = Rectangle {
                        fill: Color.BLACK
                        width: bind stage.scene.width
                        height: 50
                    }
                    Rectangle {
                        fill: Color.GRAY
                        width: bind stage.scene.width - gap
                        height: bind stage.scene.height - rec1.layoutBounds.height - gap
                        stroke: Color.BLACK
                    }
                ]
            }
        ]
    }
}</description>
		<content:encoded><![CDATA[<p>var rec1: Rectangle;<br />
var tmp1 = Rectangle { stroke: Color.BLACK };<br />
var tmp2 = Rectangle { };<br />
var gap = tmp1.layoutBounds.width-tmp2.layoutBounds.width;</p>
<p>var stage: Stage = Stage {<br />
    title: &#8220;Rectangles&#8221;<br />
    width: 200<br />
    height: 200<br />
    scene: Scene {<br />
        content: [<br />
            VBox {<br />
                spacing: 0<br />
                content: [<br />
                    rec1 = Rectangle {<br />
                        fill: Color.BLACK<br />
                        width: bind stage.scene.width<br />
                        height: 50<br />
                    }<br />
                    Rectangle {<br />
                        fill: Color.GRAY<br />
                        width: bind stage.scene.width - gap<br />
                        height: bind stage.scene.height - rec1.layoutBounds.height - gap<br />
                        stroke: Color.BLACK<br />
                    }<br />
                ]<br />
            }<br />
        ]<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
