swing integration for a noob
im having difficulty in integrating my test code in swing kindly help me
here's the testBook class code
import java.util.Scanner;
publicclass testBook
{
private String courseName;// instance variable
public testBook (String name)//constructor
{
courseName = name;
}
publicvoid setCourseName(String name)
{
courseName = name;
}
public String getCourseName()
{
return courseName;
}
publicvoid displayMessage()
{
System.out.printf("welcome to the gradeook for \n%s\n\n",
getCourseName());
}
publicvoid getAverage()
{
Scanner input =new Scanner(System.in);
int grade;
int total;
int gradeCounter;
int average;
total = 0;
gradeCounter = 1;
while(gradeCounter<=10)
{
System.out.print("Enter the grade: ");
grade = input.nextInt();
total = total + grade;
gradeCounter = gradeCounter + 1;
}
average = total /10;
System.out.printf("\nthe total of grades is: %d\n",
total);
System.out.printf("the average is %d \n\n",average);
}
}
here's the main testbook2 class code
publicclass testbook2
{
publicstaticvoid main(String[] args)
{
testBook mytestBook =new testBook("CS101 java programming!");
mytestBook.displayMessage();
mytestBook.getAverage();
}
}

