Right aligned text in textfield

Hi,
I'm trying to set the text in a textfield to be right-aligned, as it is a number textfield. I'm trying to do this with awt only (as opposed to Swing).
As our number system is Arabic, I figured on doing the following:
<code>
txtfld.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
</code>
However, that didn't do the trick, though I'm deuced if I know why!
Any other suggestions?
Cheers

DrClap wrote:
...Arabic numerals are the ones like 0, 1, 2, and so that are used all over the Western world...Actually, no. I always thought that, too, but I just learned that most Arabic nations use "Arabic-Indic" digits to represent numbers, not the so-called Arabic digits we use in the West (I think I'll just call those "ASCII digits" from now on). However, they are written left-to-right, not right-to-left like the rest of Arabic script. @OP, if this textfield is to contain only digits, you may want to change its internal alignment instead of its orientation. Unfortunately, I don't know how to do that with an AWT TextField.

Similar Messages

  • Is it possible to use tabs to right align text in Muse, as you can in InDesign?

    Can I use tabs to right align text in Muse, as you can in InDesign?
    I have a beauty treatment followed by a price and I want to right align the price, keeping the treatment on the left of the text box.
    Thank you!

    For what would typically be a two column tab stop layout, I'd generally use inline text frames and the Wrap panel.
    Put the price in it's own text frame. Then cut and paste the text frame BEFORE the item name so it's an inline text frame within the text frame containing the descriptions.Using the Wrap panel set it to float to the right. Then select it and set the right offset so it floats outside the right side of the original text frame.
    Start with this.
    Cut and paste the text frame at the start of the item paragraph.
    Choose the third icon in the Wrap panel to cause the item to float to the right of the text frame.
    Turn off the lock for the 4 wrap offset values.
    Adjust the right offset to a negative value so the item is outside the text frame to the right (to wherever you want it).
    Repeat the same steps above for the other items.
    Note that once it's set up this way you can freely edit the descriptions or change the width of the original text frame and the prices will adjust accordingly. This will also result in things lining up in the browser even if the text layout engine of a specific browser line breaks the text differently.
    This approach is tedious, but the end result will continue to line up as you make changes in Design view and will line up in every browser/OS/device.
    Someday Muse will support tables, which would be the more natural way to achieve this style of layout on the web. Until then, inline items with wrap is usually the best approach for this type of two column layout.

  • How to right align text in JTextArea

    Can u plz tell me how to right align text in JTextArea

    what do you mean by align text in java you mean you have a default text that align in the center is it?
    can you please explain ur question clearly
    Thanks

  • Spaces on right aligned text

    Our users are trying to use spaces as padding for right aligned text but it isn't working.
    I did a test with the same text in two different right aligned text holders, the second container contains the text that was in the first container as well as several non-breaking spaces at the end.  When I debug the results of StringTextLineFactory.createTextLines the widths of both text lines were the same.
    This seems like it is a FTE issue since FTE has no concept of right aligned text I could see it just dropping off extra spaces at the end of the text but that is just a guess.
    It also looks like RichEditableText does the same thing.  In this video i enter "asdf" then a bunch of spaces and it isn't until I enter another character that the space characters are recognized. http://screencast.com/t/NGMzZmNk

    We do have a control for using paddingEndIndent but users will be users and they wanted to use spaces.  I didn't realize that this functions the same way as the major text engines.
    Thanks for the clarification.

  • How to set alignment in a TextField?

    I need to set allignment of the text in a TextField to right. There is no such under TextField.
    Anybody knows how to set alignment in a textfield in javaFX 2.0 ?
    Thanks

    It may be worth filing a feature request jira to get platform native support for this.
    You might think that textField.setStyle("-fx-text-alignment: right;") would work, but it does not.
    I guess that the -fx-text-alignment css property only right aligns multi-line text, not text within a text field.
    The following code uses binding to keep Text in a TextField right aligned.
    The translations place the text visually right and keyboard editing is OK.
    Mouse transparency is enabled because mouse based selections still act as though the text is left aligned.
    So it's not a complete solution.
    public void start(final Stage stage) throws Exception {
      // create a text field.
      final TextField textField = new TextField("This is right aligned text");
      textField.setStyle("-fx-text-alignment: right;");
      textField.setMinWidth(400);
      textField.setMouseTransparent(true);
      // layout the scene.
      final VBox layout = new VBox();
      layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 10; -fx-alignment: center;");
      layout.getChildren().addAll(textField);
      Scene scene = new Scene(layout);
      stage.setScene(scene);
      stage.show();
      // keep the text in the textbox right aligned.
      final Text text = (Text) textField.lookup("Text");
      rightAlign(text, textField);
      textField.textProperty().addListener(new InvalidationListener() {
        @Override public void invalidated(Observable observable) {
          rightAlign(text, textField);
    private void rightAlign(Text text, TextField textField) {
      text.getParent().translateXProperty().bind(textField.widthProperty().subtract(text.xProperty().multiply(2)).subtract(text.getLayoutBounds().getWidth()));
    }

  • Problem with formatting text in textobjects with right aligned tabulators

    Post Author: Jens Kluesener
    CA Forum: General
    HiI want to print out some values in a line. So I put a Textobject in the Report with some right aligned tabulators (left aligned tabulators working fine). Then I insert a formula. In this formula i do this:"1"chr(9)"2"chr(9)"3"chr(9)"4"chr(9)"5"chr(9)"6"chr(9)"7"Look:            Many ThanksJens

    I think i found why.
    There was no problem with TextField.
    There was a problem with Array. "CityArea"
    So each time I executed script it added new string in Array. And that is because i got like:
    TextField
    City 1
    City 2
    City 1
    City 2
    Running this script is Ok:
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    But outside of this for loop there is another for loop for adding Cities in CityArray.
    I fixed it by adding empty array at the start of function
    function myFunc():void
    CityArea = [ ]; // Empty array fixed this issue
    // LOOP FOR ADDING SHOPS IN CITY AREA
    for (var j:int = 0; j < _Shops; j++)
    CityArea.push(_Shop);
    // FOR LOOP TO ADDING SHOPS IN STRING
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    Thank you for your help kglad

  • Why is InDesign6 rendereing left-aligned text as right-aligned?

    I have a Word Document and we're feeding it to InDesign 5.5 and InDesign 6. The text are left-aligned and were rendered as such by 5.5. InDesign 6 renders it as right-aligned. I'm not sure why this is happening!
    Microsoft Word
    Indesign 5.5
    InDesign 6

    ^ I don't think so. I'm on a trial version that I downloaded from the english site.

  • Bulleted text with a right-aligned tab with a line leader...

    I am using Pages '09 and am trying to have a tabbed line after bulleted text. I can do this in Word '11...set a right-aligned tab with a line leader then tab at the end of the text and it adds a line. When I tab after text in Pages, it indents the bullet.

    Do two paragraph breaks and then delete the lat one. Now you can do the  tabbed line

  • How do I use align="right" for text in a dl environment?

    I use a <dl> environment to control vertical line spacing extensively (thousands of pages).  Here is the objective:
    But I also need to have generation numbers, e.g. "2.2.1" right aligned on a defined width page.  I have tried various ways of achieving this using <div>, <span>, etc.  Each has unintended consequences.  The above is created using <table> in the <dt> line.  But W3C validator objects every time. 
    Here is my script:
    Or, if this is easier to read:
    <dt class="type_U_XXX"><table width="720" border="0" cellpadding="0">
      <tr>
        <td width="680">Johann Peter Bayer (*23.10.1716 Undenheim)</td>
        <td width="40" align="right">2.2.4</td>
      </tr>
    </table></dt>
    <dd class="col_0">Taufpate war Johann Peter Cohn, Gau-Odernheim.</dd>
    <dd class="col_0">Johann Peter Bayer war von 1751-1788 St.Albans-Hofmann in Undenheim.  Er ist als "hervorragender und emsiger Mann" und als "der Hof-Peter" überliefert.  Am 04.02.1744 heiratete er in Undenheim <i>Anna Catharina Dapper aus Sörgenloch</i>.  Trauzeugen waren Joh. Mathäus Bayer und Joh. Peter Dapper.<br /><br /></dd>
    <dt class="col_1">Kinder: (13)</dt>
    <dt class="type_U_XXXsX"><table width="680" border="0" cellpadding="0">
      <tr>
        <td width="640">Johann Mathäus Bayer (*03.04.1745, +02.10.1746 )</td>
        <td width="40" align="right">2.2.4/1</td>
      </tr>
    </table></dt>
    <dd class="col_1">Taufpate war Joh. Mathäus Lahr.<br /><br /></dd>
    How can I right-align the numbers in a <dl> environment?  It has to be in the <dt> line, not the <dd>.  Using the <dd> line indents the left margin, which is not acceptable. 
    Thanks for your help.  Please be very explicit.  Please show me the line or two of script that is needed, don't just say for example, use a <div>.

    I love your use of the definition list   However, nesting <table> in <dt> is obviously not good.
    HTML
    <dl>
            <dt>
                <div class="name">Johann Peter Bayer (*23.10.1716 Undenheim)</div>
                <div class="id">2.2.4</div>
            </dt>
            <dd>
                <p>Taufpate war Johann Peter Cohn, Gau-Odernheim.</p>
                <p>Johann Peter Bayer war von 1751-1788 St.Albans-Hofmann in Undenheim.  Er ist als "hervorragender und emsiger Mann" und als "der Hof-Peter" überliefert.  Am 04.02.1744 heiratete er in Undenheim <em>Anna Catharina Dapper aus Sörgenloch</em>.  Trauzeugen waren Joh. Mathäus Bayer und Joh. Peter Dapper.</p>
            </dd>
            <dt>
                <div class="name">Johann Peter Bayer (*23.10.1716 Undenheim)</div>
                <div class="id">2.2.4</div>
            </dt>
            <dd>
                <p>Taufpate war Johann Peter Cohn, Gau-Odernheim.</p>
                <p>Johann Peter Bayer war von 1751-1788 St.Albans-Hofmann in Undenheim.  Er ist als "hervorragender und emsiger Mann" und als "der Hof-Peter" überliefert.  Am 04.02.1744 heiratete er in Undenheim <em>Anna Catharina Dapper aus Sörgenloch</em>.  Trauzeugen waren Joh. Mathäus Bayer und Joh. Peter Dapper.</p>
            </dd>
    </dl>
    CSS
    dl {
    width: 720px;
    dl > dt > div.name {
        float: left;
        width: 680px;
    dl > dt > div.id {
        float: left;
        padding: 0 0 0 10px;
        width: 30px;
    dl > dd {
        clear: left;
    You may need to tweak the CSS a bit but you get the general idea.
    Kenneth Kawamoto
    http://www.materiaprima.co.uk/

  • How to align text(left, right or center) on a button?

    I can not figure out how to align text on a button,
    could someone help me out?
    Thanks in advance

    JButton btn=new JButton("hi");
    btn.setHorizontalAlignment(int i)
    i=0 center
    i=2 left
    i=4 right

  • How to set alignment of the TextField

    What method I shall use to set is the alignment of the TextField to have is Right Aligned?
    Regds
    Jay

    I've found:
    public void setComponentOrientation(ComponentOrientation o)Sets the language-sensitive orientation that is to be used to order the elements or text within this component. Language-sensitive LayoutManager and Component subclasses will use this property to determine how to lay out and draw components.
    At construction time, a component's orientation is set to ComponentOrientation.UNKNOWN, indicating that it has not been specified explicitly. The UNKNOWN orientation behaves the same as ComponentOrientation.LEFT_TO_RIGHT.

  • Aligning Text in Center of JTextArea

    This is a part of my previous question.
    Is there a way of aligning text, left-center-right in the JTextArea.
    Someone had mentioned JTextPane for aligning Text in the center. What is the code for this?
    Thanks again for your help.

    I'm sorry. I am new at Java so some of these concepts that may be clear to you aren't as obvious to me.
    I inserted the code as you instructed. However, I am not sure if I have to include something else.
    Please advise:
    import javax.swing.*;
    public class HelloClassTwoLine
    public static void main(String args[])
    JTextArea outputTextArea = new JTextArea(); //Create listbox object
    JScrollPane scroll= new JScrollPane(outputTextArea); //create vertical scroll object
    ===> added to original code JTextField textField=new JTextField();
    ===> added to original code textField.setHorizontalAlignment(textField.CENTER);
    outputTextArea.setText("Hello, This is Java 374\n" + //set text in list box
    "This is Java 374 with Ravi");
    JOptionPane.showMessageDialog(null, scroll, //text is argument in JScrollPane object
    "Java Program #2", JOptionPane.INFORMATION_MESSAGE);
    System.exit(0);
    thank you again for your help
    }

  • [SOLVED] Howto right-align af:InputListOfValues

    Hi,
    JDEV 11g, TP4.
    I'm not able to right align the content of the af:inputListOfValues.
    I have tried styleclass, skinning and inline-style with no success.
    inlineStyle="text-align:right;">
    Is this a bug or my mistake ?
    regards
    Peter
    Message was edited by:
    hofespet

    Hi,
    inlineStyle only works on the root DOM object. If a component is complex then the CSS might not be applied to the textfield but some surrounding fragment. In this case you would need to use skinning
    Frank

  • Table numbers in a column to Right alignment

    Hi All,
    I have a table like the below.
    Age (Years)
    1985
    1998
    2007
    1–4
    52
    35
    29
    5–14
    26
    20
    15
    15–24
    102
    82
    80
    25–44
    167
    161
    144
    45–64
    875
    680
    661
    65–74
    2,848
    2,495
    2,059
    75–84
    6,399
    5,703
    5,164
    Over 85
    15,224
    15,111
    12,947
    I want to decimal align the 2nd,3rd,4th column using javascript.
    Paginators are manullay using tab stops and adjusting the "Align to Decimal Tab"
    But I want to do it in javascript
    Help me...

    Hi, Maheshwara:
      Your question's a bit confusing, because your example does not show any decimal points! Perhaps it would be good for you to show a screenshot from InDesign with Hidden Characters enabled and the Tab ruler visible so we can see what is going on.
    What do you want to do, though? My guess is you want to right-align the text, then go through and find the entry with the most characters to the right of a decimal point and set a decimal tab based on that entry, and apply it to the entire column. Sounds pretty easy!
    Are you stuck? What's the problem? How far have you gotten? Do you know Javascript?

  • Right alignment of Number Field in OAF Page

    Hi,
    I need to right align the column of the table which is of number type in OAF page. I have extended the VO of that page to add new columns. After VO extension i added the column to the page via personalization and gave the reference of view attribute name as per Extened VO. I have set the following properties for that column
    Item Sytle- Message Style Text
    Data Type- Number
    Nowrap=false
    Vertical Alignment=Middle
    View Attribute = Prior (same as Extended VO's column)
    View Instance = XXPayEmpAccrualActionInfoVO
    I need to set the value of this newly added column right align which is currently set as left align by default.
    I have tried the following links from OTN
    Re: Q: How to format number using personalization?
    Right align number field
    but while controller extension i m getting the following error-
    Message not found. Application: FND, Message Name: FND_VIEWOBJECT_NOT_FOUND. Tokens: VONAME = XXPayEmpAccrualActionInfoVO; APPLICATION_MODULE = oracle.apps.pay.selfservice.payslip.US.server.PayPayslipAM;
    The extended controller code is -
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OATableBean tableBean = (OATableBean)webBean.findIndexedChildRecursive("PayPayslip4Ss");
    tableBean.queryData(pageContext, true);
    tableBean.prepareForRendering(pageContext);
    DataObjectList aColFormat01 = tableBean.getColumnFormats() ;
    oracle.cabo.ui.data.DictionaryData ColFormat01 =(oracle.cabo.ui.data.DictionaryData)aColFormat01.getItem(pageContext.findChildIndex(tableBean, "Prior"));
    ColFormat01.put(COLUMN_DATA_FORMAT_KEY,NUMBER_FORMAT);
    Please can anyone provide me some pointer here..this is really urgent.
    Thanks in advance
    Renu
    Edited by: Renu Gupta on Jun 14, 2010 5:15 AM

    Hi Renu,
    Use the following code:
    OAMessageStyledTextBean origContSumBean = (OAMessageStyledTextBean)webBean.findIndexedChildRecursive("<FieldName>");
    if(origContSumBean!=null) {
    origContSumBean.setAttributeValue(CURRENCY_CODE,new OADataBoundValueViewObject(origContSumBean,"CurrencyCode"));
    Here CurrencyCode should be a view attribute in the VO associated to the items in the region.
    Regards
    Sumit

Maybe you are looking for

  • SAP IDOC XML to Flat File Conversion

    Hello, I have downloaded SAP schema through the "Consume Adapter Service" with properties GenerateFlatFileCompatibleIdocSchema = "true" and FlatFileSegmentIndicator = "SegmentType". I am trying to convert IDOC XML into a IDOC Flat File. Though the fl

  • Editor in screen Painter

    hello friends, i hv created text editor in screen painter. when i write some lines in this editor and click on save button. then this text saves temproraly in table. when click on display this text will sees in editor again. upto this it is ok. but w

  • How to make F-02 only can "park" , not "post" .

    Use F-02 to key FI document , how to make it only can "park" , not "post" . I  try to use "PFCG" to find whether any "Authorization object"  to control it ,but i didn't find. anyone can help me ? Thank you ! http://file.itpub.net/forum/201112/07/1518

  • Create Poplist dynamically in Benefits Self Service

    Hi All, I have a requirement , where I have to display few questions (with drop list/pop list with values "Yes/No") . The number of times these questions have to be displayed depends on number of children employee has . I know how to create the popli

  • Acrobat can not open pdf email attachment

    Acrobat 8 Professional.<br /><br />A user gets this error message when he tries to open up a pdf email attachment:<br /><br />"Acrobat could not open <File Name> because it is either not a supported file type or because the file has been corrupted (f