diff --git a/src/guiesempio1/GUIEsempio1.java b/src/guiesempio1/GUIEsempio1.java deleted file mode 100644 index 202145c..0000000 --- a/src/guiesempio1/GUIEsempio1.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license - * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template - */ -package guiesempio1; - -import java.util.InputMismatchException; -import java.util.Scanner; - -/** - * - * @author Verde - */ -public class GUIEsempio1 { - - /** - * @param args the command line arguments - */ - - static Scanner sc = new Scanner(System.in); - static final String ERRORE_GENERICO = "Errore: opzione non valida."; - - public static void main(String[] args) { - int scelta = -1; - - do { - System.out.println("Scegliere un'opzione:"); - System.out.println("1. "); - System.out.println("2. "); - System.out.println("3. "); - System.out.println("0. Esci"); - System.out.print("Opzione: "); - - try { - scelta = sc.nextInt(); - sc.nextLine(); - - switch (scelta) { - case 0: - break; - case 1: - - pausa(); - break; - case 2: - - pausa(); - break; - case 3: - - pausa(); - break; - default: - System.out.println(ERRORE_GENERICO); - pausa(); - break; - } - } - catch (InputMismatchException _) { - System.out.println(ERRORE_GENERICO); - pausa(); - } - } while (scelta != 0); - } - - public static void pausa() { - System.out.println("Premere un tasto per continuare. . ."); - sc.nextLine(); - } -} diff --git a/src/guiesempio1/PrimoEsempio.form b/src/guiesempio1/PrimoEsempio.form new file mode 100644 index 0000000..b606cd5 --- /dev/null +++ b/src/guiesempio1/PrimoEsempio.form @@ -0,0 +1,35 @@ + + +
diff --git a/src/guiesempio1/PrimoEsempio.java b/src/guiesempio1/PrimoEsempio.java new file mode 100644 index 0000000..25cdb99 --- /dev/null +++ b/src/guiesempio1/PrimoEsempio.java @@ -0,0 +1,74 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template + */ +package guiesempio1; + +/** + * + * @author Verde + */ +public class PrimoEsempio extends javax.swing.JFrame { + + private static final java.util.logging.Logger logger = java.util.logging.Logger.getLogger(PrimoEsempio.class.getName()); + + /** + * Creates new form PrimoEsempio + */ + public PrimoEsempio() { + initComponents(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + //