How to select all the text in a JTextArea??

any1 know how to select all the text in a textarea?? just like when we press ctrl+a?? i use JTextAreaName.selectAll();doesnt work

worked OK for me
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Myprogram extends JFrame
  JTextArea TArea = new JTextArea(10,10);
  public Myprogram()
    JMenu JMenuName= new JMenu("JMenuName");
    JMenuItem  JMenuItemName=new JMenuItem("Select all");
    JMenuItemName.addActionListener(new SelectAllAction());
    getContentPane().add(new JScrollPane(TArea));
    JMenuBar mb = new JMenuBar();
  class SelectAllAction implements ActionListener
    public void actionPerformed(ActionEvent e)
  public static void main(String[] args){new Myprogram();}

Similar Messages

  • How to select all the colomns_names from a table, with their datatypes ..

    hi :)
    i would like to know, how to select in SQL all the columns names from a table with their datatypes so that i get something like this :
    Table 1 : table_name
    the column ID has the Datatype NUMBER
    the column name has the Datatype Varchar2
    Table 2 : table_name
    the column check has the Datatype NUMBER
    the column air has the Datatype Varchar2
    and that has to be for all the tables that i own ! ..
    P. S : i m trying to do this with java, so it s would be enough if you just tell me how to select all the tables_names with all their colums_names and with all their datatypes ! ..
    thank you :)
    i ve heard it can be done with USER_TABLES .. but i have no idea how :( ..
    Edited by: user8865125 on 17.05.2011 12:22

    The data dictionary view USER_TAB_COLUMNS has one row for every column in every table in your schema. The columns TABLE_NAME, COLUMN_NAME and DATA_TYPE have all the information you need.
    Another data dictionary view, USER_TABLES, may be useful, too. It has one row pre table.

  • How to select all the people that are not in any equipe  ?

    I have a nice SQL expression that gives me as a result all the "AGENTS" (people) that are working in an EQUIPE (a team)
    select a."AGENT_ID",
    a."NOM" || ' ' || a."PRENOM" "Nom",
    c.libelle "Equipe",
    a."DATE_EMBAUCHE" "Date embauche",
    a."DATE_DEBAUCHE" "Date débauche"
    observatoire.equipe_agents b,
    observatoire.equipe c
    where a.agent_id = b.agent_id
    and b.equipe_id = c.equipe_id
    order by nom
    Now, how to select all the agents that are NOT working in any "EQUIPE" (team) ?
    I have tried but could not succeed !
    Thank you for your kind help.

    Christian from France wrote:
    It is not working because the table EQUIPE_AGENTS does not contains a row if the agent is not into any equipe.
         "PRENOM" VARCHAR2(50 BYTE),
    The only way to "know" if an agent is not into any equipe (team) is to search into the EQUIPE_AGENTS table, and if we do not find the ID of the agent into this table, then we know that this agent is not into any EQUIPE (team).
    I don't know ho to translate this into SQL.And that's what my query does. It uses an OUTER JOIN so that a result record is returned whether or not there is a record in EQUIPE_AGENTS. And the check for EQUIPE_ID is NULL restricts the result set to those where there IS NOT a record in EQUIPE_AGENTS.
    A more traditional way would be to use NOT IN or NOT EXISTS clauses, but they can prove inefficient.

  • Select all the text on a page by touching an area that is white space

    I have read that you can select all the text on a page by touching an area that is white space, for example at the edge of a column. Sometimes this works for me, but most of the time it does not. Should it? Is there more to it? Is this a documented gesture?
    I want to be able to select all the text in a long page, where it would be very tedious to drag the copy handles. This would be the equivalent of CMD A on a computer.

    Yea, thanks, I've read that. It doesn't cover selecting all the text in one gesture, which is what I want to be able to do. This doesn't seem to be covered.
    I've been fooling around since I wrote the first post, and discovered that if you tap and hold to display the selection buttons (as noted in your quote) and then drag one of the blue selection buttons to the top (or bottom) of the text, then the other button will jump to the bottom (or top) and you have effectively selected all the text. This is what I wanted to do.
    The reason I wanted to do it is so I can select all the text in an article that I want to read, then copy and paste it into an app I just got, Speak it!, and then have the app read me the article while I get some exercise riding my stationary bike.

  • ALV GRID-how to select all the check boxes using push button

    Hai All,
    I displayed ALV grid & every record contains one check box as first column.
    If user clicks on one push button all the check boxes needs to selected.
    Could any one tell me how to do this?

    Hi Bhaskar,
       Try this code :
    *" Table declarations...................................................
    TABLES :
      spfli.                              " Flight Schedule
    *" Data declarations...................................................
    Work variables                                                      *
    DATA :
      w_checkbox  TYPE c,                  " Check Box
      w_checkbox1 TYPE c,                  " Check Box
      w_lineno    LIKE sy-lilli,           " Current Line No
      w_lines     TYPE i.                  " No. Of Records in Int.Table
    Internal table to hold Flight Schedule data                         *
    DATA :
       t_spfli LIKE
            OF spfli.
    Structure to hold Function Codes                                    *
    DATA :
      fs_fcode LIKE LINE OF t_fcode.
                          TOP-OF-PAGE EVENT                             *
      PERFORM top_of_page.
                       START-OF-SELECTION EVENT                         *
      PERFORM fetch_spfli_data.
      DESCRIBE TABLE t_spfli LINES w_lines.
      fs_fcode = 'EXIT'.
      APPEND fs_fcode TO t_fcode.
      fs_fcode = 'SELECT'.
      APPEND fs_fcode TO t_fcode.
      fs_fcode = 'DESELECT'.
      APPEND fs_fcode TO t_fcode.
      fs_fcode = 'RETRIEVE'.
      APPEND fs_fcode TO t_fcode.
                        AT USER-COMMAND EVENT                           *
      PERFORM user_command.
    FORM top_of_page .
      WRITE :/50 'Flight Schedule Information'(008).
      WRITE :/10 'Carrier ID'(001),
              25 'Connection ID'(002) ,
              43 'Airport From'(003),
              59 'Airport To'(004),
              74 'Departure Time'(007),
              93 'Arrival Time'(011),
             106 space.
    ENDFORM.                               " FORM TOP_OF_PAGE
    FORM fetch_spfli_data .
      SELECT carrid                        " Carrier ID
             connid                        " Connection ID
             airpfrom                      " Airport From
             airpto                        " Airport To
             deptime                       " Departure Time
             arrtime                       " Arrival Time
        FROM spfli
       TABLE t_spfli.
      IF sy-subrc EQ 0.
        PERFORM display_spfli_data.
      ENDIF.                               " IF SY-SUBRC EQ 0
    ENDFORM.                               " FORM FETCH_SPFLI_DATA
    FORM display_spfli_data .
      SORT t_spfli BY carrid ASCENDING.
      LOOP AT t_spfli INTO spfli.
        FORMAT COLOR 2.
        WRITE :/2 w_checkbox AS CHECKBOX,
                  spfli-carrid   UNDER text-001,
                  spfli-connid   UNDER text-002,
                  spfli-airpfrom UNDER text-003,
                  spfli-airpto   UNDER text-004,
                  spfli-deptime  UNDER text-007,
                  spfli-arrtime  UNDER text-011.
      ENDLOOP.                             " LOOP AT T_SPFLI...
    ENDFORM.                               " FORM DISPLAY_SPFLI_DATA
    FORM user_command .
      CASE sy-ucomm.
        WHEN 'SELECT'.
          w_checkbox1 = 'X'.
          DO w_lines TIMES.
            w_lineno = sy-index + 3.
            READ LINE w_lineno FIELD VALUE w_checkbox.
            IF w_checkbox = '*'.
              MODIFY LINE w_lineno FIELD VALUE w_checkbox FROM w_checkbox1.
            ENDIF.                         " IF W_CHECKBOX = '*'
          ENDDO.                           " DO W_LINES TIMES.
        WHEN 'DESELECT'.
          w_checkbox1 = ' '.
          DO w_lines TIMES.
            w_lineno = sy-index + 3.
            READ LINE w_lineno.
            IF w_checkbox = '*'.
              MODIFY LINE w_lineno FIELD VALUE w_checkbox FROM w_checkbox1.
            ENDIF.                         " IF W_CHECKBOX = '*'
          ENDDO.                           " DO W_LINES TIMES.
        WHEN 'RETRIEVE'.
          w_checkbox = ' '.
          DO w_lines TIMES.
            w_lineno = sy-index + 3.
            READ LINE w_lineno FIELD VALUE w_checkbox INTO w_checkbox.
            IF w_checkbox = 'X'.
              PERFORM fetch_sflight_data.
              PERFORM display_sflight_data.
            ENDIF.                         " IF W_CHECKBOX = 'X'
          ENDDO.                           " DO W_LINES TIMES.
      ENDCASE.                             " CASE SY-UCOMM
    ENDFORM.                               " FORM USER_COMMAND
    This report gives you the SPFLI Data and places a check box in front of each record. When u click on select all button it will select all the records. And if you click on deselect all it will deselect all the records. When you are trying this maintain the pf-status 'YMENU1' and give the function codes as in the code.

  • How to select all the rows of table control in BDC

    Hi All,
    While I am doing BDC for Transaction Code MC88, After the first screen I will get another screen with tabble control, Here I need to select all the rows of table control, I am assignng the 'X' to the first field of Table Control which is the indicator for selection.
    Here I am getting message called Indicator field is not in program and screen.
    While doing Recording I am not able to record the indicator, Please any one let me know how to record the Entire table control selection.
    Thanks in advance..

    Sorry about that lakshmi. Here is my code.
        PERFORM dynpro USING : 'X'   'SAPMMCP6'          '0105',
                               ' '   'RMCP2-MATNR'       t_matnr,
                               ' '   'RMCP2-WERKS'       t_werks,
                               ' '   'BDC_OKCODE'        '=AKTV'.
        PERFORM dynpro USING : 'X'   'SAPLMCPA'          '0707',
                               ' '   'BDC_OKCODE'        '=MRKE'.
        PERFORM dynpro USING : 'X'   'SAPLMCPA'          '0707',
                               ' '   'BDC_OKCODE'        '=GRAO

  • How to select all the frames in a document?

    i did select only particular active it possible to select all the frames in a document?

    Hi vinothvijay,
    You can use below interface to select all the frames in the document.
    ISelectionManager* selMgr = Utils<ISelectionUtils>()->GetActiveSelection();
    Santosh K.

  • How to select all the lines of table control

    Hi all,
             In table control, I have more than 100 records. My requirement is I have to select all the records when I press check box in the table control. Please guide me in this regard.
    Searched in sdn before  posting.
    Murali Krishna. T


  • How to Copy all the text blocks of a converted Word file (Converted PDF TO WORD)

    We have scanned a English book quite a some time ago. Now we have converted it to a Word Document.
    We try to copy the whole text and re-format it and save it as Word/PDF
    The problem is we cannot copy the whole document since it has the text as various blocks.
    It is very hard to select each box and put in a word document or in a notepad.
    Could you please tell me how to select the whole document or whole blocks with single stretch or any easy way to do it?

    "Scanned" -- That tells the story.
    The output of all scanners is an image, a picture if you will, of the paper source.
    Pictures of text are not the "text" itself and thus there is no "text" to copy (let alone paste).
    For PDF files that hold the picture of text that is the output of a scanner you would want to open the PDF with Acrobat.
    Now use Acrobat's OCR capability.
    Suggestion: Use Acrobat's ClearScan. This is "friendlier" to doing touchups to characters / words.
    Export this to Word (Use Acrobat Pro or one of Adobe's online subscription services - ExportPDF or PDF Pack).
    DO expect to do cleanup in the Word file.
    Whenever the source is a scanner's output picture you have a pig's ear & you cannot make a silk purse from that.
    Be well...

  • Adobe X - How to select all text in a file

    I have a feeling this is a dumb question, but I need to select all the text in a pdf file and I can not figure how to do it with Adobe X.  It was very simple in previous versions.  Any answers would be greatly appreciated!

    ariel0 wrote:
    why are you sending this question to me
    Nobody is sending anything to you.
    Did you subscribe to the forums accidently?

  • How to SELECT ALL records of a TABLE VIEW in the BSP page

    Hi All,
    In the BSP portal, I am displaying some data(multple records) in the form of a table using the BSP TAG <htmlb:tableView>. I wrote the logic in the 'VIEW' of the BSP application which will be triggered by the controller. I have used the attribute selectionMode = "MULTISELECT" to have a Check Box to select a row.
    My requirement is to have a button/checkbox on the first column of the header of the table view. By clicking on this, it should select/desect all the records of the table. Could someone please help me how to do this? What attribute I should use in the tableview to get the button in the header row of the table and how to select all the records of the table.?
    Please provide your valuable inputs.
    Thanks & Regards,

    Select all / Deselect all functionality when onRowSelection is there

  • How to find out all the text elements in the report using Java?

    How to trace the contents of an rpt file?
    I am able to open the rpt file in my report viewer but can not trace it using the JAVA code.
    Actually, I need to find out all the text elements of rpt (Report) file and replace them with the contents of resource bundle.
    My Java code to open a report is given below:
    import com.crystaldecisions.reports.sdk.ISubreportClientDocument;
    import com.crystaldecisions.reports.sdk.ParameterFieldController;
    import com.crystaldecisions.reports.sdk.ReportClientDocument;
    public String viewRpt()
                   //1.) Setting Database Infos
                            IConnectionInfo iConnectionInfoObj=setDatabaseConnectionInfos();
                   //2.) Setting Report Path
                   String reportPath=u201DE:
                   reportPath=(reportPath!=null)?                                             reportPath:AppConstants.CONSTANTS.BLANK;
                   String reportName="report1.rpt";
                   String reportFullPath = reportPath +   rptName;
                 //3.) Setting Report Source
                             ReportClientDocument reportClientDoc = new ReportClientDocument();
                                    , 0);
                  IReportSource reportSource = reportClientDoc.getReportSource();
              //4.) Setting the Fields Starts
              Fields fields = new Fields();
              ParameterField pfield1 = new ParameterField();
              Values vals1 = new Values();
              ParameterFieldDiscreteValue pfieldDV1 = new ParameterFieldDiscreteValue();
              pfield1 = new ParameterField();
              vals1 = new Values();
              pfieldDV1 = new ParameterFieldDiscreteValue();
              //Setting the Fields Ends
    The sample jsp code to view the report is as follows:
    <%@taglib uri=""
    <bocrv:reportPageViewer viewerName="CrystalViewer"
                                                 displayGroupTree="false" displayToolbarLogo="false"
                                                 enablePageToGrow="false" height="540"
                                                 zoomPercentage="100" width="750"
    Edited by: JayKumarSharma on Mar 23, 2011 12:42 PM

    This is how you retrieve all the text fields in the reort:
    ReportObjects reportObjects = (ITextObject) oReportClientDocument.getReportDefController().getReportObjectController().getReportObjectsByKind(ReportObjectKind.text);
    for(int i=0; i< reportObjects.size();i++)
    ITextObject textObject = (ITextObject)reportObjects.get(i);
    // use ReportObjectController to modify the text object.
    If you want to modify the contents of the text element, you can do it as follows:
    TextObject oTextObject = new TextObject();
    Paragraphs oParagraphs = new Paragraphs();
    Paragraph oParagraph = new Paragraph();
    ParagraphElements oParagraphElements = new ParagraphElements();
    ParagraphTextElement oParagraphTextElement = new ParagraphTextElement();
    oParagraphTextElement.setText("This is the new text field");
    oReportClientDocument.getReportDefController().getReportObjectController().modify(textObject, oTextObject);;

  • How can I change the text layers to a specific color at the same time and in the fast way?

    Dear all!
    I am using Photoshop CS5. I typed 65 text layers in my file and wish to change their colors to a specific Black Color, but I don't know how to select all the layers at the same time so that I can change all the text layers from Red Color to Black Color in the fast way. Now I only select one layer and then change. It means I must select and change 65 times for the text layers. Hope you can understand what I mean.
    Thanks a lot.
    My Kindest Regards,

    One way is to select all the text layers, select the type tool in the tool box
    and set the color from the tool options bar.

  • 11.5.9 How to select all invoices in Payment batches ??

    Hi Guys,
    We are working on 11.5.9 Payment batches...
    Could anyone help me out on how to select all the Invoices whether due or not in the Payment Batches ?? I see that unchecking only due' doesn't Pay through date is the only option ??

    SelectManyListBox has a separate ALL checkbox visible. You can use that component

  • Selecting all "similar" text - is it possible?

    I have a feeling this isn't possible but i thought best go ahead and ask anyway...
    I have converted a document from Quark (gasp!) to InDesign. All has gone well except the leading is a bit too close. The character styles haven't been correctly brought through from Quark so it's not simply a case of changing those, and i was thinking, you know the way in Illustrator for example you can select all items with the same colour stroke or fill and then change all accordingly, is there a way of selecting all the text with the same properties or am i going to have to go through every little text box in this 800 page document and change all the leading one by one?!
    Using mac 0s x 10, InDesign CS3

    You should have used Paragraph Styles instead of character styles.
    Use a Paragraph Style for whole paragraphs of text (even if one line) and use Character styles to give attributes to single characters/word(s) withing a paragraph.
    With everything having Paragraph Styles you can have Space Above and Space Below attributes for the paragraphs.
    If you want to give everything Paragraph styles, then select a paragraph and make a new paragraph style.
    Search for your Body character style and replace it with your Pargraph style.

Maybe you are looking for