Right Alignment in List Component

Hi,
I want to display the items in javax.microedition.lcdui.List to be right aligned.
How can I do that?
Thanx in advance

with a style.
The quick and dirty way:
<html:text style="text-align:right"/>
The better way would be to define the style in a css stylesheet, and use a styleClass, or just apply it to all input type="text"

Similar Messages

  • How do I right align the component af:navigationPane?

    First I should say that I use Jdeveloper Studio Edition Version 11.1.1.0.1.
    I have a template that in one place in the template contain these components
    <afh:cellFormat halign="right">
    <af:navigationPane>
    <af:commandNavigationItem/>
    <af:commandNavigationItem/>
    <af:commandNavigationItem/>
    <af:commandNavigationItem/>
    </af:navigationPane>
    </afh:cellFormat>
    I want to right align the cellformat and navigationPane which has the hint property set to bar. I have tried to set the Halign property of the cellFormat to right and if I have an outputText inside the cellformat it gets right aligned so I guess that works but I cant get the commandNavigationItems to right align inside the navigationPane. I have tried to set the the text-align:right; in the navigationPane but that doesn´t work. The only thing that seems to work is to set the width of the last cellformat but since the width of one of the commandNavigationItems varies it isnt a good solution either. Can´t right alignment be done with a navigationPane? Should I choose some other component instead? In case I could use another component instead, which component has similar functionality and can be right aligned?
    Atlantic Viking
    Edited by: Atlantic Viking on Feb 3, 2009 7:22 AM

    Hi,
    I have tried the sample for this :
    <af:panelGroupLayout id="pgl41" layout="horizontal" halign="right">
    <af:navigationPane id="np1" hint="tabs">
    <af:commandNavigationItem id="cn1" text="Test1"/>
    <af:commandNavigationItem id="cn2" text="Test2"/>
    <af:commandNavigationItem id="cn3" text="Test3"/>
    <af:commandNavigationItem id="cn4" text="Test4"/>
    </af:navigationPane>
    </af:panelGroupLayout>
    It works fine.
    Is it af:navigationPage(new tag) or af:navigationPane.

  • How can I right-align a table header?

    Does anyone know a way to right-align a table header?
    For example, in the table below I want the word 'Price' to be right-aligned. I could set the table's 'header renderer' to be a right-aligned DefaultTableCellRenderer, but then the header would look like a cell, not a header. Why can't swing be simple, like table.getColumn(1).setAlignment(Column.RIGHT) ????
    public class TestTableHeader {
         public static void main(String[] args) throws Exception {
              JFrame frame = new JFrame("Test");
              Object[][] rowData = new Object[][] { { "General Electric", "$100.60" },
                        { "IBM", "$5.20" }, { "Wal-mart", "$17.00" } };
              JTable table = new JTable(rowData, new Object[] { "Name", "Price" });
              DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
              renderer.setHorizontalAlignment(DefaultTableCellRenderer.RIGHT);
              table.getColumnModel().getColumn(1).setCellRenderer(renderer);
              frame.getContentPane().add(new JScrollPane(table));
              frame.setSize(400, 300);
              frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              frame.setVisible(true);
    }

    I modified your code an came up with a solution to the problem.
    import java.awt.Component;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.DefaultTableCellRenderer;
    public class TestTableHeader {     
         public static void main(String[] args) throws Exception {
              JFrame frame = new JFrame("Test");
              Object[][] rowData = new Object[][] {
                        { "General Electric", "$100.60" }, { "IBM", "$5.20" },
                        { "Wal-mart", "$17.00" } };
              JTable table = new JTable(rowData, new Object[] { "Name", "Price" });
              RightAlignRender right = new TestTableHeader().new RightAlignRender();
              table.getColumnModel().getColumn(0).setHeaderRenderer(right);
              table.getColumnModel().getColumn(1).setHeaderRenderer(right);
              frame.getContentPane().add(new JScrollPane(table));
              frame.setSize(400, 300);
              frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              frame.setVisible(true);
         public class RightAlignRender extends DefaultTableCellRenderer {
              public Component getTableCellRendererComponent(JTable table,
                        Object arg1, boolean arg2, boolean arg3, int arg4, int column) {
                   Component toReturn = table.getTableHeader().getDefaultRenderer().getTableCellRendererComponent(table,
                             arg1, arg2, arg3, arg4, column);
                   switch (column) {
                   case 0:
                        ((JLabel) toReturn).setHorizontalAlignment(DefaultTableCellRenderer.CENTER);
                        break;
                   case 1:
                        ((JLabel) toReturn).setHorizontalAlignment(DefaultTableCellRenderer.RIGHT);
                        break;
                   return toReturn;
    }

  • Adding Images to the List component

    Adding Images to the List component while using the FLV
    PLayback
    All, ( i can send you my source files if it would help)
    I'm using the FLV Playback component and loading videos into
    it from an external xml file. I also have a list component tied to
    the FLV playback that when you click on one of the elements in the
    list, it plays that movie.
    QUESTION:
    My question is how do I add an image to the list component?
    Below is the xml file and the actionscript. I've added the image
    attribute to the XML file as img="time_square.jpg" and added the
    element of the array when calling/creating the list. Did I do this
    right?
    Any direction would be very much appreciated.

    Adding Images to the List component while using the FLV
    PLayback
    All, ( i can send you my source files if it would help)
    I'm using the FLV Playback component and loading videos into
    it from an external xml file. I also have a list component tied to
    the FLV playback that when you click on one of the elements in the
    list, it plays that movie.
    QUESTION:
    My question is how do I add an image to the list component?
    Below is the xml file and the actionscript. I've added the image
    attribute to the XML file as img="time_square.jpg" and added the
    element of the array when calling/creating the list. Did I do this
    right?
    Any direction would be very much appreciated.

  • Using a List Component to create a photo gallery.

    This feels like a lot to be asking but i'm gonna go ahead and
    ask to see what happens.
    I'm trying to figure out how to use a list component to
    select 6 items from a large list, display the words to the 6
    selected items (in a text field), then finally (by pressing a
    button) I would like to load the 6 corresponding pictures for the
    selected items into a seperate frame. If there is anyone that could
    point me in the right direction it would be greatly appreciated. I
    have been trying to find information online about programming the
    List Component but haven't had any luck. Is there a book that
    anyone recommends that could help me? I've been doing simple
    animations and websites in flash but i'm now looking to learn some
    actionscripting as well. Thanks.

    Hi PinkPowerRanger,
    Per my understanding that you have two fields in the table "Date and Time picker" which is Date/time type and another is "Item ID", you need to get the Month from the Date field to display in the X-axis and count(Item ID) related to each
    month to display in the Y-Axis, right?
    I have tested on my local environment and can do this by create two calculated fields to get the month and year values from the Date/Time field.
    Details information below for your reference:
    Right click the main dataset to select the "Add Calculated field", specify an name of the new calculated field and add the expression in the field source as below:
    Year:    =Year(Fields!Date.Value)
    Month:  =MonthName(Month(Fields!Date.Value))
    Add the three field in the Chart as below and remember in the Value area you have got the Count(ItemID) but not SUM(ItemID):
    Preview you will got the chart like below:
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • In Flash CS4,How can I give a AS3 List Component a suitable horizontalScrollBar

    In Flash CS4 when an AS3 List Component has too many rows,it will has a verticalScrollBar automatically. but it will never has a horizontalScrollBar even a part of the content of the list is hidden.
    I set the property  list.horizontalScrollPolicy="on",and set list.maxHorizontalScrollPosition=200; then the horizontalScrollBar appear
    but when I click the item of the list, all the list move to left, half of the list is hidden,
    I can only see the right part of the list, the I click the list again,the list move to right,then I can see all the list by move the horizontalScrollBar
    How can I give a suitable horizontalBar to the AS3 list component?

    Thank you for your help! (sorry,I`m bad in English...)
    In fact, it works.
    but,I made a mistake,the reason I want to give a list a horizontalScrollBar is:I want to show all content in a list that is not wide enough,
    you see,first row can show all content in this list,but in the other rows,the content is too wide to show,I want to give the list a horizontalScrollBar to show all content by draging the horizontalScrollBar to right.
    now,set property:
    list.horizontalScrollPolicy="on", list.maxHorizontalScrollPosition=30;(the result is the image above),when I drag the horizontalScrollBar to right:
    ah ha ,the row can`t show all content too,the horizontalScrollBar is related to the width of all the list, is not related to the width of the content in every row.
    now I kown why the horizontalScrollBar is always disable.
    but in design,to show a lot of content,we can`t draw  a list too wide, it`s not beatiful,so I want to use a horizontalScrollBar to show all content in every row.
    and the list is not too wide
    ah ah,  like the list in Flex4
    In fact,ah,I have not studied Flex 4,so,I have to make it by using Flash CS4 Component
    How can I do? Please
    (so sorry for my bad English,I do my best in it)

  • Data Grid in a List Component???

    Hi there!
    I have a populated List Component set to Multiple Selection.
    This list contains titles of a magazine issues.
    I wish to allow the user to select one or more items in the
    list and enter the quantity of the selected issue(s) he/she wants
    to receive.
    Is it possible to achieve this with a Data GRid integrated in
    the List Component or which simplier solution must I contemplate?
    I thank you in advance for indicating the best way to
    explore.
    Best regards,
    Gerry

    Hi GWD and thanks for responding.
    I fully understood your explanations and the example you
    provided.
    I'll give it a try, for sure.
    But I want to know:
    - How do I populate a DataGrid Component? Like a List
    Component? (you said they are quite the same, I assume methods to
    apply are identical...)
    -In the same way, I can pull out the data from a DataGrid as
    I do for the List, right?
    Thanks again!
    Best,
    gerry

  • List component mousewheel scrolling

    hi there....I have a dynamically generated list component
    however it seems scrolling with the 'mouse wheel' is not set by
    default. How can I do this in AS3?
    If my List component is
    var newList:List = new List();
    how do I set the mouse wheel scrollin?
    Thanks!

    Arrghh, not the right one. I am also moving the scroller bar by using a linkbar to tab the scrollbar to different positions. I need to fire an event when the scroller has reached those new positions. The FlexEvent.CHANGE_END only works when you use the scroller manually.

  • List component scroller eventlistener for finished scrolling ?

    I have a list component which contains an item renderer. I would like to know if it is possible to detect when the scoller that is built into the List has finished scrolling can fire an event. Is there a built in eventlistener ?

    Arrghh, not the right one. I am also moving the scroller bar by using a linkbar to tab the scrollbar to different positions. I need to fire an event when the scroller has reached those new positions. The FlexEvent.CHANGE_END only works when you use the scroller manually.

  • Right alignment for OO tree column

    Hi experts,
    how can i align the data of type characters in the OO tree alv display? i want to align it to the right.
    Thanks.

    Hello,
    Set Alignment of the Text in the Column
    You are able to set where the content of a column will be put:
    ·        Left aligned
    ·        Centered
    ·        Right-aligned
    You are able to change the alignment of text in the design object (header and footer area of page or list) and in the ALV output.
    Use the method CL_SALV_COLUMN SET_ALIGNMENT
    Check
    http://help.sap.com/saphelp_nw2004s/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm

  • Highlighted default item in list component???

    I can't seem to find how to have an item in a list component
    highlighted by default. I'm sure its right there in the docs
    staring me down, but I dont see it.
    I've found scrollToIndex method, but that doesnt seem to
    actually highlight the index item. How do I highlight an index item
    in a list in as3?
    Thanks,
    Matt

    Oh, I forgot to mention that I am using ActionScript 3.

  • Arrays to List component

    I am fairly new AS3 coder now using Flash Builder and I can't work out how to display my data (a collection of actionscript arrays returned by a AS3 function) in a List component as a list of labels and images. My arrays look like this:
    var aNames:Array = new Array("John", "Ringo", "Paul");
    var aImages:Array = new Array("http://myserver.com/image1.jpg", "http://myserver.com/image2.jpg", "http://myserver.com/image3.jpg");
    Now I want to display them in a list component, each list item has the image on the left and then the name on the right.
    Can anyone provide an example please, I think I need to use an arraycollection and a custom item renderer inside the list and then have the lists dataprovider set to the arraycollection but have not been able to construct the code.
    Many thanks.

    You'll get better responses on the Flex general discussion forum for non-Flash Builder queries.
    -Anirudh

  • Need LayoutManager that resizes and supports right-aligned children

    I have two labels that I want to appear inside JPanels such that
    they have minimum 2 pixels padding between the text and the
    border of the JPanel, and the leftmost label is right justified, while
    the rightmost label is left justified. For example)
    [+++++label1++][++label2+++++]
    (the '+' represent white space/padding)
    Additionally, the panels themselves are children of a JPanel that is
    resized via a JSplitPane, so I want the labels to get truncated or
    expanded depending on the size of their containing JPanel.
    Lastly, I want to have the leftmost label right justified within its
    containing JPanel, and the rightmost label to be left justified within
    its containing JPanel.
    I've found that FlowLayout doesn't work because once my text is
    painted truncated, if the containing JPanel is resized larger, the
    label does not change to fill the space.
    What I'm seeing is that when the label is too large for the JPanel,
    it correctly gets truncated such as:
    [++lab...++]
    '+' represents white space/padding
    "..." implies truncated text
    but when the JPanel is grown, it simply adds padding to the current
    text that is painted:
    [+++++++lab...++]
    when I want it to expand the text and keep the result right justified:
    [++++++label1++]
    BoxLayout doesn't work because I can't find a way to get the text to
    be right-justified within the JPanel.
    BorderLayout isn't viable because while my example only shows a single
    label in the JPanel, I could actually have many components to add
    to the JPanel. So, I could create a JPanel to hold the many comps,
    but then that JPanel would have the same issue with layout.
    GridBag seems way overkill for what I need to do, which is simply,
    right justify text that will be react to contain panel bounds changes.
    Any advice is greatly appreciated.
    -Andy.

    Thanks for the reply. Unfortuneately, other circumstances prevent me from being
    able to do it that way :(
    I basically have very HTML-ish XML used to define a table.
    The table uses a GridBagLayout that lays out the <td>'s that are
    currently JPanel's. The <tr>'s do not create any JComponent as
    they are simply used to define attributes that are applied to all
    row <td>'s.
    My XML looks something like:
    <table>
      <tr>
        <td style="align: right; hgap: 2;"><label text="Hello"/></td>
        <td style="align: left; hgap: 2;"><label text="World"/></td>
      </tr>
    </table>So, when this is displayed it should show like:
    [++Hello++][++World++]
    or when it's shrunk, it should become something like:
    [++He...++][++Wo...++]
    and when the row is grown, it should become something like:
    [++++++Hello++][++World++++++]
    Also, since the GUI is defined in the XML, there can be many labels,
    images, etc inside one of the <td> tags, and I want them to be displayed
    L to R within the <td> in the order they appear, but I want them to be
    left or right justified with respect to the <td> JPanel.
    Maybe I can use a Box as my <td> instead of a JPanel so I can
    add a glue component on the left for right justified, and glue on the right
    (or no glue component) for left justified? I'll try that next...
    Thanks again for your help.
    -Andy.

  • JTables - Right Aligning certain columns

    Hi!
    Im having a major problem! I am using JTable in my prog, but Im finding them very difficult to customise. I am wanting my JTable to have certain Columns(for monetary values) right aligned, as this looks far better when dealing with currency. I have tried implementing this class on my JTable:
    package accpick.overrides;
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.*;
    class MyRenderer implements TableCellRenderer
         TableCellRenderer old_renderer;
         MyRenderer(TableCellRenderer old_renderer)     
              this.old_renderer = old_renderer;
         public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column     )     
         // use the old renderer to render the cell          
         Component c = old_renderer.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
         if(column == 3||column == 4||column == 6)          
              //align right
         // set all other cells to normal          
         else          
              //align left
         return c;
    The problem with this is that getTableCellRendererComponent() returns a Component, and Component does not seem to have a method to align, but JComponent does(setAlignmentX())
    Please can someone help!!!Am i on the right track or am i going about it totally the wrong way?
    THanks
    Nitron999

    Thanks everyone! Your advice got me past the compiler! But Im still having the problem of right aligning the columns! Was my code on the right path, or am i farting in the wind here?
    Does anyone know of any relatively well structured way of doing this?

  • FPM_LIST_UIBB labels coming Right Aligned even if -WDSTYLE_LABELALIGNMENT is set Left

    Hi All,
    The label of the overview page created for the service created using - FPM_LIST_UIBB is coming as Right aligned. I have set the Application Parameter - WDSTYLE_LABELALIGNMENT = LEFT . The Label have become left aligned for Detail page which are of type FPM_FORM_UIBB.
    Any suggestion how to make the label left aligned .
    Thanks,
    Amol

    Your business requirement is to make fields shown in overview screen(FPM_LIST_UIBB) to be left aligned. In general, if we maintain WDSTYLE_LABELALIGNMENT=LEFT while launching HRESS_AC_PERSINFO application configuration then fields in detail screen(FPM_FORM_UIBB) maintained for FPM_FORM_UIBB becomes left aligned. In application HRESS_AC_PERSINFO for overview screen, we are using following : Component: FPM_LIST_UIBB Rendering style:Row Repeater When the fpm_list_uibb is rendered in mode "Rendering style:Row Repeater" then the UI elements are fixed and the layout cannot be influenced. We are aware of this restriction. Therefore there is a new fpm guibb in order to display a row repeater. The name of it is FPM_FORM_REPEATER_UIBB, but it is available only starting with sap_basis, 7.31, sp5.

Maybe you are looking for

  • Questions on Marvell vs. intel Raid setup for new build

    I'm getting ready to do my first build this weekend, and had some questions on the Asus p9x79pro motherboard's raid controllers.  They are: What is the difference between the Marvell controller and the intel software controller? Why would I use one o

  • SQL Query taking long time....its very urgent !!!

    Hi All, Can any body help me out to tune this query... its cost is 62,900.. and thete is full table scan on ap_invoices_all... For one invoice ID its taking 20 sccs... SELECT /*+ INDEX  ( i2 AP_INVOICES_N8 )  INDEX  ( i1 AP_INVOICES_N8 )   */ DISTINC

  • New features for Oracle Assets in Apps 12i

    What are the new features for Oracle Assets in Apps version 12i? where can i find User Guide for FA in Aps 12i?

  • 2 editable combobox questions

    1. addKeyListener(..) not working onto editable combobox. 2. how to scroll the editable combobox when user types into it? (in case of solving 1st problem, this one is solved too). Maybe there are special methods?? Thank you very much. Boris.

  • Wrong vendor

    I'm facing a issue regarding PO with wrong vendor, the problem is the PO good receipt already and the goods was delivered to customer. But two months later, the merch. told me that the vendor is wrong. I would like to know, in my case, how to solve t