Click here to Skip to main content
15,887,434 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Layouts: the organization of graphical components inside a panel

Deliverables

app.java (initial application)
MainFrame.java (external JFrame)
ControlPanel, a Java class for the panel that will contain two other panels, using a layout.
TopPanel, a Java class for the Panel that will display the group’s name and group's average GPA
CenterPanel, a Java class for the Panel that will display names and semester GPAs of the 4 students in a group.
group.java and student.java (a working version from previous labs, might need updates, see important #2 below).

Students should apply consistent indenting in all submissions. This can be done via the NetBeans Source menu.

Contents

You can start with this NetBeans project.
You will create 3 panels and one group object. One panel contains two other panels.
On a top panel you will display the group's name and average GPA.
The center panel will contain 4 buttons displaying the group 4 students name and GPA.


Important - #1 - The single group object

You will create only one group object g1 in this assignment.

There will be only one statement group g1 = new group(...); in the whole application.

Since two panels need to be used, g1 will need to be created somewhere and then pass the object g1 as a parameter to other classes.

Important - #2 - GPA Calculation

Your previous group/student solution might be working this way; otherwise, you will need to updated it.

Because GPA is calculated randomly in student, depending how you calculate it there is a chance that the average group GPA will not match with the displayed sum of each student's GPA.

In order to fix this, you need to:

in group:

semesterGPA is calculated using the GPA attribute in student, not the semesterGPA() method in student

in student:

it needs GPA as an attribute

the attribute GPA is calculated in the constructor, when the student is created, calling the semesterGPA() random method

the semesterGPA() method, whenever it is called, updates the value of the attribute GPA.


What I have tried:

i dont have any experience with java GUI so i dont know how to solve this problem.java
Posted
Updated 12-Oct-18 10:09am

Sorry, no one here is going to write your assignment for you. See Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)[^].
 
Share this answer
 
v2
Quote:
i dont have any experience with java GUI so i dont know how to solve this problem.java

And you want us to do it for you so that you will never learn and never get experience. Trial and error is how you will learn.

HomeWork problems are simplified versions of the kind of problems you will have to solve in real life, their purpose is learning and practicing.
We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
Any failure of you will help you to learn what works and what don't, it is called 'trial and error' learning.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.

As programmer, your job is to create algorithms that solve specific problems and you can't rely on someone else to eternally do it for you, so there is a time where you will have to learn how to. And the sooner, the better.
When you just ask for the solution, it is like trying to learn to drive a car by having someone else training.
Creating an algorithm is basically finding the maths and make necessary adaptation to fit your actual problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900