I am currently stuck in using Hyperlink type to browse a website in Javafx.
I am required to create a Hyperlink type with a designated name. When I click the link, a website should be popped up.
My code is:
@FXML
private Hyperlink labelMin;
...
public class Item{
...
public void getPrice();
public void getUrl(); //I can get the url in string form using this function.
}
...
if (item.getPrice() < min){
labelMin.setText(String.valueOf(item.getPrice()));
}
The above code correctly displays a hyperlink with text item.getPrice()
. It is clickable but nothing happens. What can I do in order to browse a website?