[英]Can I get the name of the class and method within which the current thread was spawned?
[英]How can I get the name of the current thread?
標題說明了一切。 在Java應用程序中,如何可靠地獲取當前正在運行的線程的名稱?
另外,如果我在EDT中啟動應用程序(使用SwingUtilities.invokeLater()
),並且從不明確啟動其他線程-整個程序將保留在EDT中-對嗎?
嘗試
Thread.currentThread().getName()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.