home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 14 / IOPROG_14.ISO / soft / sdkjava / sdkjava.exe / SDKJava.cab / AFC102 / Samples / Scrolls / Src / SpinnerEditPnl.java < prev    next >
Encoding:
Java Source  |  1998-03-05  |  1.1 KB  |  36 lines

  1. //
  2. // (c) 1997 Microsoft Corporation.  All rights reserved.
  3. //
  4. import java.awt.Insets;
  5. import com.ms.ui.*;
  6. import com.ms.fx.*;
  7.  
  8. public class SpinnerEditPnl extends UIPanel implements SDKConsts, IFxTextConstants
  9. {
  10.     public UISpinnerEdit ctrl;
  11.  
  12.     public SpinnerEditPnl()
  13.     {
  14.         setLayout(new UIBorderLayout());
  15.  
  16.         ctrl = new UISpinnerEdit(UISpinner.RAISED, 
  17.                                     UISpinnerEdit.CENTER | UISpinnerEdit.BORDER,
  18.                                     0, MAX_SCROLL, 16, 1, INIT_POS);
  19.         IUIComponent comp = ctrl.getLayoutComponent(UISpinner.BUDDY);
  20.         UIEdit edit;
  21.         if ( comp instanceof UIEdit ) { // it very well better be
  22.             edit = (UIEdit)comp;
  23.             edit.setMaxBufferSize(3); edit.setVertAlign(vtaCenter);
  24.             edit.setFont(new FxFont("Dialog", FxFont.BOLD, 14));
  25.         }
  26.  
  27.         // Create UIGroup for spinneredit
  28.         UIGroup group = new UIGroup("UISpinnerEdit");
  29.         group.setLayout(new UIBorderLayout());
  30.         SDKInsetPanelBL ipnl = new SDKInsetPanelBL(13,10,13,10);
  31.         ipnl.add(ctrl, "center"); group.add(ipnl, "center"); add(group, "center");
  32.     }
  33.  
  34.     public Insets getInsets() { return new Insets(0,10,0,0); }
  35. }
  36.