【发布时间】:2018-10-09 08:38:51
【问题描述】:
我目前停留在使用超链接类型在 Javafx 中浏览网站。
我需要创建一个具有指定名称的超链接类型。当我点击链接时,应该会弹出一个网站。
我的代码是:
@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()));
}
上面的代码正确显示带有文本item.getPrice() 的超链接。它是可点击的,但没有任何反应。我该怎么做才能浏览网站?
【问题讨论】: