Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

-fx-border-style and -fx-border-insets

Kishori SharanJan 3 2013 — edited Jan 3 2013
Hello,
I am having trouble understanding the effects of -fx-border-insets and -fx-border-style properties as outlined in the document:

http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#shape

Suppose I create a Pane:
Pane pane = new Pane();
pane.setPrefSize(200, 200); 
Now, I apply the following style to the Pane.
.my-pane {    
	-fx-border-color: red, black;
	-fx-border-width: 10, 10;
	-fx-border-radius: 0, 0;
	-fx-border-insets: 0, 10;
	-fx-border-style: solid inside, dotted outside;
}
The first border is at 0px inset and the second one is at 10px. The first one is inside and the second one is outside. Both are 10px in width. I am expecting them to overlap completely. However, they overlap only 50%.

I played with other border style such as centered and inside and I didn't get the expected results, as well.

My understanding is that inset 0px, width 10px, style inside will be drawn the same as inset 10px, width 10px, style outside.

Can someone enlighten me on the relationship between the border insets and styles?

Thanks
Kishori
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 31 2013
Added on Jan 3 2013
2 comments
2,654 views