How to set a text in the jTextField to right-align?

when we add a text into a jTextField,normally it start to add them from left to right ,top to bottom.But I want to add a text from the right side instead of the left one.how to achieve that?Thanks in advance!

Read the JTextField API. You will find you can do it like this:
    textfield.setHorizontalAlignment(SwingConstants.RIGHT);http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JTextField.html

Similar Messages

  • How to attach a text in the center of the Ellipse using JXML ?

    How to attach a text in the center of the Ellipse using JXML ? Can we use labelFor="$topEllipse" ?
    <StackPane fx:controller="myfxml.ArchiveLogsController" id="Login" xmlns:fx="http://javafx.com/fxml">
    <children>
    <AnchorPane>
    <!-- Prevent AnchorPane so that it's max = pref. This causes it to center in StackPane -->
    <maxWidth><Double fx:value="-Infinity"/></maxWidth>
    <maxHeight><Double fx:value="-Infinity"/></maxHeight>
    <children>
    <Ellipse fx:id="topEllipse" centerX="100" centerY="100" radiusX="50" radiusY="10" strokeWidth="2" stroke="#FF0000" style="-fx-fill: linear-gradient(to right, white 0%, red 100%);"/>
    *<Label fx:id="ArchLogs_lb" text="My Ellipse Label" />*
    </children>
    <properties>
    <backgroundColor>
    <Color blue="1.0" green="1.0" red="1.0" />
    </backgroundColor>
    <elementLockSel>
    <Boolean fx:value="true" />
    </elementLockSel>
    </properties>
    </AnchorPane>
    </children>
    </StackPane>

    I'd suggest putting the Ellipse and the Label in a StackPane.
    I wonder why so many people call it JXML?
    It is so strange - I guess the JXML name just seems more natural to some people, though I don't know why.
    I think Greg is right and that labelFor is not what you want:
    http://docs.oracle.com/javafx/2.0/api/javafx/scene/control/Label.html
    "Labels also are useful in that they can have mnemonics which, if used, will send focus to the Control listed as the target of the labelFor property . . . A Label can act as a label for a different Control or Node. This is used for Mnemonics and Accelerator parsing. This allows setting of the target Node."

  • How to set white spaces between the fields in dataset??

    Hi all,
    I am writing a set on information to from infotypes to a text file. Its a fixed width file. How do set white spaces in the fields for dataset?
    Example:
    TYPES: begin of header,
                    filler(40)  type c,
                    id(3)        type c,
                    filler2(7) type  c,
                    delimiter  type  c,
                 end of header.
    DATA header type header.
    header-filler1 = ' '.
    header-id       = '100'.
    header-filler2 = ' '.
    header-delimiter = cl_abap_char_utilities=>newline.   ( do it to get a new line)
    my_table = header.
    append my_table.
    DATA: out_file(256) type C,
          codepage_ref type ref to CX_SY_CONVERSION_CODEPAGE,
          out_char type c,
          size type i,
          insert_string type string,
          insert_size type i.
      out_file = filename.
      open dataset out_file for output in text mode ENCODING NON-UNICODE.
      LOOP AT my_table.
        size = strlen( my_table ).
        insert_string = ''.
        DO size TIMES.
          offset = sy-index - 1.
          try.
              out_char = my_table+offset(1).
              IF out_char = SPACE.
                CONCATENATE insert_string '' INTO insert_string SEPARATED BY SPACE.
              ELSE.
                CONCATENATE insert_string out_char INTO insert_string.
                transfer insert_string to out_file NO END OF LINE .
                insert_string = ''.
              ENDIF.
            catch CX_SY_CONVERSION_CODEPAGE.
              insert_size = strlen( insert_string ) - 1.
              insert_string = insert_string(insert_size).
          endtry.
        ENDDO.
       transfer CL_ABAP_CHAR_UTILITIES=>NEWLINE TO out_file NO END OF LINE.
      ENDLOOP.
      close dataset out_file.
    How do I get to insert the space for filler1 and filler2?
    Edited by: Siong Chao on Oct 4, 2011 4:56 AM
    Edited by: Siong Chao on Oct 4, 2011 8:27 AM
    Edited by: Siong Chao on Oct 4, 2011 8:29 AM

    problem lies in the open dataset codes
    Used:
    open dataset out_file for output in text mode encoding non-unicode message msg.
    if sy-subrc= 0.
    loop at my_table.
    transfer my_table to out_file
    transfer cl_abap_char_utilities=>newline to out_file no end of line.
    endloop.

  • How to sending simple text in the mail body

    Hi friends,
                 How to send simple text in the mail body through ABAP code
       plz send me the related code and setting for that mail.
      Thanks&Regards,
      Srinivas

    try this...
    FORM send_file_as_email_attachment .
      DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
      DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
      DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
      DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
      DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
      DATA : i_body TYPE soli_tab WITH HEADER LINE.
    DATA: it_attach LIKE it_display1 OCCURS 0 WITH HEADER LINE.
      DATA: doc_chng LIKE sodocchgi1.
      DATA: tab_lines LIKE sy-tabix.
      DATA: att_lines TYPE i.
    DATA: lv_lines TYPE i.
      DATA: file TYPE string.
      data: g_datum like sy-datum.
      data: g_datum1(10) type c.
      DATA: len TYPE n.
      LOOP AT it_email.
        CLEAR : objpack,
                objhead,
                objbin,
                objtxt,
                reclist.
        REFRESH: objpack,
                 objhead,
                 objbin,
                 objtxt,
                 reclist.
        g_datum =     sy-datum - 1.
        concatenate g_datum6(2) '.' g_datum4(2) '.' g_datum+0(4) into
        g_datum1.
    doc_chng-obj_descr = 'Aged Stock more than 45 Days'.
        CONCATENATE 'Aged Stock more than 45 Days' '-' it_email-vkbur INTO
        doc_chng-obj_descr.
        CONCATENATE 'Please find enclosed Aged Stock Details ( >45days ) report as on'
        g_datum1
        INTO objtxt-line SEPARATED BY space.
        APPEND objtxt.
        objtxt-line = ' '.
        APPEND objtxt.
        objtxt-line = 'Regards'.
        APPEND objtxt.
        objtxt-line = 'LIS SAP Projects'.
        APPEND objtxt.
        objtxt-line =
        'PS: Pls send feedback for futher improvements to SAP office.'.
        APPEND objtxt.
        DESCRIBE TABLE objtxt LINES tab_lines.
        READ TABLE objtxt INDEX tab_lines.
        doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
       CLEAR objpack-transf_bin.
        objpack-head_start = 1.
        objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines.
        objpack-doc_type = 'TXT'.
       objpack-obj_name = 'Run_prog'.
       objpack-obj_descr = 'Agestock.txt'.
       lv_lines = tab_lines.
        APPEND objpack.
    *CONCATENATE 'Plant'   'Material Number' 'Qty(More than 45days)'
    *'Amount' INTO
           it_display SEPARATED BY space.
           append objbin.
           clear: objbin.
        CLEAR:it_display2.
        REFRESH it_display2.
        it_display2-werks = 'Plant|'.
        it_display2-matnr = 'Material Number'.
        it_display2-qty = '|Qty > 45 days'.
        it_display2-amount = '      |Amount'.
        APPEND it_display2.
        it_display2-werks = ''.
        it_display2-matnr = ''.
        it_display2-qty = ''.
        it_display2-amount = ''.
        APPEND it_display2.
        CLEAR : it_display2.
        sort it_display1 by amount descending.
        LOOP AT it_display1 WHERE werks = it_email-vkbur.
         AT FIRST.
    *CONCATENATE 'Plant    '   'Material Number' 'Qty(More than 45days)'
    *'Amount' INTO
           objbin-line SEPARATED BY space.
           append objbin.
           clear: objbin.
         ENDAT.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              input  = it_display1-matnr
            IMPORTING
              output = it_display1-matnr.
          it_display1-qty = TRUNC( it_display1-qty ).
          MOVE-CORRESPONDING it_display1 TO it_display2.
          APPEND it_display2.
          CLEAR:it_display1,it_display2,objbin.
          CLEAR:it_display1.
        ENDLOOP.
        objbin[] = it_display2[].
        DESCRIBE TABLE objbin LINES tab_lines.
        objhead = 'Suug'.
        APPEND objhead.
        objpack-transf_bin = 'X'.
        objpack-head_start = 3.
        objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines.
        objpack-doc_type = 'RAW'.
        objpack-obj_name = 'Run_prog'.
        objpack-obj_descr = 'Agestock.txt'.
        APPEND objpack.
        reclist-receiver = '[email protected]'.
        reclist-rec_type = 'U'.
        APPEND reclist.
    =====================================================================
        CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
          EXPORTING
            document_data              = doc_chng
            commit_work                = 'X'
          TABLES
            packing_list               = objpack
            object_header              = objhead
            contents_bin               = objbin
            contents_txt               = objtxt
            receivers                  = reclist
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            operation_no_authorization = 4
            OTHERS                     = 99.
        CLEAR : it_email.
      ENDLOOP.
    ENDFORM.                    "send_mail
    Message was edited by:
            Sugumar Ganesan

  • How Do I Wrap Text Like the iOS Camera App?

    Hello. I am in yearbook, and I have been challenged with designing the cover of the yearbook, and I have been having a few problems along the way. One of these problems is to wrap text. Specifically, I'm stuck on how I would wrap text like the iOS camera app on the bottom of the screen. The words seem like they are wrap around a 3D object to give it that effect, but I can't really tell. If anyone can help me, it would be greatly appreciated.

    JJMack wrote:
    There is a big difference between being a casual user than real work or development. I own a iPod its a great MP3 player and a device I can display my pictures on out of my pocket. I'll even Facetime my kids at time to see my grand kids or help fix something.  My wife has a mini iPad for quick internet access and quire music and uses her iPod to entertain our two year old grandson with games.   She uses a Canon 1D mark 4 and I a Cannon 1D mark II.  The only use the iPad and iPod cameras get is Facetime. No iOS apps are use to work on images  they have no value when you have Photoshop. The iPod is better for displaying image then the iPad mini it has a 3:2 aspect ratio display and travels better the the mini iPad which has a 4:3 aspect ratio display.  I also crop image for display on wall mounted HDTV. The iPad is better for casual internet access then the iPod. All our kids have iPhones and they all use computers either Mac or PC for work and internet access.  When you have a Unix or Windows why would you want to touch an iOS device for work or serious internet access.  Apple mobile devices are convenient for casual use and grand kids don't get that dirty finger painting on them as they do using real paint. Nothing of real value is maintained on an iOS device.
    Well...there's Photoshop Touch and Photoshop Mix as well as Lightroom Mobile. It could be argued that they're don't exactly mirror their desktop cousins, yes, but they weren't meant to be. They were meant as extensions to the desktop experience.  (e.g., Lightroom Mobile lets one work with the RAW images they have in their Lightroom desktop collections.)
    The more powerful Windows tablets can run Photoshop desktop (like Photoshop CC) too.
    @bluebocat: Are you looking for text with a perspective? Like it has a vanishing point? As if it was turned in a certain direction in 3D space?

  • How to rotate a text in the adobe reader for mobile ios ?

    how to rotate a text in the adobe reader for mobile ios ?

    There's no rotate command to rotate the document. Instead, rotate the iPad. If it doesn't rotate, turn off the Rotation Lock switch on the side of your iPad.

  • How do i put text in the picture

    how do i put text in the picture ?

    In addition to the apps already mentioned here are some that can add text to a photo:
    Some Image Editors That Support layers:
    Photoshop Elements 11 for Mac - $79
    GraphicConverter - $40
    Rainbow Painter - $30
    Imagerie - $38
    Acorn - $50
    Pixelmator - $60
    Seashore - Free
    GIMP for Mac - Free
    Xee 2.1 - free

  • How do I justify text at the end of a column

    How do I justify text at the end of a column In Pages?
    Also, is there any way to sort a document (alphabetically by the first word of each paragraph) that is not in a table?

    RTPLaw writes:
    How do I justify text at
    the end of a column In
    P    a    g    e    s     ?
    Also, is there any way
    to   sort  a  document
    (alphabetically by the
    first   word   of   each
    paragraph) that is not
    in         a         table?
    No. Like Peter and Walt, I wonder why you'd want to, considering the appearance of such manipulation, illustrated above. Is this a requirement for some specific type of document?
    Regarding your second question, there's no way to do this using Pages as it comes out-of-the-box (or in the downloaded edition). But you can sort the paragraphs of a document alphabetically using WordService, freeware from Devon Technologies. The link will take you to their download page. Scroll down to the Freeware section and the download link for WordService.
    Regards,
    Barry

  • How can i highlight text in the Adobe Difital Editions?

    How can i highlight text in the Adobe Difital Editions?

    You have to remember that Digital Editions was never designed to have 'text
    editor' capabilities.  BTW: Bluefire and Overdrive also have such
    limitations.  Put in another frame of reference, DE presents you with the
    ebook, as you would be presented with a physical printed book.
    ==============

  • How to set a song in the playlist to be phone ringtone

    how to set my song in the playlist to be my ringtone

    you have to convert it to a ringtone first. searching google will give you many ways to do it. also, there are some ringtone apps with pros and cons to each one. you cannot just pick a song on your phone and make it a ringtone unfourtunately.

  • How to set a cookie in the browser from an html page called via an Iview

    How to set a cookie in the browser from an html page called via an Iview
    Hello all,
    I have an issue which is causing problems. I have a snap survey (html form with submit and cookie setting) which is embedded in a url iview.
    Although the submit and the form work fine, the portal will not allow the cookie to be set it seems.
    Is there a way to allow cookies to be set from an embedded page in a url iview??
    You will make my day if you know!
    System: EP7 SP13
    Kind regards
    Alex

    Hi,
    Check this:
    http://www.oracle.com/technology/products/ias/portal/html/same_cookie_domain_with_pdkv2.html
    Cookie Basics
    Web browsers have built in rules for receiving and sending cookies. When a browser makes a request to a web server and the web server returns cookies with the response, the browser will only accept a cookie if the domain associated with the cookie matches that of the original request. Similarly, when a browser makes a subsequent request, it will only send those cookies whose domain matches that of the target web server.
    These rules are designed to ensure that information encoded in cookies is only "seen" by the web server(s) that the originator of the cookie intended. These rules also ensure that the cookie cannot be corrupted or imitated by another server. By default, the domain associated with a cookie exactly matches that of the server that created it. However, it is possible to modify the domain at the time the cookie is created. Relaxing the cookie domain increases the scope of the cookie's visibility making it available to a wider "audience" of web servers.
    For example, if a cookie is created by a.us.oracle.com, it's domain will usually be set to a.us.oracle.com. This means that the browser will only send the cookie to a.us.oracle.com. It will never send it to any other servers. However, if at the time of creation, the domain of the cookie is set to .us.oracle.com, the browser will send the cookie to any server whose domain falls within .us.oracle.com. such as portal.us.oracle.com, provider.us.oracle.com, app.us.oracle.com etc
    Regards,
    Praveen Gudapati

  • TS4006 how to set a tracking from the computer if someone stolen the ipod

    how to set a tracking from the computer if someone stolen the ipod

    Welcome to the Apple Community.
    You can only locate your device when it is logged into iCloud and 'Find My Phone' is enabled, additionally the device will need to be switched on and connected to a wifi or cellular network.
    Unfortunately, you cannot activate iCloud or 'Find My Phone' remotely.

  • How to set Where clause in the View Object of the MessageChoice ?

    Hi,
    How to set Where clause in the View Object of the
    MessageChoice ?
    Example:
    <bc4j:rootAppModuleDef name="EdEscolaCampusView1AppModule"
    definition="ed00050.Ed00050Module"
    releaseMode="stateful" >
    <bc4j:viewObjectDef name="EdEscolaCampusView1" >
    <bc4j:rowDef name="CreateEdEscolaCampusView1" autoCreate="true" >
    <bc4j:propertyKey name="key" />
    </bc4j:rowDef>
    </bc4j:viewObjectDef>
    <bc4j:viewObjectDef name="ListaTipLocalView1"
    rangeSize="9999">
    </bc4j:viewObjectDef>
    </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    messageChoice declaration:
    <bc4j:messageChoice name="SeqTipoLocalCampus"
    attrName="SeqTipoLocalCampus"
    prompt="Local do Campus">
    <contents>
    <bc4j:optionList attrName="SeqTipoBasico"
    textAttrName="NomTipoBasico"
    voName="ListaTipLocalView1"/>
    </contents>
    </bc4j:messageChoice>
    I would like set where clause of ViewObject, with dinamic parameters (using attribute1 = :1), before populate messageChoice.
    thanks...
    Danilo

    Hi Andy,
    I try set a where clause using the message:
    Set where Clause parameter using UIX , but my UIX Page have 2 messageChoice's of different ViewObject's, then I need implement this Java Class:
    //Nome da Package da Tela Detail
    package br.com.siadem.siaed.ed00050;
    // Importa as Bibliotecas necessárias
    import oracle.jbo.ViewObject;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.client.Configuration;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.servlet.event.PageEvent;
    import oracle.cabo.servlet.event.EventResult;
    import oracle.cabo.data.jbo.servlet.bind.*;
    import oracle.cabo.ui.data.BoundValue;
    import oracle.cabo.ui.data.DataBoundValue;
    import javax.servlet.http.HttpServletRequest;
    import br.com.siadem.siaed.util.*;
    import javax.servlet.http.Cookie;
    import oracle.cabo.data.jbo.def.NestedAppModuleDef;
    import oracle.cabo.data.jbo.def.ViewObjectDef;
    import oracle.cabo.data.jbo.def.AppModuleDef;
    // Classe que configura os parametros para a execução da Query,
    // utilizando variáveis de Sessao
    public class FunPreQueryLista
    public static EventResult FunConfiguraQuery(BajaContext context, Page page, PageEvent event) throws Throwable
    // TrataDadosSessao - Classe utilizada para retornar os valores das variáveis de sessão genéricas
    // Ex: CodCliente, CodMunicipio etc...
    TrataDadosSessao varDadosSessao = new TrataDadosSessao();
    // 1o. Parametro Configurado - Através da classe TrataDadosSessao, utilizando um método Get
    // <alterar>
    String valor1 = varDadosSessao.getCodCliente();
    String valor2 = varDadosSessao.getCodMunicipio();
    //Cria o objeto que retorna o ApplicationModule
    ApplicationModule am = ServletBindingUtils.getApplicationModule(context);
    // Início das Configurações da Query da Lista
    //Cria o objeto que retorna o view object da lista desejada
    //alterar
    ViewObject TipoLocal = am.findViewObject("ListaTipoLocalView1");
    //Configuração dos parametros definidos na query do view Object
    //alterar
    TipoLocal.setWhereClauseParam(0,valor1);
    TipoLocal.setWhereClauseParam(1,valor2);
    // Executa a Query
    TipoLocal.executeQuery();
    // Fim das Configurações da Query da Lista
    // Início das Configurações da Query da Lista
    //Cria o objeto que retorna o view object da lista desejada
    //alterar
    ViewObject TipoDestLixo = am.findViewObject("ListaDestinoLixoView1");
    //Configuração dos parametros definidos na query do view Object
    //alterar
    TipoDestLixo.setWhereClauseParam(0,valor1);
    TipoDestLixo.setWhereClauseParam(1,valor2);
    // Executa a Query
    TipoDestLixo.executeQuery();
    // Fim das Configurações da Query da Lista
    // Retorna o Resultado para a Página
    return new EventResult(page);
    The code works very well...
    And, I'm sorry for my two repost's in UIX Forum about this in a few time.
    Thank very much...
    Danilo

  • How to set default values on the screen painter parameters?

    Hello ABAP Gurus,
    I would just want to ask how to set default values on the screen painter parameters.
    Thank you for your replies.

    Hi,
    To set default values for screen painter parameters initialize the field names with default values in the PBO module....
    say u have the field name as f_field1....
    in the PBO of that screen initialize it....
    f_field1 = '100'  "here 100 is the default value.
    <b>reward points if useful.</b>
    regards,
    Vinod Samuel.

  • How does one put text on the spine?

    I'm a little confused about the difference between the version I'm creating and the template I start with. I start with a template, then resize and mess with the arrangement of the pictures. I move text boxes. All seems okay.
    I put a colored background on the front and back cover (by inserting a specially made pdf from Pages, a gradient color). The back spine remains white, and blank. How can I add text to the spine? And is there a way to have the color from the background bleed over the spine?
    Ben

    I certainly don't know how it was constructed, but I suppose the form was intended for people that use Word. If you were using Word, you would just select the "insert" key (or something - I forget) and type away. The text would type above the line. I thought maybe there was something like that in Pages. I find myself getting very frustrated using Pages and Numbers. They really aren't that easy to use. Word and Excel have them beat.

Maybe you are looking for

  • What to do with Palm Desktop data when I upgrade to Mac OS 10.6 Snow Leopard

    I have an old Tungsten handheld device but only use Palm Desktop on my Mac.  I have a lot of data stored in this format and do not want to lose this functionality when I upgrade to Snow Leopard, which, I understand, does not support Palm Desktop.  Id

  • Select on LONG column

    Hi there, How can I query USER_CONSTRAINTS table in order to get all rows with SEARCH_CONDITION like 'SomeThing%'. SEARCH_CONDITION is a LONG.

  • Choosing applications to open

    Hi all. How can I choose the application to open downloaded files? Whenever I download a windows media file, MPEG Streamclip automatically opens, instead of windows media player, and it won't give me the option to change the default. Any suggestions?

  • Reset Item After Regular Expression Validation Fails

    Apex 4.2 I have a page item (P1_MYITEM) that should only hold alpha charaters, so I have created an item regular expression validation using ^[a-zA-Z]+$ This works well, but now I want to reset my item (P1_MYITEM) to null if the validation fails. Tri

  • Help with firmware installing over and over

    i did the firmware update to 1.9 and now when i restart my computer or shut it down it reinstalls the firmware over and over and the system takes over 5mins to start up ..it has the apple logo and the lil round dot bars going and under that is this l