How do i display text into a JTextfield

hi, am currently using a JLabel to display the results of a calculation in my gui however i want to change it to a JTextField if possible
is it possible to declare a Jtextfield, set it so that it cant accept data of any kind and display a calculation like JLabel after a button is clicked?
any help is welcome

setEditable(false);
setText(calculationResult);

Similar Messages

  • 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

  • How do I put text into an Edge File that clients can edit easily afterwards

    Hi
    Can anyone explain how I can put text into an edge file (styled with google fonts) and make it so that clients can access the text and update the text as they require?
    Previous suggestion was dynamically loading a .txt file - any instructions would be most appreciated.
    Thanks.

    Hi Resdesign!
    Your code is very useful to learn how to use Json in Adobe Edge Animate!
    But I have a question: why you use ( i ) as argument of the function UpdateInfo and when you recall it you use ( index )?
    $.getJSON('slides.json', function(data){
              //for(var i=0; i<data.length; i++){
    function updateInfo(i){
                        sym.$("photo").css({"background-image": "url('"+data[i].image+"')"});
                        sym.$("pillar").html(data[i].pillar);
                        sym.$("what").html(data[i].what);
                        // position
              index = -1;
              sym.$("btn").click(function(){
              index++;
                        if (index>=5){
                                  index = 0;
              updateInfo(index);
    Many thanks for your attention!
    Davide

  • "How do you turn text into a hyperlinx can't find menu at top in Muse

    "How do you turn text into a hyperlinx can't find menu at top in Muse

    Hello,
    In order to turn a tet into Hyperlink, you first need to select the text and then in the toolbar look for "Links" option. Click on the dropdown and either select one of the pages or type in your own link.
    Please have a look at the video below : http://trainingwebcom.worldsecuresystems.com/SachinFTP/2013-02-15_1945.swf
    Hope this helps.
    Regards,
    Sachin

  • How to set the text in a jtextfield to align to the left

    A quick simple question. I'm populating a jtextfield with text pulled from a record. However the text is too long to fit in the jtextfield and the alignment is set to the right rather than the left. How do I set the alignment of the text in the jtextfield to be on the left, so that the first character of the string is shown?
    I've tried using
    setHorizontalAlignmnet(JTextField.LEFT),
    but my text still appears right justified in the jtextfield. It means that the user has to scroll the text to go to the beginning of the string, rather than the usual of scrolling the right to go the end of the string.
    This has really gotten me stumped!

    HI thanks for the help. Unfortunately it doesn't work if the text is longer than the actual textfield. The textfield would still show the end of the text, rather than showing the beginning of the text.
    For e.g.
    |est text|
    is show rather than
    |test tex|
    which is my desired result.
    Any further suggestions please.

  • HT2488 How to I insert text into a this command in automator wine "Text goes here" this is a perl script

    I have spent hours trying to figure this out, automator is the hardest thing to figure out. All I want to do is emulate me doing this
    -Open terminal
    -type wine
    -drag and drop the location of an .exe file
    -hit enter
    Now this should be easy as all I have to do is do run shell script, insert argument and done, BUT IT DOESNT RECOGNIZE WINE!?!?! Pleas help me.
    Let me clarify.
    If I make an automator application that that runs the command "wine" and then inserts text into the space after that Then i will be set. But no matter what I do nothing works. If i set the shell to perl and pass input as argument....It doesnt work the $f and $@ stuff doesnt work.
    Wine is likely not recognized because is is pearl based so I set it to pearl, but how do i pass and argument over to it?

    Try
    /opt/local/bin/wine "$@"
    The "..." will protect the white space, but still allow $variable subsitutions.
    The $@ will substitute all the files you drag as a group to your Automator app.
    The notation "$@" does the substitution with each file properly quoted to protect the white space in the file path, but provide each file as its own quoted argument to the 'wine' command line.
    If you need to invoke 'wine' once for each file of a group of files you drag on to your automator app, then use
    for f in "$@"
    do
         /opt/local/bin/wine "$f"
    done
    This will loop through each file of a group of files you drag onto your automator app, and invoke 'wine' once for each file in the group.

  • HT2234 How do I save text into my iPod's Notes? I read the instructions and there is no Notes Folder in my iPod.

    I would like to put texts into my iPod's Notes. I received instructions from Apple, BUT I'm totally lost. There is no Notes Folder in my iPod. ANYONE PLEASE HELP!

    Hi Niel,
    Create a folder like if it were a playlist folder? I'm so lost...create a folder where?

  • How to programatically display text in combo box?

    Is there a way to programatically display text in a combo box.  I would like to display the word "Select" in the combo box each time my program starts.  As it is now, my combo box displays the last string that was selected the last time the program ran.
    Thanks in advance.
    Solved!
    Go to Solution.

    Actually, after actually reading your post...
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • How to pass line text into string of 72 characters

    Hi,
    I need to to pass  material text lines to a file for processing into different SAP system.
    Currently i am having multiple text lines stored in an internal table. I am looping that table and checking the string length of a first line.If it is less than 72 characters then i need to add spaces at the end of the text and make it 72 and pass it to workarea-field.
    However, while passing the next line text it is overwriting the spaces of first line and that is making the text meaning difficult to understand when passed to the other SAP system.
    Let me know how to approach.
    Thanks,
    Ankur

    Hi,
    This will not work as it splits the text as per the position.
    However what i would need is if i am entering text like this.
    Material ABCD --> Line 1
    This is finished product 9-series material used for high-value equipments. ---> Line 2
    Currently,  when transferring this data over the file it goes to the other system as
    Material ABCDthis is finished product---> upto 72 characters
    9 series material used for high-value ---> upto 72 characters
    equipments.
    So if there is less than 72 characters in the first line it takes 2nd line text. However it is ok if the text has more than 72 characters as it goes into the next line and still makes the meaning intact.

  • ID CS5: How to include additional text into a table of contents and how to hide text from it?

    I have the following problem:
    1. I'd like to include additional Information in my table of contents which I don't want to appear in the text I refer to.
    Example: I do have a picture with a caption saying:
    picture 1: Blablabla.
    And I want to have the source of the picture as additional information in the table of contents:
    picture 1........Blablabla (source: thisandthat)........23
    Still I don't want this additional content to disappear, as soon as I update the table of contents!
    How can I achieve that?
    2. And how can I have this the other way round?
    Let's say I want the source in the caption, but not in the table of contents.
    So the caption says:
    picture1: Blablabla (source: thisandthat)
    but the table of content says:
    picture 1........Blablabla.....................23
    I was trying to achieve this by two different praograph styles in the caption. One which would be listed, and one which wouldn't be listed, but this of course resulted in always having two paragraphs in the caption, which I'd like to avoid:
    picture1: Blablabla
    (source: thisandthat)
    Any solution to this?
    Best Regards,
    Rainer Schwachsinn

    Sorry, missed the second part of the question. I think the only way to do that is to use invisible "dummy" text of some sort, and if you're going to do it for some entries, you might as will do it for all.
    One of the easiest ways is to put the text you want inthe TOC into an anchored frame attached to the actual heading in the text (so it moves along with it). Use a unique paragraph style for this text, and include this style, not the one applied to the headings inthe text, to make the TOC. I usually use a character color of red to make it satnd oout so I don't forget it's there, and the position on the page isn't really critical. Select the anchored frame, open the Attributes panel and make it non-printing. You'll see it in editing mode, the TOC will pick it up (as will variables, if required) but it will disappear on output.

  • How to write the text into text objects

    Hi,
    I have one requirements . from the web we get the delivery line item based pallet numbers info with Quntity .
    How to write the line item level pallet information in the the Delivery line items text element "pallet info" .
    Any function module to write the text data into text elements in SAP like READ_TEXT.
    please give your valuable suggisions .
    Thanks &Regards
    Sai.

    Try:
    CREATE_TEXT
    SAVE_TEXT

  • How to get formatted text into arrays

    Dear experts and helpers,
    For my project I import an RTF file and then read the data from it into 3 arrays. This works fine when just using the string contents of the paragraphs. However, the final script should be able to read and replace formatted text...
    Why use the intermediate arrays? Because otherwise I need to switch back and forth between two fm-documents (and one may be a book component).
    The imported file starts with a number of lines separated into two items by a TAB (» denotes a TAB, in FM \x08)
    [[Garneau, 1990 #12]]    »   [9]
    The right item may also be locally formatted text, e.g. [9]
    Then follow the same (or smaller) number of paragraphs with formatted text like this:
    [9] » D. Garneau, Ed., National Language Support Reference Manual (National language Information Design Guide. Toronto, CDN: IBM National Language Technical Centre, 1990.
    Is it possible to replace in the body of the function below the following piece
      while(pgf.ObjectValid()) {
        pgfText = GetText (pgf, newDoc);
        gaBibliography.push(pgfText);
        pgf = pgf.NextPgfInFlow;
    with this
      while(pgf.ObjectValid()) {
        gaBibliography.push(pgf);
        pgf = pgf.NextPgfInFlow;
    Do I need a special declaration of the array gaBibliography ?
    And how to get the right part of the intro lines as formatted thingy into array gaFmtCitsFmt ?
    Currently I read into arrays only the 'strings' (function GetText not shown):
    var gaFmtCitsRaw  = [];                           // left column in processed RTF
    var gaFmtCitsFmt  = [];                           // right column in processed RTF
    var gaBibliography= [];                           // bibliography lines from processed RTF
    // filename is something like E:\_DDDprojects\FM+EN-escript\FM-testfiles\BibFM-collected-IEEE.rtf
    function ReadFileRTF (fileName) {
      var nCits=0, nBib = 0, openParams, openReturnParams, newDoc, pgf, pgfText ;
      var TAB = String.fromCharCode(8);               // FM has wrong ASCI for TAB
      var parts = [];
      openParams = GetOpenDefaultParams();
      openReturnParams =  new PropVals(); 
      newDoc = Open (fileName, openParams, openReturnParams); 
      pgf = newDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;  // get first pgf in flow
    // --- read the temp/formatted citations 
      while(pgf.ObjectValid()) {
        pgfText = GetText (pgf, newDoc);
        if (pgfText.substring (0,2) == "[[") {        // citation lines start with [[
          parts = pgfText.split(TAB);                 // get the two parts of the line
          gaFmtCitsRaw.push (parts[0]);               // Push the result onto the global array
          gaFmtCitsFmt.push (parts[1]);
          pgf = pgf.NextPgfInFlow;
        } else { break }
    // --- read the bibliography
      while(pgf.ObjectValid()) {                      // until end of doc
        pgfText = GetText (pgf, newDoc);
        gaBibliography.push(pgfText);
        pgf = pgf.NextPgfInFlow;
      newDoc.Close (Constants.FF_CLOSE_MODIFIED);
    } // --- end ReadFileRTF
    The next questions then will be how to modify Ian Proudfoot's FindAndReplace script to handle formatted text as replacement. IMHO i will need to use copy/paste ...

    Klaus,
    Working with text is about the most complicated thing to do within FrameMaker. It seems counter-intuitive, since it is about the easiest thing to do with the GUI. But alas, once you remove the ability to select with a mouse and type with a keyboard, text becomes a wild jungle of complexity.
    Text ranges are not too bad, once you get the general idea. It is just that... a range of text, like something you would select with a mouse. Like a mouse selection, it starts before some character in some paragraph and ends after some character in some paragraph. It may be the same paragraph, which is a selection within a paragraph. The character can even be the same, which is then just an insertion point (cursor) somewhere.
    So, a text range is a data structure that defines two paragraphs and two characters. In the jargon of scripting, the character is called an "offset." An offset is simply the number of characters past the beginning of said paragraph, where 0 is the beginning.
    For example, if you want to capture the first five characters of a paragraph as a text range, you can do this, where 'pgf' is some paragraph object:
    var textRange = new TextRange();
    textRange.beg.obj = pgf;
    textRange.beg.offset = 0;
    textRange.end.obj = pgf;
    textRange.end.offset = 5;
    If you want to capture a whole paragraph, change that last line to the number of characters in the pgf, or you can do this:
    textRange.end.offset = Constants.FV_OBJ_END_OFFSET;
    ...where that constant is just some built-in thing that means "get me to the end of whatever." It's a convenience of the interface.
    I'll also note that a text range is actually just an array of two text location structures, one named 'beg' and one named 'end.' If you think of a text location as defined by paragraph and an offset from the first character, maybe that will make more sense.
    Text item structures are a whole new mess of complexity. I can't possibly go into an explanation of them here.
    I think that many ES developers (definitely myself included) still use the FDK documentation because it is considerably more comprehensive. The two interfaces are largely parallel, but of course somewhat different in the language syntax. Consider that as a potential resource.
    Russ

  • How do I display text only in the first page inXML Publisher

    Hi everybody,
    I've been reading so much, on the last two days, on this issue at this forum but I didn't get an answer. My problem is: In an invoices report some text and fields from the invoice header, (such as payment terms, bank details etc.), should be printed only in the first page of the invoice, (If the invoice has more than one page). These elements are not in the document header/footer but in the document body. That's why I think the different fist page of MS Word will not work. I tried also <? start@first-page:body ?>, with no success. Any idea, someone?
    Thanks,
    Shimon

    Hi,
    Did you find solution to your problem? I am facing same issue and I want to know how you solved it? It would be great help.
    Thank you.
    Regards,
    Rahul

  • How do i display text information below an ALV grid.??

    Hi.
    I need to display my output in an ALV GRID.
    also i need to display summary details below the ALV grid. the smmary values keep changing dynamically depending upon selection screen inputs!!

    chk this report..write your code in the footer
    *& Report  ZRJR02                                                      *
    REPORT  ZRJR02                                  .
    *Table declaration.
    TABLES:ZEMP_MST,ZDEPT_MST,ZDESG_MST,ZSL_TXN.
    *Varriable declaration.
    TYPE-POOLS SLIS.
    DATA : POS TYPE I.
    DATA  REPID  LIKE SY-REPID.
    DATA : F1 TYPE SLIS_T_FIELDCAT_ALV,
           F2 TYPE SLIS_FIELDCAT_ALV,
           L_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA  L_POS TYPE I VALUE 1.               "position of the column
    DATA  GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    *DATA  GT_SORT TYPE SLIS_T_SORTINFO_ALV.
    data:  GT_EVENTS    TYPE SLIS_T_EVENT,
           FS_EVENTCAT LIKE LINE OF GT_EVENTs.
    *Internal table declaration.
    *DATA  BEGIN OF IT_SORT OCCURS 5.
    *      INCLUDE TYPE SLIS_SORTINFO_ALV.
    *DATA  END OF IT_SORT.
    DATA:BEGIN OF ITAB OCCURS 0,
          ZEMPNO    LIKE ZEMP_MST-ZEMPNO,
          ZEMPNAME  LIKE ZEMP_MST-ZEMPNAME,
          ZDEPTCD   LIKE ZEMP_MST-ZDEPTCD,
          ZDEPTNAME LIKE ZDEPT_MST-ZDEPTNAME,
          ZDESGCD   LIKE ZEMP_MST-ZDESGCD,
          ZDESGNAME LIKE ZDESG_MST-ZDESGNAME,
         END OF ITAB.
    REFRESH ITAB.CLEAR ITAB.
    START-OF-SELECTION.
    SELECT A~ZEMPNO A~ZEMPNAME A~ZDEPTCD B~ZDEPTNAME A~ZDESGCD C~ZDESGNAME
           FROM ZEMP_MST AS A
             INNER JOIN ZDEPT_MST AS B
               ON A~ZDEPTCD EQ B~ZDEPTCD
             INNER JOIN ZDESG_MST AS C
               ON A~ZDESGCD EQ C~ZDESGCD
           INTO CORRESPONDING FIELDS OF TABLE ITAB.
    IF SY-SUBRC <> 0.
       MESSAGE E899(M3) WITH 'No records'.
    ENDIF.
    perform f_build_eventcat.
    PERFORM LAYOUT.
    END-OF-SELECTION.
    *&      Form  LAYOUT
    FORM LAYOUT .
      PERFORM FCAT USING 'ZEMPNO'    'ITAB' '' 'Emp.No.'   'ZEMPNO'    'ZEMP_MST'  ''.
      PERFORM FCAT USING 'ZEMPNAME'  'ITAB' '' 'Emp. Name' 'ZEMPNAME'  'ZEMP_MST'  ''.
      PERFORM FCAT USING 'ZDEPTCD'   'ITAB' '' 'Dept.Code' 'ZDEPTCD'   'ZEMP_MST'  ''.
      PERFORM FCAT USING 'ZDEPTNAME' 'ITAB' '' 'Dept.Name' 'ZDEPTNAME' 'ZDEPT_MST' ''.
      PERFORM FCAT USING 'ZDESGCD'   'ITAB' '' 'Desg.Code' 'ZDESGCD'   'ZEMP_MST'  ''.
      PERFORM FCAT USING 'ZDESGNAME' 'ITAB' '' 'Desg.Name' 'ZDESGNAME' 'ZDESG_MST' ''.
    *  PERFORM LSORT USING  'ZEMPNO' 'IDATA' ''.
    *  PERFORM LSORT USING  'ZEMPNAME' 'IDATA' ''.
    *  MOVE IT_SORT[] TO GT_SORT[].
      REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
             I_CALLBACK_PROGRAM       = REPID
             IT_FIELDCAT              = F1
    *         IT_SORT                  = GT_SORT
             I_SAVE                   = 'X'
             IT_EVENTS                = GT_EVENTS[]
         TABLES
              T_OUTTAB                 = ITAB.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " LAYOUT
    *&      Form  FCAT
    FORM FCAT USING P_FIELD P_TABLE P_SUM P_TEXT P_RFIELD P_RTABLE P_DISP.
      ADD 1 TO POS.
      F2-COL_POS       = POS.
      F2-FIELDNAME     = P_FIELD.
      F2-TABNAME       = P_TABLE.
      F2-SELTEXT_L     = P_TEXT.
      F2-REF_FIELDNAME = P_RFIELD.
      F2-REF_TABNAME   = P_RTABLE.
      F2-DO_SUM        = P_SUM.
      F2-NO_OUT        = P_DISP.
      APPEND F2 TO F1.
      CLEAR F2.
    ENDFORM.                " FCAT
    *&      Form  LSORT
    *FORM LSORT USING P_FIELD P_TABLE P_UP.
    *  ADD 1 TO L_POS.
    *  IT_SORT-SPOS      = L_POS.
    *  IT_SORT-FIELDNAME = P_FIELD.
    *  IT_SORT-TABNAME   = P_TABLE.
    *  IT_SORT-UP        = P_UP.
    *  APPEND IT_SORT.
    *ENDFORM.                    " LSORT
    FORM F_BUILD_EVENTCAT .
    CLEAR: GT_EVENTS.  REFRESH: GT_EVENTS.
      CLEAR: FS_EVENTCAT.
      FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.
      FS_EVENTCAT-FORM = 'F_REPORT_HEADER_ALV'.
      APPEND FS_EVENTCAT TO GT_EVENTS.
      CLEAR: FS_EVENTCAT.
      FS_EVENTCAT-NAME = 'END_OF_LIST'.
      FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.
      APPEND FS_EVENTCAT TO GT_EVENTS.
    ENDFORM.                    " F_BUILD_EVENTCAT
    FORM F_REPORT_HEADER_ALV.
    CALL FUNCTION 'Z_YHEAD_PRINT'
    EXPORTING
       TITLE1        = 'XYZ Limited'
       TITLE2        = 'Employee Master'
       TITLE3        = 'Created on '
       COLOR         = 'X'
    ENDFORM.
    *&      Form  F_WRITE_SUMMARY
    *       Write summary before exit
    FORM F_WRITE_SUMMARY .
    write:/ 'Welcome to XYZ Limited'.
    write:/ 'This is a test program to display Report in ALV Format'.
    ENDFORM.

  • How do I display Text linked to a dropdown list selection in a form?

    Ok, I have a form that has a dropdown list with several selections. What I want to have happen is when someone selects one of the options from the dropdown, I want to have text displayed to the right of that information that pertains to that selection.
    I have attached the page with the form I have created as well as the css document that is used.
    Any insight would be most appriciated! Thanks in advance!

    Hi,
    I browsed for you a bit and found this: http://javascript.internet.com/forms/suggest-messages.html Looks like what you need!
    Otherwise just search this database: http://javascript.internet.com/forms/

Maybe you are looking for

  • How do i delete a contacts sub folder from my iphone?

    How do i delete a contacts sub folder from my iPhone?

  • HP Procurve 2920: How to display Bandwidth usage by port

    We have recently expanded our Lab network using HP Procurve 2920 switches. Our original installation utilises Procurve 2910 switches and on occasion we have found it very useful to view the Bandwidth used by each port graphically via the web interfac

  • Counting Rows in a Table

    I'm new at this mysql stuff and can't seem to figure out how to write the code for querying the database for the number of rows in a table. I can get a connection to the database and have done some basic commands like SELECT * FROM TABLE using rs.nex

  • How do i get itunes to see my apple TV

    my apple TV's light is flashing and i can not start it. i tried to restore it on my computer but my itunes does not see my apple TV how do i get itunes to recognize my apple TV?

  • First DL Burn - Error Layer 0 exceeds maximun layer size?

    The entire DVD size is 6.1G. I have 4 menu's. Don't understnand this message. "Formatting was not successful. Layer 0 exceeds the maximum layer size allowed. Please choose a suitable marker location that will support this condition."