2014-12-05 113 views
-1

我想顯示像..我採取了一個字符串谷值=「D://應用程序/ /測試」 和此路徑必須作爲Link.if我點擊此這個窗口路徑將打開。如何做。請給我建議。如何使字符串作爲使用java的超鏈接

+0

http://stackoverflow.com/questions/7357969/how-to-use-java-code-to-open-windows-file-explorer-and -highlight-the-specified-f – 2014-12-05 10:48:44

回答

1

使用java.nio.file:

Paths.get("D://App//Test").toRealPath().toUri().toURL(); 
+0

你能給我一個完整的代碼嗎?.. @ fge – 2014-12-05 10:49:05

+0

呃?這是整個代碼 – fge 2014-12-05 10:51:51

+0

Paths是什麼?它在哪個包下? – 2014-12-05 10:54:01