2016-04-25 8 views
0

メソッドを私のメインクラスのJOptionPane にコールしたいと思います。 具体的な方法はありますか?JOptionPaneにメソッドを追加する方法

Dictionary word1 = new Dictionary(null); 
CardCatalog catalog = new CardCatalog(); 

final ImageIcon welcome = new ImageIcon("welcome.jpg"); 
JOptionPane.showMessageDialog (null,"","WELCOME TO FLASH CARD",JOptionPane.INFORMATION_MESSAGE,welcome); 

答えて

0

使用などのshowmessage方法この

JOptionPane.showMessageDialog(frame, Myclass.dosomethign()); 

が、showmessageメソッドは2番目のパラメータとして文字列を取るので、メソッドの戻り値の型が文字列であることを確認してください

関連する問題