001 package market.stdform; 002 003 import javax.swing.JScrollPane; 004 import javax.swing.JTextArea; 005 006 import market.Conversions; 007 import sale.FormSheet; 008 import sale.FormSheetContentCreator; 009 import data.Value; 010 011 /** 012 * This FormSheet displays how much the customer has to pay for his/her current selection. 013 */ 014 public class FSCustomerConfirmSelection extends FormSheet{ 015 016 /** 017 * @param amount the {@link Value} the customer has to pay 018 */ 019 public FSCustomerConfirmSelection(final Value amount){ 020 super("Auswahl bestätigen", null); 021 FormSheetContentCreator fscc = new FormSheetContentCreator(){ 022 protected void createFormSheetContent(FormSheet fs) { 023 String text = new String("Sie haben Artikel im Wert von: "+ 024 Conversions.valueToCurrency(amount)+" Euro ausgewählt.\n"+ 025 "Mit Kaufen können Sie die Auswahl bestätigen!\n"+ 026 "Mit Zurück können Sie die Auswahl korrigieren!\n"); 027 JTextArea jta = new JTextArea (text); 028 jta.setEditable (false); 029 fs.setComponent (new JScrollPane(jta)); 030 031 fs.removeAllButtons(); 032 fs.addButton("Kaufen",ButtonIDs.BTN_BUY,null); 033 fs.addButton("Zurück",ButtonIDs.BTN_BACK,null); 034 } 035 }; 036 this.addContentCreator(fscc); 037 } 038 }