Showing posts with label javafx. Show all posts
Showing posts with label javafx. Show all posts

Friday, July 1, 2011

javafx listview sometimes doesn't catch clicks

I had this form:

    def viewerWrapper = Group {
                content: [
                    viewerScroll,
                    contents
                ]
            }
    def viewerContent = [
                viewerWrapper,
                ... //other components


contents is VBox holding ListView.

In this configuration contents sometimes didn't catch mouse clicks. You had to click twice.

The solution is to move contents up from the Group:


    def viewerWrapper = Group {
                content: [
                    viewerScroll,
                ]
            }
    def viewerContent = [
                viewerWrapper,
                contents
                ... //other components


this will work perfectly

Friday, June 3, 2011

xshelfview in JFXtras-0.7rc2 and title changing

xshelfview has a bug - the title doesn't change while scrolling images. The workaround is to use your own label to display title:

var shelf : XShelfView = XShelfView {
   showText: false,
   ...
}
var title : Label = Label {
   text: bind shelf.imageNames[shelf.index] as String
   font: Font.font("SansSerif", FontWeight.BOLD, 14);
   effect: DropShadow {color: Color.WHITE, radius: 5, blurType: BlurType.ONE_PASS_BOX}
}

this label has the same style as original label. The only thing left is to place label into right place.