home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 14 / IOPROG_14.ISO / soft / sdkjava / sdkjava.exe / SDKJava.cab / Samples / AFC / LoanCalc / Src / WZValue.java < prev   
Encoding:
Java Source  |  1998-03-05  |  1.3 KB  |  55 lines

  1. //
  2. // (c) 1998 Microsoft Corporation.  All rights reserved.
  3. //
  4. import com.ms.ui.*;
  5. import com.ms.fx.*;
  6. import java.awt.Insets;
  7.  
  8. public class WZValue extends UIWizardStep implements LCConsts
  9. {
  10.     public ValuePnl pnl;
  11.  
  12.     public WZValue()
  13.     {
  14.         super(new UIGraphic(LCImages.get(PVALUE)), new ValuePnl());
  15.         pnl = (ValuePnl)getContent();
  16.     }
  17. }
  18.  
  19. class ValuePnl extends FocusUIPanel implements LCConsts, IFxTextConstants
  20. {
  21.     public UIEdit pv_e;
  22.  
  23.     public ValuePnl()
  24.     {
  25.         setLayout(new UIBorderLayout());
  26.  
  27.         // Main text
  28.         UIDrawText intro = new UIDrawText(VALUE_TXT);
  29.         intro.setWordWrap(IFxTextConstants.wwKeepWordIntact);
  30.  
  31.         // Amount label
  32.         UIText pv_t = new UIText("Amount of Loan:", UIText.RIGHT);
  33.  
  34.         // Create Amount edit field
  35.         pv_e = new UIEdit();
  36.         pv_e.setValueText("" + INIT_PV);
  37.         pv_e.setMaxBufferSize(7); pv_e.setBordered(true);
  38.         pv_e.setVertAlign(IFxTextConstants.vtaCenter);
  39.         pv_e.setHorizAlign(IFxTextConstants.htaCenter);
  40.         pv_e.setMaskChars("0123456789"); pv_e.setMaskMode(UIEdit.INCLUDE);
  41.  
  42.         // add everything to this panel
  43.         add(new HSL(intro, 
  44.                     new VSL(pv_t, 
  45.                             new BL(pv_e, 30,10,30,0),
  46.                             140),
  47.                     55),
  48.             "center");
  49.     }
  50.  
  51.     public void setFocus() { pv_e.requestFocus(); }
  52.  
  53.     public Insets getInsets() { return new Insets(10,0,0,0); }
  54. }
  55.