Correct the errors


Correct the errors
import java.awt.GridLayout;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class moviegenres extends JFrame implements ActionListener {
//data members
JLabel lblGenre;
JComboBox cbxGenre;
JLabel lblName;
JTextField txfName;
JLabel lblblank1;
JButton btnSaveMovie;
JLabel lblRegistered;
JComboBox cbxRegistered;
JLabel lblBlank2;
JButton btnRemove;
moviegenres(){
super("Genres") ;
//initialize data members
lblGenre = new JLabel("Genre");
cbxGenre = new JComboBox();
lblName = new JLabel ("Name");
txfName = new JTextField (20);
lblblank1 = new JLabel();
btnSaveMovie = new JButton("Save Movie");
lblRegistered = new JLabel ("Registered");
cbxRegistered = new JComboBox ();
lblBlank2 =new JLabel ();
btnRemove = new JButton ("Remove Movie");
//set frame
setLayout (new GridLayout(0,2));
add(lblGenre);
add(cbxGenre);
add(lblName);
add(txfName);
add(lblblank1);
add(btnSaveMovie);
add(lblRegistered);
add(cbxRegistered);
add(lblBlank2);
add(btnRemove);
//display frame
pack();
setVisible (true);
}//close constructor
public static void main (String []args){
moviegenres = new moviegenres();
}
public void moviegenres actionPerformed (ActionEvent e){
if(e.getSource().equals(btnSave)){
txtName.setText("You need to save");
}
}

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Correct the errors
Reference No:- TGS098706

Expected delivery within 24 Hours