////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //PIMS: Personal Invstment Management System //Class : Error //This class is basically used to display any errors for the user. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Error extends JFrame implements ActionListener{ private String message; private Container cp; private Button ok; public Error(String str){ super("Error"); message="Error Message: "+str; cp =getContentPane(); cp.setLayout(new FlowLayout()); ok = new Button("Ok"); ok.addActionListener(this); Label l=new Label(message); l.setFont(new Font("Symbol",Font.BOLD,13)); cp.add(l); Label l1=new Label(" "); cp.add(l1); cp.add(ok); setSize(550,80); setLocation(120,150); setTitle("Error"); setVisible(true); } public void actionPerformed(ActionEvent ae){ if(ae.getActionCommand().equals("Ok")) setVisible(false); } }