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();

}

}

[2967 byte] By [nemo666a] at [2007-11-27 10:47:10]
# 1

I had to sell my psychic powers to buy my hamster a new kidney. You'll just have to tell me what's wrong the old-fashioned way

georgemca at 2007-7-28 20:23:22 > top of Java-index,Java Essentials,Java Programming...