我想添加一個ImageIcon到JOptionPane顯示時,但當我運行JOptionPane顯示,但圖標不...這段代碼有什麼問題?
注:參數「this」是框架和santorini是我做的遊戲並且在遊戲結束時宣佈獲勝者應該顯示JOptionPane ......那麼有什麼幫助?
if (santorini.isGameOver()) {
JOptionPane.showMessageDialog(
this,
"Winner is " + santorini.getWinner().getName(),
"Winner is",
JOptionPane.INFORMATION_MESSAGE,
new ImageIcon ("pyramid2nlayer 1.png")
);
}
對於初學者來說,它的縮進類似於Kwazimodo。 –
你有答案嗎?讓我們知道並將其標記爲已解決。 – Tejas