2014-04-17 37 views
0

我的JFrame中有一個標籤。它的變量名是l_1001獲取JLabel的名稱

我想在輸出中得到這個變量名。我該怎麼做?

我試圖

System.out.print(l_1001.getName())

但輸出旋轉null

+0

@MarounMaroun http://stackoverflow.com/questions/744226/java-reflection-how-to-get-the-name-of-a-variable – MaVRoSCy

+0

@MaVRoSCy是的確的..我不是指反射。 。 – Maroun

回答