Sometimes I need to write a simple Java console applications and menu look:do {    System.out.println(please select menu item);    System.out.println(1-create, 2-remove, 3 - rename);    int select;    Scanner scanner = new Scanner(System.in);    select = scanner.nextInt();    switch (select) {        case 1:            System.out.println(please select menu item);            System.out.println(1-image, 2-txt);            select = scanner.nextInt();            if (select == 1) fileHolder.create(image);            else if (select == 2) fileHolder.create(image);            else System.out.println(invalid menu item);            break;        case 2:            System.out.println(please select menu item);            System.out.println(1-file from pc1, 2-file from pc2, 3-file from pc3);            select = scanner.nextInt();            if (select == 1) fileHolder.removeFile(pc1);            else if (select == 2) fileHolder.removeFile(pc2);            else if (select == 3) fileHolder.removeFile(pc3);            else System.out.println(invalid menu item);            break;        case 3:            System.out.println(please type new name);            String newName = scanner.next();            fileHolder.rename(newName);            break;    }} while (select != 4);But I believe that it is not the best choice. I believe that I should use any pattern to improve my code. By description - the state pattern is applicable for my situation but I have no idea how I can use this in this situation. The menu should show the respective menu according to the internal state.
Console application menu
java;design patterns;state