import java.awt.event.ActionListener;
import javax.swing.JFrame;
//This Java Program determines the weighted average
//of four test scores.
//import statements for the needed packages
public class Assign1 extends JFrame
{
//declare JLabel variables as reference to label components
//declare JTextField variables as reference to input/output text boxes
//declare JButton variables as reference to command buttons
//declare button handlers to handle click events of command buttons
//declare constants to hold the size of your windows
public Assign1()
{
// Create eight labels
//Create four textfields
//create Calculate Button
//Create Exit Button
//Set the title of the window
//Get the container
//Set the layout
//Place the components in the pane
//set the size of the window and display it
}
// class which defines the action when the Calculate button is pressed
private class CalculateButtonHandler implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
//place your code here
}
}
// class which defines the action when the Exit button is pressed
private class ExitButtonHandler implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
//place your code here
}
}
// main method which constructs this particular class
public static void main(String[] args)
{
//place your code here
}
}
caierhui
0
Newbie Poster
Recommended Answers
Jump to PostCode tags:
[code=JAVA] // paste code here
[/code]
Code looks terrible without them.
This looks like a cut and paste of the assignment specification that someone gave you. What seems to be the problem?
Jump to PostThe code gives you a guide. Start filling it in. Call the constructor from main. Do lines 12 - 35 and set up the GUI and display it. That gives you a start and requires no Action Listeners and no calculations and no need for any input. Ignore line 15 …
All 6 Replies
VernonDozier
2,218
Posting Expert
Featured Poster
caierhui
0
Newbie Poster
VernonDozier
2,218
Posting Expert
Featured Poster
love1969
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
love1969
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.