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

			Font font = new Font("Lucida Console", Font.PLAIN, 12);
			SpringLayout layout = new SpringLayout();
			ArrayList<Entry> entries = mailList.getList();
			panel = new Panel(layout);

			JTextField header = new JTextField(String.format("%-25s%-20s%15s","Name","Address","Phone"));
			header.setColumns(60);
			header.setEditable(false);
			header.setFont(font);

			String text = "";
			for(Entry entCur:entries) {
				text += String.format("%-25.25s%-20.20s%15.15s\n",entCur.getName(), entCur.getAddr(), entCur.getPhone());
			}
			JTextArea entryText = new JTextArea(text); // vanilla TextArea refused to let me change font... bizarre
			entryText.setEditable(false);
			entryText.setColumns(60);
			entryText.setFont(font);

			JScrollPane scrollPane = new JScrollPane(entryText);
			scrollPane.setColumnHeaderView(header);
			scrollPane.setFont(font);
			panel.add(scrollPane);

			Button btnExit = new Button("OK");
			btnExit.addActionListener(new Exit());
			panel.add(btnExit);

			layout.putConstraint(SpringLayout.NORTH, scrollPane, 10, SpringLayout.NORTH, panel);
			layout.putConstraint(SpringLayout.WEST, scrollPane, 10, SpringLayout.WEST, panel);
			layout.putConstraint(SpringLayout.EAST, scrollPane, -10, SpringLayout.EAST, panel);
			layout.putConstraint(SpringLayout.SOUTH, scrollPane, -10, SpringLayout.NORTH, btnExit);
			layout.putConstraint(SpringLayout.WEST, btnExit, -16, SpringLayout.HORIZONTAL_CENTER, panel);
			layout.putConstraint(SpringLayout.SOUTH, btnExit, -10, SpringLayout.SOUTH, panel);

			removeAll();
			add(panel);
			setLocationRelativeTo(null);
			validate();
			setVisible(true);
		}
// called when "Display the list" button is pressed from main menu

called when "Display the list" button is pressed from main menu
called when " Display the list " button is pressed from main menu
public void actionPerformed(ActionEvent e) {
			setVisible(false);
			setSize(465, 250);
			setTitle(e.getActionCommand());
			Font font = new Font("Lucida Console", Font.PLAIN, 12);
			SpringLayout layout = new SpringLayout();
			ArrayList<Entry> entries = mailList.getList();
			panel = new Panel(layout);
			JTextField header = new JTextField(String.format("%-25s%-20s%15s","Name","Address","Phone"));
			header.setColumns(60);
			header.setEditable(false);
			header.setFont(font);
			String text = "";
			for(Entry entCur:entries) {
				text += String.format("%-25.25s%-20.20s%15.15s\n",entCur.getName(), entCur.getAddr(), entCur.getPhone());
			}
			JTextArea entryText = new JTextArea(text); 
			entryText.setEditable(false);
			entryText.setColumns(60);
			entryText.setFont(font);
			JScrollPane scrollPane = new JScrollPane(entryText);
			scrollPane.setColumnHeaderView(header);
			scrollPane.setFont(font);
			panel.add(scrollPane);
			Button btnExit = new Button("OK");
			btnExit.addActionListener(new Exit());
			panel.add(btnExit);
			layout.putConstraint(SpringLayout.NORTH, scrollPane, 10, SpringLayout.NORTH, panel);
			layout.putConstraint(SpringLayout.WEST, scrollPane, 10, SpringLayout.WEST, panel);
			layout.putConstraint(SpringLayout.EAST, scrollPane, -10, SpringLayout.EAST, panel);
			layout.putConstraint(SpringLayout.SOUTH, scrollPane, -10, SpringLayout.NORTH, btnExit);
			layout.putConstraint(SpringLayout.WEST, btnExit, -16, SpringLayout.HORIZONTAL_CENTER, panel);
			layout.putConstraint(SpringLayout.SOUTH, btnExit, -10, SpringLayout.SOUTH, panel);
			removeAll();
			add(panel);
			setLocationRelativeTo(null);
			validate();
			setVisible(true);
		}
public void actionPerformed ( ActionEvent e ) { setVisible ( false ) ; setSize ( 465 , 250 ) ; setTitle ( e . getActionCommand ( ) ) ; Font font = new Font ( "Lucida Console" , Font . PLAIN , 12 ) ; SpringLayout layout = new SpringLayout ( ) ; ArrayList < Entry > entries = mailList . getList ( ) ; panel = new Panel ( layout ) ; JTextField header = new JTextField ( String . format ( "%-25s%-20s%15s" , "Name" , "Address" , "Phone" ) ) ; header . setColumns ( 60 ) ; header . setEditable ( false ) ; header . setFont ( font ) ; String text = "" ; for ( Entry entCur : entries ) { text += String . format ( "%-25.25s%-20.20s%15.15s\n" , entCur . getName ( ) , entCur . getAddr ( ) , entCur . getPhone ( ) ) ; } JTextArea entryText = new JTextArea ( text ) ; entryText . setEditable ( false ) ; entryText . setColumns ( 60 ) ; entryText . setFont ( font ) ; JScrollPane scrollPane = new JScrollPane ( entryText ) ; scrollPane . setColumnHeaderView ( header ) ; scrollPane . setFont ( font ) ; panel . add ( scrollPane ) ; Button btnExit = new Button ( "OK" ) ; btnExit . addActionListener ( new Exit ( ) ) ; panel . add ( btnExit ) ; layout . putConstraint ( SpringLayout . NORTH , scrollPane , 10 , SpringLayout . NORTH , panel ) ; layout . putConstraint ( SpringLayout . WEST , scrollPane , 10 , SpringLayout . WEST , panel ) ; layout . putConstraint ( SpringLayout . EAST , scrollPane , - 10 , SpringLayout . EAST , panel ) ; layout . putConstraint ( SpringLayout . SOUTH , scrollPane , - 10 , SpringLayout . NORTH , btnExit ) ; layout . putConstraint ( SpringLayout . WEST , btnExit , - 16 , SpringLayout . HORIZONTAL_CENTER , panel ) ; layout . putConstraint ( SpringLayout . SOUTH , btnExit , - 10 , SpringLayout . SOUTH , panel ) ; removeAll ( ) ; add ( panel ) ; setLocationRelativeTo ( null ) ; validate ( ) ; setVisible ( true ) ; }
called when "Display the list" button is pressed from main menu
called when " Display the list " button is pressed from main menu
// vanilla TextArea refused to let me change font... bizarre
