How to add an icon to the Tab control in FXML?


Question

I'm using javafx 2.0. I want to add an icon to the Tab in fxml:

example:

     <TabPane>
         <tabs>
            <Tab text="abc" >
            </Tab> 
         </tabs>
     </TabPane>
1
2
3/15/2012 6:19:12 PM

Accepted Answer

I found a solution:

<Tab> 
    <graphic>
        <ImageView>
            <image>
                    <Image url="@image.png"/>
            </image>
        </ImageView>
    </graphic>
    <content>
        ...
    </content>
</Tab> 
5
3/29/2012 5:59:43 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon