Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Student Grade Book Application Keep track of students (with a student class that has their name, average, and scores) in a class and their grades.

Student Grade Book Application Keep track of students (with a student class that has their name, average, and scores) in a class and their grades. Assign their scores on tests and assignments to the students and figure out their average and grade for the class.

I need to use the graphics component of java and am currently unsure of how to start

what i've done so far is below

though I believe that it is utter trash

import java.awt.BorderLayout;

import java.awt.GridLayout;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.ButtonGroup;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JPanel;

import javax.swing.JRadioButton;

import javax.swing.JTextArea;

import javax.swing.JTextField;

import javax.swing.border.Border;

import javax.swing.border.EtchedBorder;

import javax.swing.border.TitledBorder;

public class GradeBookDisplay extends JFrame{

private JRadioButton test;

private JRadioButton assignment;

private ActionListener listener;

JTextField scoreOutOf = new JTextField();

JTextField studentScore = new JTextField();

public GradeBookDisplay(){

class ButtonListener implements ActionListener{

public void actionPerformed(ActionEvent e) {

setNewAverage();

}

}

listener = new ButtonListener();

createControlPanel();

}

//Allows teacher to set the inputed score as a Test or Assignment

public JPanel testOrAssignment(){

test = new JRadioButton("Test");

test.addActionListener(listener);

assignment = new JRadioButton("Assignment");

test.addActionListener(listener);

ButtonGroup group = new ButtonGroup();

group.add(test);

group.add(assignment);

JPanel panelTorA = new JPanel();

panelTorA.add(test);

panelTorA.add(assignment);

panelTorA.setBorder( new TitledBorder(new EtchedBorder(), "Test or Assignment?"));

return panelTorA;

}

public void createControlPanel(){

JPanel scoreType = testOrAssignment();

JPanel controlPanel = new JPanel();

controlPanel.setLayout(new GridLayout(1,1));

scoreOutOf.setBorder( new TitledBorder(new EtchedBorder(), "Out of how many?"));

studentScore.setBorder( new TitledBorder(new EtchedBorder(), "Student Score:"));

controlPanel.add(scoreType);

controlPanel.add(scoreOutOf);

controlPanel.add(studentScore);

add(controlPanel, BorderLayout.NORTH);

int ROWS = 10;

int COLUMNS = 20;

JTextArea textArea = new JTextArea(ROWS, COLUMNS);

add(textArea, BorderLayout.CENTER);

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic 4 Ole Database And Controls Superbible

Authors: Michael Hatmaker, C. Woody Butler, Ibrahim Malluf, Bill Potter

1st Edition

1571690077, 978-1571690074

More Books

Students also viewed these Databases questions