I am trying to show tool tip on MouseEnter event on button but it's not showing. I don't understand whats wrong with my code.
Here is my fxml file in which i use button and add MouseEnter Event.
<ToolBar fx:id="logViewerToolBar" layoutX="66.0" layoutY="9.0" opacity="1.0" prefWidth="148.0">
<items>
<Button id="loadlogearlierbtn" fx:id="loadLogEarlierBtn" mnemonicParsing="false" mouseTransparent="true" onMouseEntered="#loadLogEarlierMouseEntered" onMouseExited="#loadLogEarlierMouseExited" prefWidth="35.0" styleClass="imgbtn" text="">
<stylesheets>
<URL value="@main.css" />
</stylesheets>
</Button>
<Button id="loadlogtadaybtn" fx:id="loadLogTodayBtn" mnemonicParsing="false" onMouseEntered="#loadLogTodayMouseEntered" onMouseExited="#loadLogTodayMouseExited" prefWidth="35.0" styleClass="imgbtn" text="">
<stylesheets>
<URL value="@main.css" />
</stylesheets>
</Button>
<Button id="searchlogbtn" fx:id="btnFind" mnemonicParsing="false" onMouseEntered="#findLogMouseEntered" onMouseExited="#findLogMouseExited" prefWidth="35.0" styleClass="imgbtn" text="">
<stylesheets>
<URL value="@main.css" />
</stylesheets>
</Button>
</items>
</ToolBar>
Here is my controller class.
@FXML
public void findLogMouseEntered(MouseEvent event)
{
btnFind.setTooltip(new Tooltip("Search field value in to entire log"));
}
But it's still not showing tooltips. And definitely, This is really easy question but i newbie on javaFx.
I also link button like
@FXML
private Button loadLogEarlierBtn,loadLogTodayBtn,btnFind;
Even following way not working.
<Button id="searchlogbtn" fx:id="btnFind" mnemonicParsing="false" prefWidth="35.0" styleClass="imgbtn" text="">
<tooltip>
<Tooltip text="Search field value in to entire log"/>
</tooltip>
<stylesheets>
<URL value="@main.css" />
</stylesheets>
</Button>
Please give me hint or reference.
not really sure but i think adding the
title="here goes the title"
should do the trick.hope this helps