How to add the line of separation in the horizontal field Manager

I want to get as

name | Age | year

all this in a horizontalfield Manager, how to do.

I used the field separator, comes to the entire screen, such as

name | Age | year

|       |

|       |

|       |

How do I solve this problem

Thank you

You can also do this by substituting your HorizontalFieldManager sublayout() method.

As:

        h = new HorizontalFieldManager()
        {
            protected void sublayout( int maxWidth, int maxHeight )
            {
                int width = Display.getWidth();
                int height = 30; //height of the manager

                super.sublayout( width, height);
                setExtent( width, height);
            }

        };

Concerning

Bika

Tags: BlackBerry Developers

Similar Questions

  • How to change the background color of the horizontal field Manager

    How can we tell the background color of the horizontal field Manager (hfm) hanger

    If we should extend and override in ppaint, I tried

    I got color of hfm in tag I added to this

    all give me idea

    Try this:

            HorizontalFieldManager manager = new HorizontalFieldManager()
            {
                public void paint(Graphics graphics)
                {
                    graphics.setBackgroundColor(0x000000FF);//blue
                    graphics.clear();
                    super.paint(graphics);
                }
            };
    

    Concerning

    Bika

  • Assign a spacing equal to the fields in the horizontal field Manager

    Hello

    I add a number of vertical field managers to a horizontal field Manager. Each manager of vertical field has a text with an image under. The text varies in width images in each vertical field Manager seem to have a different amount of space between them. Is there a way to remedy this situation? Joined a raw image in the way that message on the screen. How can I get the same amount of space between each area of the rectangle?

    Thank you

    Here's some code that I received from one of the sessions at the last DevCon.  Should be useful.  Might help explain customer managers too.

    /*
     * EqualSpaceToolbar.java
     *
     * Research In Motion Limited proprietary and confidential
     * Copyright Research In Motion Limited, 2009-2009
     */
    
    import net.rim.device.api.ui.*;
    
    public class EqualSpaceToolbar extends Manager {
    
        private static final int SYSTEM_STYLE_SHIFT = 32;
    
        public EqualSpaceToolbar() {
            this( 0 );
        }
    
        public EqualSpaceToolbar( long style ) {
            super( USE_ALL_WIDTH | style );
        }
    
        protected void sublayout( int width, int height ) {
            int numFields = getFieldCount();
            int maxHeight = 0;
    
            // There may be a few remaining pixels after dividing up the space
            // we must split up the space between the first and last buttons
            int fieldWidth = width / numFields;
            int firstFieldExtra = 0;
            int lastFieldExtra = 0;
    
            int unUsedWidth = width - fieldWidth * numFields;
            if( unUsedWidth > 0 ) {
                firstFieldExtra = unUsedWidth / 2;
                lastFieldExtra = unUsedWidth - firstFieldExtra;
            }
    
            int prevRightMargin = 0;
    
            // Layout the child fields, and calculate the max height
            for( int i = 0; i < numFields; i++ ) {
    
                int nextLeftMargin = 0;
                if( i < numFields - 1 ) {
                    Field nextField = getField( i );
                    nextLeftMargin = nextField.getMarginLeft();
                }
    
                Field currentField = getField( i );
                int leftMargin = i == 0 ? currentField.getMarginLeft() : Math.max( prevRightMargin, currentField.getMarginLeft() ) / 2;
                int rightMargin = i < numFields - 1 ? Math.max( nextLeftMargin, currentField.getMarginRight() ) / 2 : currentField.getMarginRight();
                int currentVerticalMargins = currentField.getMarginTop() + currentField.getMarginBottom();
                int currentHorizontalMargins = leftMargin + rightMargin;
    
                int widthForButton = fieldWidth;
                if( i == 0 ) {
                    widthForButton = fieldWidth + firstFieldExtra;
                } else if( i == numFields -1 ) {
                    widthForButton = fieldWidth + lastFieldExtra;
                }
                layoutChild( currentField, widthForButton - currentHorizontalMargins, height - currentVerticalMargins );
                maxHeight = Math.max( maxHeight, currentField.getHeight() + currentVerticalMargins );
    
                prevRightMargin = rightMargin;
                nextLeftMargin = 0;
            }
    
            // Now position the fields, respecting the Vertical style bits
            int usedWidth = 0;
            int y;
            prevRightMargin = 0;
            for( int i = 0; i < numFields; i++ ) {
    
                Field currentField = getField( i );
                int marginTop = currentField.getMarginTop();
                int marginBottom = currentField.getMarginBottom();
                int marginLeft = Math.max( currentField.getMarginLeft(), prevRightMargin );
                int marginRight = currentField.getMarginRight();
    
                switch( (int)( ( currentField.getStyle() & FIELD_VALIGN_MASK ) >> SYSTEM_STYLE_SHIFT ) ) {
                    case (int)( FIELD_BOTTOM >> SYSTEM_STYLE_SHIFT ):
                        y = maxHeight - currentField.getHeight() - currentField.getMarginBottom();
                        break;
                    case (int)( FIELD_VCENTER >> SYSTEM_STYLE_SHIFT ):
                        y = marginTop + ( maxHeight - marginTop - currentField.getHeight() - marginBottom ) >> 1;
                        break;
                    default:
                        y = marginTop;
                }
                setPositionChild( currentField, usedWidth + marginLeft, y );
                usedWidth += currentField.getWidth() + marginLeft;
                prevRightMargin = marginRight;
            }
            setExtent( width, maxHeight );
        }
    
    }
    
  • How to add the executable field account manager?

    Hi all

    LabVIEW 8.6.1 + DSC 8.6.1

    I created local domain and some test users by using the domain manager account. I also set at the controls user access levels and lights on the front panel. After that, I build a .exe of my application.

    When I install or move the application to another computer how can I transfer my domain to this second computer configuration. It is assumed that these computers cannot be in the same network... Can I add Manager domain account someway to executable or do I have to manually install Manager this second computer. I can't install labview all this second computer...

    BR

    You can copy the directory located in the program NIUninstaller Instruments\Shared\Domain to the same location on the destination computer. Don't forget to restart the computer to apply your changes.

  • How to add the Adobe Extension Manager CC product

    My product extensions CC Manager is empty. How can I add a product, including Adobe Photoshop CC 2015.

    You do not add an application of product as the Psalm

    It is used to load the extensions of app for use in programs of the suite.

    Using the extensions Manager. Download and installation of extensions

  • Add the horizontal field at the bottom of the screen

    what I've done

    in Builder screeen

    Super (Manager.USE_ALL_HEIGHT);

    HorizontalFieldManager hf = new HorizontalFieldManager (Manager.BOTTOMMOST);

    Add (HF);

    but horizontalfield does not go to the bottom of the screen

    used setstatus solved the problem

    instead of add (hf) used

    setStatus (hf);

  • align the horizontal field Manager

    Hello

    I need where I want my horizontalfieldmanager just above the horizontalfieldmanager another which is initilized as setStatus... (below the screen)...

    use an optimization of resources, place the two hfms, use setStatus with optimization of resources.

  • How to add multiple lines when the button is clicked

    How to add multiple lines when the click on button now is just add a row .plz give me idea how... waiting for answer

    / public final class screen extends MyScreen
    {
    /**
    * Creates a new object of MyScreen
    */
    ObjectChoiceField obj1 obj2, obj3, obj4.
    Table of String() = {'101 ', ' 102'};
    String of shadow [] = {"Shade1", "Shade2"};
    Rolls of string [] = {'101 ', ' 102'};
    String cutting [] = {"100-150", "150-200"};
    Chain of selectedindex1, selectedindex2, selectedindex3, selectedindex4;
    LabelField lbl1 lbl2, lbl3, lbl4;
        
    GFM LinedGridFieldManager;
    HFM HorizontalFieldManager, hfm1, hfm2 hfm3;
    VerticalFieldManager vfmMain;
        
    public MyScreen()
    {
        
    Set the displayed title of the screen
    hfm1 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    hfm2 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    hfm3 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    HFM = new HorizontalFieldManager (HorizontalFieldManager.FIELD_RIGHT);
    vfmMain = new VerticalFieldManager (Manager.NO_VERTICAL_SCROLL |) Manager.NO_HORIZONTAL_SCROLLBAR);
            
    obj1 = new ObjectChoiceField ("", graph, 0, FIELD_LEFT);
    obj2 = new ObjectChoiceField ("", blind, 0, FIELD_LEFT);
    Obj3 = new ObjectChoiceField ("", rolls, 0, FIELD_LEFT);
    Obj4 = new ObjectChoiceField ("", cuts, 0, FIELD_LEFT);
            
    LBL1 = new LabelField("");
    LBL2 = new LabelField("");
    lbl3 = new LabelField("");
    lbl4 = new LabelField("");
            
    ButtonField btnAdd = new ButtonField ("ADD", FIELD_RIGHT);
            
    GFM = new LinedGridFieldManager (4, LinedGridFieldManager.VERTICAL_SCROLL);
            
    hfm1.setMargin (20, 0, 10, 0);
    hfm1. Add (new LabelField ("Chart"));
    hfm1. Add (obj1);
    hfm1. Add (new LabelField ("Shade"));
    hfm1. Add (obj2);
            
    hfm2. Add (new LabelField ("Rolls"));
    hfm2. Add (Obj3);
    hfm2. Add (new LabelField ("Cuts"));
    hfm2. Add (Obj4);
    HFM. Add (btnAdd);
            
    GFM. Add (new LabelField ("Chart"));
    GFM. Add (new LabelField ("Shade"));
    GFM. Add (new LabelField ("Rolls"));
    GFM. Add (new LabelField ("Cuts"));
            
    vfmMain.add (hfm1);
    vfmMain.add (hfm2);
    vfmMain.add (hfm3);
    vfmMain.add (hfm);
    vfmMain.add (new SeparatorField());
    vfmMain.add (gfm);
    Add (vfmMain);
            
    btnAdd.setChangeListener (new FieldChangeListener()
    {
    ' Public Sub fieldChanged (field field, int context) {}
    TODO self-generating method stub
    selectedindex1 = chart [obj1.getSelectedIndex ()];
    selectedindex2 = shade [obj2.getSelectedIndex ()];
    selectedindex3 = rolls [obj3.getSelectedIndex ()];
    selectedindex4 = cuts [obj4.getSelectedIndex ()];
                    
    While (LBL1. GetText(). Equals("") | LBL2. GetText(). Equals("") | lbl3. GetText(). Equals("") | lbl4. GetText(). Equals(""))
    {
    LBL1. SetText (selectedindex1);
    LBL2. SetText (selectedindex2);
    lbl3. SetText (selectedindex3);
    lbl4. SetText (selectedindex4);
                    
    GFM. Add (LBL1);
    GFM. Add (LBL2);
    GFM. Add (lbl3);
    GFM. Add (lbl4);
                    
    }
    }
    });
    }
    }

    Hi Piya,

    I run your code, and according to your logic that it works correctly.

    It's adding that line only once because according to your logic that one line can be added to MDT, if you do not want to add line on each click on the button, follow these steps:

    selectedindex1 = chart [obj1.getSelectedIndex ()];
    selectedindex2 = shade [obj2.getSelectedIndex ()];
    selectedindex3 = rolls [obj3.getSelectedIndex ()];
    selectedindex4 = cuts [obj4.getSelectedIndex ()];

    Lbl1 LabelField = new LabelField("");
    Lbl2 LabelField = new LabelField("");
    LabelField lbl3 = new LabelField("");
    LabelField lbl4 = new LabelField("");
    If (LBL1. GetText(). Equals("") | LBL2. GetText(). Equals("") | lbl3. GetText(). Equals("") | lbl4. GetText(). Equals(""))
    {
    LBL1. SetText (selectedindex1);
    LBL2. SetText (selectedindex2);
    lbl3. SetText (selectedindex3);
    lbl4. SetText (selectedindex4);
                    
    GFM. Add (LBL1);
    GFM. Add (LBL2);
    GFM. Add (lbl3);
    GFM. Add (lbl4);
                    
    }

  • How to add two lines when the second row is not visible, but also gets the first data line too?

    Mr President

    Jdev worm is 12.2.1

    How to add two lines when the second row is not visible, but also gets the first data line too?

    I want to add two lines like below picture, but want the second to remain invisible.

    tworows.png

    I asked this question but my way of asking was wrong, that's why for me once again.

    Concerning

    Try to follow these steps:

    1. in the database table to add the new column "JOIN_COLUMN" and add the new sequence "JOIN_SEQ".

    2. Add this new column in the entity object. (You can add this in entity object by right clicking on the entity object and then select "Synchronize with database" then the new column and press on sync)

    3. in your bookmark create button to create only one line NOT 2 rows.

    4 - Open the object entity--> java--> java class--> on the entity object class generate and Tick tick on the accessors and methods of data manipulation

    5 - Open the generated class to EntityImpl and go to the doDML method and write this code

      protected void doDML(int operation, TransactionEvent e)
      {
        if(operation == DML_INSERT)
        {
          SequenceImpl seq = new SequenceImpl("JOIN_SEQ", getDBTransaction());
          oracle.jbo.domain.Number seqValue = seq.getSequenceNumber();
          setJoinColumn(seqValue);
          insertSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        if(operation == DML_UPDATE)
        {
          updateSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        super.doDML(operation, e);
      }
    
      private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "Insert into table_name (COLUMN_1,COLUMN_2,COLUMN_3,JOIN_COLUMN, HIDDEN_COLUMN) values ('" + value1 + "','" + value2 + "','" + value3 + "','" + joinColumn + "', 1)";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
      private void updateSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "update table_name set column_1='" + value1 + "', column_2='" + value2 + "', column_3='" + value3 + "' where JOIN_COLUMN='" + joinColumn + "'";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
  • How to add more line by line?

    Hi all

    Please let me know how to add addition line by line as the title:

    DEPTNO num1, num2, num3 total num
    1100 20 30
    1200 20 10
    1300 40
    1400 30


    your suggestion would be greatly appreciated.

    Something like that?

     SELECT deptno,num1,num2,num3, num1+num2+num3 "Tot"
     FROM ....
    
  • How to add the column to Adobe flex mxml or actionsctpt mx:DataGrid?

    I have the simple mxml code

    <mx:DataGrid id="DGG"
                
    editable="true">
       
    <mx:dataProvider>
           
    <mx:Object scheduledDate="4/1/2006"/>
       
    </mx:dataProvider>
    </mx:DataGrid>
    <mx:Button id="SetBut"
              
    label="Set Array as Data Provider"
              
    click="SetDP(); AddBut.visible = true;"
              
    x="100.5"
              
    y="164"
              
    width="211"/>
    <mx:Button id="AddBut"
              
    label="Add a column!"
              
    click="AddCol();"
              
    x="100.5"
              
    y="194"
              
    width="211"
              
    visible="false"/>
    <mx:Script>
        <![CDATA[
            import mx.controls.dataGridClasses.DataGridColumn;
            import mx.collections.ArrayCollection;

            [Bindable]
            public var MyAC:ArrayCollection=new ArrayCollection([{scheduledDate: "4/1/2006", homeTeam: "Chester Bucks"}]);

            public function SetDP():void
            {
                DGG.dataProvider=MyAC
            }

            public function AddCol():void
            {
                MyAC.addItem({scheduledDate: "4/5/2007", homeTeam: "Long Valley Hitters", Umpire: "Amanda Hugenkis"});
                DGG.columns.push(new DataGridColumn("Umpire"));
            }
        ]]>
    </mx:Script>

    I want to add lines to my datagrid table how do such thing?

    How to add the column to Adobe flex mxml or actionsctpt mx:DataGrid?

    (You can place this code in a Flash or AIR application - it compiles without error, but will not add any columns =)

    Change this:

    public void SetDP (): void
    {
    DGG.dataProvider = MyAC
    MyAC.addItem ({scheduledDate: "05/04/2007", homeTeam: "long hitters Valley", umpire: "Amanda Hugenkis"});
    }
               
    public void AddCol (): void
    {
    var dgc:DataGridColumn = new DataGridColumn ("Umpire");
    var ca:Array = DGG.columns;
    CA.push (DGC);
    DGG.columns = ca;
    }

    Dany

  • How to add a line break in shortDesc?

    How to add a line break in shortDesc?

    Hey Danny,

    I think you can't... but I did two work around to achieve this goal:

    1. in IE7 (not Mozilla Firefox) If you type a space between the words will be automatically pass the new line like:


    shortDesc = "firstWord... spaces... Second word"/ >

    2. you can use popup like a ToolTip like:








    Sameh Nassar

  • How to add the name of the title of graph in Excel

    Dear friends

    I'm using LabVIEW 8.0.I need how to add the name of the title of graph in Excel.

    You have the report generation tool? If so, the VI of graph Easy Excel has an entry for this.

    If you don't have the Toolbox, then you need to use ActiveX. Please do a search on the use of the ActiveX (there are examples provided with LabVIEW) to control Excel. Also, there are many examples in the thread Excel. NOTE: DON'T POST QUESTIONS IN THIS THREAD.

    In the end, you will need to search for information contained in MSDN.

  • How to add the full value of two buttons?

    How to add the full value of two buttons (any key) VI and display it in the output text box? I am attaching a sample program, but I know that his evil... Help, please

    Try this

  • How to add the quick launch of the desktop icon bar

    How to add the toolbar launch quick icon on the desktop. I can't find a desktop icon that will drag on

    The following Microsoft KB article

    http://support.Microsoft.com/kb/190355/en-us

    will help you.

    Good bye.

Maybe you are looking for