Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CoursePanel extends JPanel {
- public CoursePanel() {
- int num = Run.corecoursenum + Run.eleccoursenum;
- JButton button[]=new JButton[num];
- int j = num % 4;
- int k = num / 4;
- if(j == 0){
- j++;
- }
- if(k == 0){
- k++;
- }
- setBackground(Color.white);
- int count = 0;
- while(num < count){
- String code =Run.getFacade().getAllCourses()[count].getCode();
- String title = Run.getFacade().getAllCourses()[count].getTitle();
- int credit = Run.getFacade().getAllCourses()[count].getCreditPoints();
- String type = Run.getFacade().getAllCourses()[count].getClass().toString();
- button[num] = new JButton (" Code"+ code + " Title:" + title + " Credit:" +credit + " Prereqs: none");
- count ++;
- }
- setLayout(new GridLayout(j, k));
- count = 0;
- while(num < count){
- add(button[count]);
- count ++;
- }
- }
- }
Add Comment
Please, Sign In to add comment