Add chapters 9-17 for the java book
This commit is contained in:
20
Java-Kompendium/kap11/Task1.java
Normal file
20
Java-Kompendium/kap11/Task1.java
Normal file
@@ -0,0 +1,20 @@
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
public class Task1 {
|
||||
public static void main(String[] arguments) {
|
||||
var result = JOptionPane.showConfirmDialog(null,
|
||||
"Bestätigen Sie die Eingabe", "Bestätigung", JOptionPane.YES_NO_CANCEL_OPTION);
|
||||
|
||||
switch (result) {
|
||||
case JOptionPane.YES_OPTION:
|
||||
JOptionPane.showMessageDialog(null, "Ja");
|
||||
break;
|
||||
case JOptionPane.NO_OPTION:
|
||||
JOptionPane.showMessageDialog(null, "Nein");
|
||||
break;
|
||||
case JOptionPane.CANCEL_OPTION:
|
||||
JOptionPane.showMessageDialog(null, "Abbrechen");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user