Question
1) develop the object class then display its assigned values from the main method of the main class using the below method class Car {
1) develop the object class then display its assigned values from the main method of the main class using the below method
classCar
{
add content and comments
publicstaticString accelerate()
{
returnmotion;
}
}
publicclassCarObject
{
publicstaticvoidmain(String[] args)
{
add content and comments
}
}
2) develop the GUI with a push button event.Use a JTextArea to display which button was selected using the below template.
importjavax.swing.*;
importjava.awt.*;
importjava.awt.event.*;
classActionsextendsJFrameimplementsActionListener
{
Create the components (textarea and buttons)
publicActions()
{
create the window (include a close operation)
create the container (include FlowLayout)
add the event listeners (button.addActionListener)
add the components
}
publicvoidactionPerformed(ActionEvent event)
{
add the event handler( if statements and event.getSource should be used here)
}
publicstaticvoidmain (String[] args)
{ Actions eg =newActions(); }
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started