-2
"확인"또는 "취소"를 클릭하면 닫힙니다. 어떤 코드를 추가해야합니까?JOptionPane 닫기
rightbutton = new JButton("Right.");
add(rightbutton);
rightbutton.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event){
//what do we want to happen when we
//click the button
final ImageIcon icon = new ImageIcon("C:\\Users\\Scr3am\\Desktop\\paypal.jpg");
JOptionPane.showOptionDialog(null,
"Congratulations, you clicked the button.",
"Congrats", JOptionPane.DEFAULT_OPTION,
JOptionPane.INFORMATION_MESSAGE, null,
new Object[] { panel }, icon);
아닌 다운 유권자하지만, 더 나은 도움을 생성하고 [최소한의 예제 프로그램]을 게시 고려 (http://stackoverflow.com/help/mcve). 자세한 내용은 링크를 확인하십시오. –
[이전 질문] (http://stackoverflow.com/questions/22186026/imageicon-help-close-a-joptionpane)의 답을 따르지 않았습니다. 당신의 주장은 여전히 틀리다. –
@ peeskillet의 정보와 당신의 대답이 부족해, 이제 나는 유권자 다. –