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.in);        

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

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

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 :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.