How to show this loop inside a frame?

String R="Reserved";
String A="Available";
String name;
int option;
int roomNumber;
  int value=6;
String reserveRoom[] = new String[value];
Scanner in = new Scanner(;        

System.out.print("Enter your name:\n");
System.out.print("ROOM #.     STATUS\n");
        for(int i=1;i<value;i++) {

            System.out.println("   " +roomNumber + "\t    " +reserveRoom[i]);

I will give you some idea to start with. If you want to display the results in a frame using GUI coponents, go through JFrame of Swing component in Java. Your JFrame will show the interface where your code is run and show the results. Go through JList and JScrollPane to display the results.

If you want to display the results in a frame in a simple way, go through JOptionPane.showMessageDialog to show all the results. See here on StackOverflow on similar problem: Click Here. Good Luck :)