Main.java
public void actionPerformed(ActionEvent e) {
			setVisible(false);
			setSize(270, 140);
			setTitle(e.getActionCommand());

			Label msg = new Label();
			msg.setForeground(Color.RED);
			Label label = new Label("Name");
			SpringLayout layout = new SpringLayout();
			panel = new Panel(layout);
			TextField nameF = new TextField();

			Button btnOK = new Button("OK");
			Button btnExit = new Button("Exit");

			btnOK.addActionListener(new RemOK(nameF, msg));
			btnExit.addActionListener(new Exit());

			panel.add(msg);
			panel.add(label);
			panel.add(nameF);
			panel.add(btnOK);
			panel.add(btnExit);

			layout.putConstraint(SpringLayout.WEST, msg, -50, SpringLayout.HORIZONTAL_CENTER, panel);
			layout.putConstraint(SpringLayout.EAST, msg, 50, SpringLayout.HORIZONTAL_CENTER, panel);
			layout.putConstraint(SpringLayout.NORTH, msg, 10, SpringLayout.NORTH, panel);
			layout.putConstraint(SpringLayout.WEST, label, 10, SpringLayout.WEST, panel);
			layout.putConstraint(SpringLayout.SOUTH, label, 0, SpringLayout.SOUTH, nameF);
			layout.putConstraint(SpringLayout.NORTH, nameF, 10, SpringLayout.SOUTH, msg);
			layout.putConstraint(SpringLayout.WEST, nameF, 10, SpringLayout.EAST, label);
			layout.putConstraint(SpringLayout.EAST, nameF, -10, SpringLayout.EAST, panel);
			layout.putConstraint(SpringLayout.WEST, btnOK, -50, SpringLayout.HORIZONTAL_CENTER, panel);
			layout.putConstraint(SpringLayout.NORTH, btnOK, 10, SpringLayout.SOUTH, nameF);
			layout.putConstraint(SpringLayout.WEST, btnExit, 10, SpringLayout.EAST, btnOK);
			layout.putConstraint(SpringLayout.EAST, btnExit, 50, SpringLayout.HORIZONTAL_CENTER, panel);
			layout.putConstraint(SpringLayout.NORTH, btnExit, 0, SpringLayout.NORTH, btnOK);

			removeAll();
			add(panel);
			setLocationRelativeTo(null);
			validate();
			setVisible(true);
		}
// called when "Remove a person" button is pressed from main menu

called when "Remove a person" button is pressed from main menu
called when " Remove a person " button is pressed from main menu
public void actionPerformed(ActionEvent e) {
			setVisible(false);
			setSize(270, 140);
			setTitle(e.getActionCommand());
			Label msg = new Label();
			msg.setForeground(Color.RED);
			Label label = new Label("Name");
			SpringLayout layout = new SpringLayout();
			panel = new Panel(layout);
			TextField nameF = new TextField();
			Button btnOK = new Button("OK");
			Button btnExit = new Button("Exit");
			btnOK.addActionListener(new RemOK(nameF, msg));
			btnExit.addActionListener(new Exit());
			panel.add(msg);
			panel.add(label);
			panel.add(nameF);
			panel.add(btnOK);
			panel.add(btnExit);
			layout.putConstraint(SpringLayout.WEST, msg, -50, SpringLayout.HORIZONTAL_CENTER, panel);
			layout.putConstraint(SpringLayout.EAST, msg, 50, SpringLayout.HORIZONTAL_CENTER, panel);
			layout.putConstraint(SpringLayout.NORTH, msg, 10, SpringLayout.NORTH, panel);
			layout.putConstraint(SpringLayout.WEST, label, 10, SpringLayout.WEST, panel);
			layout.putConstraint(SpringLayout.SOUTH, label, 0, SpringLayout.SOUTH, nameF);
			layout.putConstraint(SpringLayout.NORTH, nameF, 10, SpringLayout.SOUTH, msg);
			layout.putConstraint(SpringLayout.WEST, nameF, 10, SpringLayout.EAST, label);
			layout.putConstraint(SpringLayout.EAST, nameF, -10, SpringLayout.EAST, panel);
			layout.putConstraint(SpringLayout.WEST, btnOK, -50, SpringLayout.HORIZONTAL_CENTER, panel);
			layout.putConstraint(SpringLayout.NORTH, btnOK, 10, SpringLayout.SOUTH, nameF);
			layout.putConstraint(SpringLayout.WEST, btnExit, 10, SpringLayout.EAST, btnOK);
			layout.putConstraint(SpringLayout.EAST, btnExit, 50, SpringLayout.HORIZONTAL_CENTER, panel);
			layout.putConstraint(SpringLayout.NORTH, btnExit, 0, SpringLayout.NORTH, btnOK);
			removeAll();
			add(panel);
			setLocationRelativeTo(null);
			validate();
			setVisible(true);
		}
public void actionPerformed ( ActionEvent e ) { setVisible ( false ) ; setSize ( 270 , 140 ) ; setTitle ( e . getActionCommand ( ) ) ; Label msg = new Label ( ) ; msg . setForeground ( Color . RED ) ; Label label = new Label ( "Name" ) ; SpringLayout layout = new SpringLayout ( ) ; panel = new Panel ( layout ) ; TextField nameF = new TextField ( ) ; Button btnOK = new Button ( "OK" ) ; Button btnExit = new Button ( "Exit" ) ; btnOK . addActionListener ( new RemOK ( nameF , msg ) ) ; btnExit . addActionListener ( new Exit ( ) ) ; panel . add ( msg ) ; panel . add ( label ) ; panel . add ( nameF ) ; panel . add ( btnOK ) ; panel . add ( btnExit ) ; layout . putConstraint ( SpringLayout . WEST , msg , - 50 , SpringLayout . HORIZONTAL_CENTER , panel ) ; layout . putConstraint ( SpringLayout . EAST , msg , 50 , SpringLayout . HORIZONTAL_CENTER , panel ) ; layout . putConstraint ( SpringLayout . NORTH , msg , 10 , SpringLayout . NORTH , panel ) ; layout . putConstraint ( SpringLayout . WEST , label , 10 , SpringLayout . WEST , panel ) ; layout . putConstraint ( SpringLayout . SOUTH , label , 0 , SpringLayout . SOUTH , nameF ) ; layout . putConstraint ( SpringLayout . NORTH , nameF , 10 , SpringLayout . SOUTH , msg ) ; layout . putConstraint ( SpringLayout . WEST , nameF , 10 , SpringLayout . EAST , label ) ; layout . putConstraint ( SpringLayout . EAST , nameF , - 10 , SpringLayout . EAST , panel ) ; layout . putConstraint ( SpringLayout . WEST , btnOK , - 50 , SpringLayout . HORIZONTAL_CENTER , panel ) ; layout . putConstraint ( SpringLayout . NORTH , btnOK , 10 , SpringLayout . SOUTH , nameF ) ; layout . putConstraint ( SpringLayout . WEST , btnExit , 10 , SpringLayout . EAST , btnOK ) ; layout . putConstraint ( SpringLayout . EAST , btnExit , 50 , SpringLayout . HORIZONTAL_CENTER , panel ) ; layout . putConstraint ( SpringLayout . NORTH , btnExit , 0 , SpringLayout . NORTH , btnOK ) ; removeAll ( ) ; add ( panel ) ; setLocationRelativeTo ( null ) ; validate ( ) ; setVisible ( true ) ; }
called when "Remove a person" button is pressed from main menu
called when " Remove a person " button is pressed from main menu