How do I turn the code below into a GUI using JFrame and JPanel? import java.util.Scanner; class
Fantastic news! We've Found the answer you've been seeking!
Question:
How do I turn the code below into a GUI using JFrame and JPanel?
import java.util.Scanner;
class Wk4 {
//A method for reverse
public static void reverseMethod(int number) {
if (number < 10) {
System.out.println(number);
return;
}
else {
System.out.print(number % 10);
//Method is calling itself: recursion
reverseMethod(number/10);
}
}
public static void main(String args[]) {
int num=0;
System.out.println("Input your number and press enter: ");
Scanner in = new Scanner(System.in);
num = in.nextInt();
System.out.print("Reverse of the input number is:");
reverseMethod(num);
System.out.println(); } }
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date: