public PaymentDialog(Member member, ClassType ct,String message,int flag) {
		messageTextArea.setText(message);
		globalMember = member;
		globalClassType = ct;
		globalFlag = flag;
		makePaymentButton = new JButton("Make Payment");
		makePaymentButton.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent arg0) {
				Common.makePayment(paymentTypeList.getSelectedValue(),
						globalMember, (Date) utilDateModel.getValue(),
						getPaymentAmount());
				updatePaymentStatus(globalMember, globalClassType);
				dispose();
				new PaymentDialog(globalMember,globalClassType,"Payment made for "
						+ globalMember.getName()
						+ "\n of "
						+ getPaymentAmount()
						+ " for "
						+ paymentTypeList.getSelectedValue()
								.getPaymentTypeName() + "\n up to date: "
						+ ((Date) utilDateModel.getValue()).toString(),globalFlag);
			}

		});
		makePaymentButton.setEnabled(false);
		exitButton = new JButton("Exit");
		exitButton.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				dispose();
				if(globalFlag==0) new MemberCheckInInterface(globalClassType);
			}
		});
		BufferedImage tkdIcon = CommonUI.getTkdIcon();
		BufferedImage skyIcon = CommonUI.getSkyIcon();
		BufferedImage kickIcon = CommonUI.getKickIcon();

		Image img = null;
		switch (ct) {
		case TAEKWONDO:
			img = new ImageIcon(tkdIcon).getImage();
			break;
		case SKYBOXING:
			img = new ImageIcon(skyIcon).getImage();
			break;
		case KICKBOXING:
			img = new ImageIcon(kickIcon).getImage();
			break;
		case OTHER:
			img = new ImageIcon(tkdIcon).getImage();
		default:
			img = new ImageIcon(tkdIcon).getImage();
		}

		setIconImage(img);
		this.setTitle("Enter Payment for " + member.getName());

		utilDateModel.addChangeListener(new ChangeListener() {

			@Override
			public void stateChanged(ChangeEvent arg0) {
				System.out.println("DateModel changed");
				setDateSelected();
				if (paymentAmountSelected && dateSelected) {
					makePaymentButton.setEnabled(true);
				}
			}
		});
		panel.add(paymentToPanel, BorderLayout.CENTER);

		paymentTypeList.setListData(Common.getPaymentTypes(ct).toArray(
				new PaymentType[1]));
		paymentTypeList.addListSelectionListener(new ListSelectionListener() {

			@Override
			public void valueChanged(ListSelectionEvent arg0) {
				JList<PaymentType> tempList = (JList<PaymentType>) arg0
						.getSource();
				PaymentType pt = tempList.getSelectedValue();
				paymentAmountTextField.setText(String.format("%9.2f",
						pt.getPaymentAmount()));
				setPaymentAmountFieldSelected();
				if (paymentAmountSelected && dateSelected) {
					makePaymentButton.setEnabled(true);
				}
			}
		});
		listPanel.add(paymentTypeList);
		panel.add(listPanel, BorderLayout.WEST);

		paymentAmountPanel.add(paymentAmountLabel);
		paymentAmountPanel.add(paymentAmountTextField);
		buttonPanel.add(paymentAmountPanel, BorderLayout.NORTH);

		buttonPanel.add(makePaymentButton, BorderLayout.WEST);
		buttonPanel.add(exitButton, BorderLayout.SOUTH);
		panel.add(buttonPanel, BorderLayout.SOUTH);

		paymentStatusPanel.add(paymentStatusTextArea, BorderLayout.NORTH);
		paymentStatusPanel.add(messageTextArea, BorderLayout.SOUTH);
		updatePaymentStatus(member, ct);
		panel.add(paymentStatusPanel, BorderLayout.EAST);

		this.getContentPane().add(panel);
		this.setSize(CommonUI.FULLSCREEN);
		this.setVisible(true);
	}