'Swing'에 해당되는 글 1건
- 2008/01/30 Swing - JOptionPane
--------- MessageDialog 예제 -----------
JOptionPane.showMessageDialog(DialogTest.this, "텍스트창", "알림", JOptionPane.INFORMATION_MESSAGE);
--------- ConfirmDialog 예제 -----------
int result;
result = JOptionPane.showConfirmDialog
(DialogTest.this, "계속할래?", "질문", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
System.out.println("반환값 : " + result);
switch(result){
case JOptionPane.OK_OPTION:
msg.setText("계속합니다.");
break;
case JOptionPane.NO_OPTION:
msg.setText("그만");
break;
case JOptionPane.CANCEL_OPTION:
msg.setText("취소");
break;
}
JOptionPane.showMessageDialog(DialogTest.this, "텍스트창", "알림", JOptionPane.INFORMATION_MESSAGE);
--------- ConfirmDialog 예제 -----------
int result;
result = JOptionPane.showConfirmDialog
(DialogTest.this, "계속할래?", "질문", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
System.out.println("반환값 : " + result);
switch(result){
case JOptionPane.OK_OPTION:
msg.setText("계속합니다.");
break;
case JOptionPane.NO_OPTION:
msg.setText("그만");
break;
case JOptionPane.CANCEL_OPTION:
msg.setText("취소");
break;
}



Prev
Rss Feed