How can I place Tagged Text in InDesign

I use tagged text in the files I place
in InDesign. For example,
<cn>This is the chapter number
<ct>This is the chapter title
<cst>This is the chapter subtitle
<bt>This is the beginning of the body text
<ah>This is an A-level head
                and so on. In PageMaker, there was a checkbox in the "place"
dialogue box named "Read tags." I checked that, and when I placed the file in the template (in which I had the styles defined), the whole chapter appeared with the formatting I wanted for each style.
                I can't find the equivalent checkbox in InDesign. I can't believe it is no longer there, but search as I do, I can't find it. There is a lot online about exporting tagged text, but where, oh where, is my checkbox for placing tagged text? If someone knows where it is, I'd be very grateful.

John Hawkinson wrote:
For reference SuzeiQ's thread in the scripting forum is here: http://forums.adobe.com/thread/908213.
Though I think it really wasn't a scripting question :-).
Also, Peter, post your script!
I presume that last was directed to Mr. Kahrel...

Similar Messages

  • How can I place good screenshots into InDesign?

    This is essentially what I am trying to do as well...Is there a correct answer that was given? How do know which answer is the one correct answer that is noted in the forum? My question is identical to the one below. My screen shots are off a website.
    I am working on a guide in InDesign to distribute to our customers that shows step by step instructions on how to use our software.  I am taking screenshots of the software and placing them into InDesign.  I have tried this many different ways now and I can't get the images to look clear.  I have taken the screenshot and pasted it into Illustrator, Photoshop, even Paint and then saved it as many different file types, jpeg, gif, tif, etc.  It looks great in Illustrator or Photoshop but after I place the image into InDesign it looks awful.  It looks blurry on the screen and after I print.
    If I paste the image into Illustrator and then copy from there and simply paste into InDesign the image looks much better.  Almost perfect.  But I know this isn't the right way to do this and the images aren't saved/linked this way.
    Does anyone have any suggestions?

    Kitti-girl's Mom wrote:
    This is essentially what I am trying to do as well...Is there a correct answer that was given? How do know which answer is the one correct answer that is noted in the forum? My question is identical to the one below. My screen shots are off a website.
    I am working on a guide in InDesign to distribute to our customers that shows step by step instructions on how to use our software.  I am taking screenshots of the software and placing them into InDesign.  I have tried this many different ways now and I can't get the images to look clear.  I have taken the screenshot and pasted it into Illustrator, Photoshop, even Paint and then saved it as many different file types, jpeg, gif, tif, etc.  It looks great in Illustrator or Photoshop but after I place the image into InDesign it looks awful.  It looks blurry on the screen and after I print.
    If I paste the image into Illustrator and then copy from there and simply paste into InDesign the image looks much better.  Almost perfect.  But I know this isn't the right way to do this and the images aren't saved/linked this way.
    Does anyone have any suggestions?
    This old post from Dov Isaacs
    http://forums.adobe.com/message/2938256#2938256
    may be helpful. Also the whole discussion in the thread that begins with
    http://forums.adobe.com/message/2936631#2936631
    is worth at least skimming.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • How can I place a file in INDESIGN 3 at 100%

    I am a novice Indesign user using Indesign 3 on a PC. The other office I work with is using Indesign 3 on a Mac.
    When I open their indd files and view them, the placed images indicate 100% when I use the direct selection tool to check the percentage. However, If I design the same page, create a frame and place the same image from the original link they used as well, when I fit the content proportionally, and use the direct selection tool to see the size, it comes in at the percentage from the original file, say 42% if it was decreased by approx. half.
    I am sure there is an easy explanation for this, but I cannot find it in my searching. Can someone help me understand what I am missing here.
    I appreciate your assistance with this question.
    Ginger Creswell

    Since you have her file, what happens if you open her file and place the image without first making and selecting a frame? Is it the same size as the image in the frame?
    >Yes when I make the frame, place the image, fit the image to the frame, it reads 42% -(then 100% when selected with the black arrow tool) this is the way I believe it should be.
    Unless the frame you create is exactly the same size as the image you place into it, it will always change size if you fit the image to the frame. If the frame is smaller, the image will have to be made smaller to fit into the frame. The same applies to a larger frame.
    I don't get the impression that you are confusing scaling with cropping, but it should be mentioned that you can have a 100% size image in a smaller frame if part of the image is outside the boundries of the frame.
    Also, I mentioned in an earlier post that the most likely error would be that the image in the original isn't the same (has the same name, but has been changed in its original program) as the image you are trying to place, even if your San Fran designer sent it to you (she could have sent you the wrong image). If you open her file and package it, it will spit out a copy of the image, which you can try placing to see if you still get the same results.

  • How can I place a text field not directly on the left of the page but with an indent to the right?

    Hi everybody,
    I try to create a form in which I want to enter several item under each other
    general info        Item 1               Item 2
                             Name 1            Name 2
                            Item 3               Item 4
    and so on.
    Since it is not possible to insert a table for something like that I would like to enter seperate text fields one underneath the other.
    But every new line starts on the left side and I do not see any way to move a text field to the right with an indent so that "item 1", "Name 1" and "item 3" are aligned the same.
    Can anybody give me a hint?
    Thanks a lot and have a good 2015!
    Oliver

    Hi,
    Insert a blank "Formatted Text" field on the far left, and shrink it down as much as you wish. Then insert your normal text field to the right of that.
    I hope that helps,
    Brian

  • How can I restore the text selection highlight colour to the default black colour in indesign CC ?

    How can I restore the text selection highlight colour to the default black colour in indesign CC ?

    Manish Shama, thanks for your speedy response. I was able to get into my MAC settings and change the background from the black to whatever color I like, so that helps (THANKS!). But the real issue is that the selected text does not turn white (even though that's what's specified in my MAC settings), it remains black. I really want to have the selection reverse out as it always has for years and years going all the way back to PageMaker Any ideas?

  • How can we get  tag of XML file using SAX

    Hi ,
    I'm parsing one SAX parser , I'have almost done this parsing. i have faced problem for one case, i'e how can we get tag from XML file using SAX parser?
    XML file is
    <DFProperties>
    <AccessType>
    <Get/>
    </AccessType> <Description>
    gdhhd
    </Description>
    <DFFormat>
    <chr/>
    </DFFormat>
    <Scope>
    <Permanent/>
    </Scope>
    <DFTitle>gsgd</DFTitle>
    <DFType>
    <MIME>text/plain</MIME>
    </DFType>
    </DFProperties>
    I want out like GET and Permanent... means this one tag which is present inside of another tag.
    Handler class like
    public void startElement(String namespaceURI, String localName,
                   String qName, Attributes atts) throws SAXException {
    if(_ACCESSTYPE.equals(localName)){
                   accessTypeElement=ACCESSTYPE;
    public void characters(char[] ch, int start, int length)
                   throws SAXException {
    if (_ACCESSTYPE.equals(_accessTypeElement)) {
                   String strValue = new String(ch, start, length);
                   System.out.println("Accestype-----------------------------> " + strValue);
                   //System.out.println(" " + strValue);
    public void endElement(String namespaceURI, String localName, String qName)
                   throws SAXException {
    if (_ACCESSTYPE.equals(localName)) {
                   _accessTypeElement = "";
    . please any body help me

    Hi ,
    I have one problem,Please help me.
    1. How can I'll identify where exactly my Node is ended,means how how can we find corresponding nodename? in partcular place
    <Node> .............starttag1
    <NodeName>Test</NodeName>
    <Node>................starttag2
    <nodeName>test1</NodeName>
    </Node>..................endtag2
    <Node>.....................starttag3
    <NodeName><NodeName>
    <Node> .........................starttag4
    <NodeName>test4</NodeName>
    </Node>.......enddtag4
    </Node>...........end tag3
    </Node>............endtag1
    my code is below
    private final String _NODENAME = "NodeName";
    private final String _NODE = "Node";
    private String _nodeElement = "";
         private String _NodeNameElement = "";
    public void startElement(String namespaceURI, String localName,
                   String qName, Attributes atts) throws SAXException {
    if (_NODENAME.equals(localName)) {
                   NodeNameElement = NODENAME;
    if(_NODE.equals(localName)){
         System.out.println("start");
         if (_NODENAME.equals(localName)) {
                   NodeNameElement = NODENAME;
    public void characters(char[] ch, int start, int length)
                   throws SAXException {
    if (_NODENAME.equals(_NodeNameElement)) {
                   String strValue = new String(ch, start, length);
                   String sttt=strValue;
                   System.out.println("NODENAME: ************* " + strValue);
    if(_NODE.equals(_nodeElement)){
                   if (_NODENAME.equals(_NodeNameElement)) {
                        String strValue = new String(ch, start, length);
                        String sttt=strValue;
                        System.out.println("nodevalue********** " + strValue);
    public void endElement(String namespaceURI, String localName, String qName)
                   throws SAXException {
    if (_NODENAME.equals(localName)) {
                   _NodeNameElement = "";
    if(_NODE.equals(localName)){
                   System.out.println("NODENAME: %%%%%%%%%");
    please help me. How can I figure node ending for particular nodename

  • How Can I replace newScale Text Strings with Custom Values?

    How Can I replace newScale Text Strings with Custom Values?
    How can I replace newScale text strings with custom values?
    All  newScale text is customizable. Follow the procedure below to change the  value of any text string that appears in RequestCenter online pages.
    Procedure
    1. Find out the String ID of the text string you would like to overwrite by turning on the String ID display:
    a) Navigate to the RequestCenter.ear/config directory.
    b) Open the newscale.properties file and add the following name-value pair at the end of the file:res.format=2
    c) Save the file.
    d) Repeat steps b and c for the RmiConfig.prop and RequestCenter.prop files.
    e) Stop and restart the RequestCenter service.
    f) Log  in to RequestCenter and browse to the page that has the text you want  to overwrite. In front of the text you will now see the String ID.
    g) Note down the String ID's you want to change.
    2. Navigate to the directory: /RequestCenter.ear/RequestCenter.war/WEB-INF/classes/com/newscale/bfw.
    3. Create the following sub-directory: res/resources
    4. Create the following empty text files in the directory you just created:
    RequestCenter_0.properties
    RequestCenter_1.properties
    RequestCenter_2.properties
    RequestCenter_3.properties
    RequestCenter_4.properties
    RequestCenter_5.properties
    RequestCenter_6.properties
    RequestCenter_7.properties
    5. Add the custom text strings to the appropriate  RequestCenter_<Number>.properties file in the following manner  (name-value pair) StringID=YourCustomTextString
    Example: The StringID for "Available Work" in ServiceManager is 699.
    If you wanted to change "Available Work" to "General Inbox", you  would add the following line to the RequestCenter_0.properties file
         699=General Inbox
    Strings are divided into the following files, based on their numeric ID:
    Strings are divided into the following files, based on their numeric ID:
    String ID  File Name
    0 to 999 -> RequestCenter_0.properties
    1000 to 1999 -> RequestCenter_1.properties
    2000 to 2999 -> RequestCenter_2.properties
    3000 to 3999 -> RequestCenter_3.properties
    4000 to 4999 -> RequestCenter_4.properties
    5000 to 5999 -> RequestCenter_5.properties
    6000 to 6999 -> RequestCenter_6.properties
    7000 to 7999 -> RequestCenter_7.properties
    6. Turn off the String ID display by removing (or commenting out) the line "res.format=2" from the newscale.properties, RequestCenter.prop and RmiConfig.prop files
    7. Restart RequestCenter.
    Your customized text should be displayed.

    I've recently come across this information and it was very helpful in changing some of the inline text.
    However, one place that seemed out of reach with this method was the three main buttons on an "Order" page.  Specifically the "Add & Review Order" button was confusing some of our users.
    Through the use of JavaScript we were able to modify the label of this button.  We placed JS in the footer.html file that changes the value of the butt

  • How can i make the text go vertically in numbers

    How can I make the text vertical in numbers?  I have merged the cells and cannot find an option for making it go vertical as opposed to horizontal.

    I already gave two tools to fit this kind of needs.
    tip #1 :
    --{code}
    --[SCRIPT write_vertically]
    Enregistrer le script en tant que Script : write_vertically.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Utilisateurs:<votreCompte>:Bibliothèque:Scripts:Applications :Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Saisir dans une cellule le mot à écrire verticalement puis le sélectionner.
    ATTENTION, il ne faut pas sélectionner la cellule mais le mot qui doit apparaitre surligné.
    Aller au menu Scripts , choisir Numbers puis choisir “write_vertically”
    Le script colle dans la cellule le mot apès avoir inséré un return entre tous les caractères.
    Pour mon usage personnel j'associe un raccourci à ce script grace à FastScripts.
    --=====
    L’aide du Finder explique:
    L’Utilitaire AppleScript permet d’activer le Menu des scripts :
    Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case “Afficher le menu des scripts dans la barre de menus”.
    Sous 10.6.x,
    aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript
    puis cocher la case “Afficher le menu des scripts dans la barre des menus”.
    --=====
    Save the script as a Script: write_vertically.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    In a cell, type a word to write vertically then select it.
    CAUTION, don’t select the cell but the word which must be highlighted.
    Go to the Scripts Menu, choose Numbers, then choose “write_vertically”
    The script insert in the cell the word after inserting a return between every characters.
    For my own use, I link a shortcut to the script thank to FastScripts.
    --=====
    The Finder’s Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the “Show Script Menu in menu bar” checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2011/12/17
    2012/01/01 no longer use a local variable, use result
    --=====
    on run
    Clear the clipboard *)
      set the clipboard to ""
    Copy the selection in the clipboard *)
              my raccourci("Numbers", "c", "c")
    Loop waiting that the clipboard is really filled *)
              repeat
                        try
                                  if (the clipboard as text) is not "" then exit repeat
                        on error
                        end try
              end repeat
    Extract the clipboard's content *)
      the clipboard as text
    Insert return between every characters *)
              my recolle(every character of result, return)
    Fill the clipboard with the edited string *)
      set the clipboard to result
    Paste in the cell *)
              my raccourci("Numbers", "v", "cas")
    end run
    --=====
    on recolle(l, d)
              local oTIDs, t
              set oTIDs to AppleScript's text item delimiters
              set AppleScript's text item delimiters to d
              set t to l as text
              set AppleScript's text item delimiters to oTIDs
              return t
    end recolle
    --=====
    on activateGUIscripting()
      (* to be sure than GUI scripting will be active *)
              tell application "System Events"
                        if not (UI elements enabled) then set (UI elements enabled) to true
              end tell
    end activateGUIscripting
    --=====
    ==== Uses GUIscripting ====
    This handler may be used to 'type' text, invisible characters if the third parameter is an empty string.
    It may be used to 'type' keyboard raccourcis if the third parameter describe the required modifier keys.
    I changed its name « shortcut » to « raccourci » to get rid of a name conflict in Smile.
    on raccourci(a, t, d)
              local k
              tell application a to activate
              tell application "System Events" to tell application process a
                        set frontmost to true
                        try
                                  t * 1
                                  if d is "" then
      key code t
                                  else if d is "c" then
      key code t using {command down}
                                  else if d is "a" then
      key code t using {option down}
                                  else if d is "k" then
      key code t using {control down}
                                  else if d is "s" then
      key code t using {shift down}
                                  else if d is in {"ac", "ca"} then
      key code t using {command down, option down}
                                  else if d is in {"as", "sa"} then
      key code t using {shift down, option down}
                                  else if d is in {"sc", "cs"} then
      key code t using {command down, shift down}
                                  else if d is in {"kc", "ck"} then
      key code t using {command down, control down}
                                  else if d is in {"ks", "sk"} then
      key code t using {shift down, control down}
                                  else if (d contains "c") and (d contains "s") and d contains "k" then
      key code t using {command down, shift down, control down}
                                  else if (d contains "c") and (d contains "s") and d contains "a" then
      key code t using {command down, shift down, option down}
                                  end if
                        on error
                                  repeat with k in t
                                            if d is "" then
      keystroke (k as text)
                                            else if d is "c" then
      keystroke (k as text) using {command down}
                                            else if d is "a" then
      keystroke k using {option down}
                                            else if d is "k" then
      keystroke (k as text) using {control down}
                                            else if d is "s" then
      keystroke k using {shift down}
                                            else if d is in {"ac", "ca"} then
      keystroke (k as text) using {command down, option down}
                                            else if d is in {"as", "sa"} then
      keystroke (k as text) using {shift down, option down}
                                            else if d is in {"sc", "cs"} then
      keystroke (k as text) using {command down, shift down}
                                            else if d is in {"kc", "ck"} then
      keystroke (k as text) using {command down, control down}
                                            else if d is in {"ks", "sk"} then
      keystroke (k as text) using {shift down, control down}
                                            else if (d contains "c") and (d contains "s") and d contains "k" then
      keystroke (k as text) using {command down, shift down, control down}
                                            else if (d contains "c") and (d contains "s") and d contains "a" then
      keystroke (k as text) using {command down, shift down, option down}
                                            end if
                                  end repeat
                        end try
              end tell
    end raccourci
    --=====
    --[/SCRIPT]
    --{code}
    tip #2 :
    --{code}
    --[SCRIPT rotate_cell_contents]
    Enregistrer le script en tant que Script : rotate_cell_contents.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Sélectionner une cellule dont le texte doit être tourné de 90 degrés.
    Aller au menu Scripts , choisir Numbers puis choisir “rotate_cell_contents”
    --=====
    L’aide du Finder explique:
    L’Utilitaire AppleScript permet d’activer le Menu des scripts :
    Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case “Afficher le menu des scripts dans la barre de menus”.
    Sous 10.6.x,
    aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript
    puis cocher la case “Afficher le menu des scripts dans la barre des menus”.
    --=====
    Save the script as a Script: rotate_cell_contents.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    Select a cell whose contents must be rotated for 90 degrees.
    Go to the Scripts Menu, choose Numbers, then choose “rotate_cell_contents”
    --=====
    The Finder’s Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the “Show Script Menu in menu bar” checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2011/06/23
    2011/06/26 -- No longer use an auxiliary text box. Now keep the text attributes.
    2012/01/31 -- edited for Lion
    --=====
    on run
              local dName, sName, tName, rowNum1, colNum1, rowNum2, colNum2
              local le_texte, la_largeur, la_hauteur, myNewDoc
              my activateGUIscripting()
    Extract properties of the source/target cell *)
              set {dName, sName, tName, rowNum1, colNum1, rowNum2, colNum2} to my get_SelParams()
              tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
                        set selection range to range (name of column colNum1 & name of row rowNum1)
              end tell
    Cut*)
              my raccourci("Numbers", "x", "c")
    Trigger Preview *)
              tell application "System Events"
                        if "Preview" is not in (name of every application process) then launch application "Preview"
              end tell
      delay 0.2 -- required
    New document from the clipboard *)
              my raccourci("Preview", "n", "c")
    Rotate to left *)
              my raccourci("Preview", "l", "c")
    Copy *)
              my raccourci("Preview", "c", "c")
    Quit *)
              my raccourci("Preview", "q", "c")
              (system attribute "sys2") < 7
              if result then
    Click the [Don't Save] button in the warning sheet *)
                        tell application "Preview" to activate
                        tell application "System Events" to tell application process "Preview" to tell window 1
                                  name of buttons
                                  repeat 50 times
                                            delay 0.1
                                            if exists sheet 1 then exit repeat
                                  end repeat
                                  tell sheet 1 to click button 2
                        end tell
              end if
    Back to Numbers *)
              tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
      -- just reset the focus on the table
              end tell
    Paste in the cell *)
              my raccourci("Numbers", "v", "c")
    end run
    --=====
    set { dName, sName, tName,  rowNum1, colNum1, rowNum2, colNum2} to my get_SelParams()
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    on get_SelParams()
              local d_name, s_name, t_name, row_num1, col_num1, row_num2, col_num2
              tell application "Numbers" to tell document 1
                        set d_name to its name
                        set s_name to ""
                        repeat with i from 1 to the count of sheets
                                  tell sheet i to set maybe to the count of (tables whose selection range is not missing value)
                                  if maybe is not 0 then
                                            set s_name to name of sheet i
                                            exit repeat
                                  end if -- maybe is not 0
                        end repeat
                        if s_name is "" then
                                  if my parleAnglais() then
                                            error "No sheet has a selected table embedding at least one selected cell !"
                                  else
                                            error "Aucune feuille ne contient une table ayant au moins une cellule sélectionnée !"
                                  end if

  • How can I place photo icons on top of folders?

    I put 4 folders in my dock. I need to ID them with photo - icons.
    1) How can I place photo icons on top of 3 folders, so that they also retain
    their folder shape?
    2) And, to make one of them look like a folder that has text?
    Intel Mac - Dual - Tiger 10.4.9
    Thank you.

    It sounds like what you actually need to do is amend the icon itself - something like Iconographer will help you with that. Open the icon of any standard folder, copy in your photo image, amend the result to your satisfaction, and save it as a new icon. Then apply that icon to your folder.
    Matt

  • How can I place 2 A5 sized pages on an A4 page for printing?

    How can I place 2 A5 sized pieces of text on one A4 page for printing?

    Hi,
    If you want the text to flow from one side to the other, create a new A4 blank landscape document. Set left and right document margins to 1cm:
    Type in some placeholder text, select it and set the Layout to 2 equal columns with a 2cm gutter:
    Type in the text, it'll end up like this:
    If you don't need the text to flow from one side to the other, then an alternative is to draw two equal-sized text boxes and type into them.
    Cheers,
    H

  • How can I create a text pop up window in my Pages document? I want text to pop up when the reader hovers his/her cursor over a certain word.

    How can I create a text pop up window in my Pages document? I want text to pop up when the reader hovers his/her cursor over a certain word in the document. I am teacher. So for example when a student came to word he/she did not know, if he/she hovered the cursor over the word, a defintion or other information would appear.  You can do this in Word using bookmarks/hyperlinks but I can't figure this out in Pages. I can link it to another point in my Pages document but I just need the text to pop up - not take the reader to another location.  THANK YOU!!!!!!

    Have you tried Word for Mac?
    You will need to test if links survive export or printing to .pdf
    Peter

  • How can I get the "text" field from the actionEvent.getSource() ?

    I have some sample code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class JFrameTester{
         public static void main( String[] args ) {
              JFrame f = new JFrame("JFrame");
              f.setSize( 500, 500 );
              ArrayList < JButton > buttonsArr = new ArrayList < JButton > ();
              buttonsArr.add( new JButton( "first" ) );
              buttonsArr.add( new JButton( "second" ) );
              buttonsArr.add( new JButton( "third" ) );
              MyListener myListener = new MyListener();
              ( (JButton) buttonsArr.get( 0 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 1 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 2 ) ).addActionListener( myListener );
              JPanel panel = new JPanel();
              panel.add( buttonsArr.get( 0 ) );
              panel.add( buttonsArr.get( 1 ) );
              panel.add( buttonsArr.get( 2 ) );
              f.getContentPane().add( BorderLayout.CENTER, panel );
              f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              f.setVisible( true );
         public static class MyListener  implements ActionListener{
              public MyListener() {}
              public void actionPerformed( ActionEvent e ) {
                   System.out.println( "hi!! " + e.getSource() );
                   // I need to know a title of the button (which was clicked)...
    }The output of the code is something like this:
    hi! javax.swing.JButton[,140,5,60x25,alignmentX=0.0,alignmentY=0.5,
    border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1ebcda2d,
    flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,
    disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,
    right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,
    rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=first,defaultCapable=true]
    I need this: "first" (from this part: "text=first" of the output above).
    Does anyone know how can I get the "text" field from the e.getSource() ?

    System.out.println( "hi!! " + ( (JButton) e.getSource() ).getText() );I think the problem is solved..If your need is to know the text of the button, yes.
    In a real-world application, no.
    In a RW application, a typical need is merely to know the "logical role" of the button (i.e., the button that validates the form, regardless of whether its text is "OK" or "Save", "Go",...). Text tends to vary much more than the structure of the UI over time.
    In this case you can get the source's name (+getName()+), which will be the name that you've set to the button at UI construction time. Or you can compare the source for equality with either button ( +if evt.getSource()==okButton) {...}+ ).
    All in all, I think the best solution is: don't use the same ActionListener for more than one action (+i.e.+ don't add the same ActionListener to all your buttons, which leads to a big if-then-else series in your actionPerformed() ).
    Eventually, if you're listening to a single button's actions, whose text change over time (e.g. "pause"/"resume" in a VCR bar), I still think it's a bad idea to rely on the text of the button - instead, this text corresponds to a logical state (resp. playing/paused), it is more maintainable to base your logic on the state - which is more resilient to the evolutions of the UI (e.g. if you happen to use 2 toggle buttons instead of one single play/pause button).

  • How can we place a push button in ALV  report

    hi
    could anybody inform me
    how can we place a push button in ALV  report
    thanx
    regards
    kals.

    Hi kals.
    please have a look at demoprogram
    SALV_DEMO_TABLE_FUNCTIONS
    BCALV_GRID_05
    Regards
    Bernd

  • My 10 yr old wants to text from his iPod touch. We have 1 family Apple ID. How can I monitor his texts without receiving all of his friends messages? Do I need a separate Apple ID or can I link a new email address to the same Apple ID?

    My 10 yr old wants to text from his iPod touch. We have 1 family Apple ID. How can I monitor his texts without receiving all of his friends messages? Do I need a separate Apple ID or can I link a new email address to the same Apple ID?

    Just an email address
    MacMost Now 653: Setting Up Multiple iOS Devices For Messages and FaceTime

  • How can I prevent my texts showing on another family members iPhone?

    How can I prevent my texts showing on another family members iPhone?

    Stop using the same apple ID for iMessage on both phones.
    Your question has already been asked and answered many many times. Search before posting please.

Maybe you are looking for

  • Setting up boot WIM... but having trouble setting up the correct NIC driver

    I'm trying to setup a network boot with Windows Deployment Services. Pretty straightforward (http://technet.microsoft.com/en-us/library/cc766320.aspx). Problem though is the OOTB Vista & Win2k8 boot.wim file don't include the necessary driver for the

  • 2.1 MA fails to start

    I upgraded to 2.1 and my Message Agent will not start. running /etc/init.d/novell-nmma start returns FAILED. I cannot find any logs or reports on why it fails. I have looked everywhere for logs and find nothing. I edit strtup.ma to enable logging but

  • Adobe Reader 9 - Printing error, ony get one pg. HELP!

    Ok, I have installed Adobe Reader 9 as I had 5 and I kept getting a msg saying certain files were encrpted which is not true. Anyways, use it for work and now it doesnt print the complete document, it prints the first page and thats it. I've changed

  • What is wrong with this elapsed time counter?

    I have been using this simple counter for a while. After unbundling the timestamp - there is always a '19' in the hours indicator. At first I was simply subtracting '19' and it worked fine. Then I ran a program for about 5 hours and the hour display

  • Alerts--Subscribe to an Alert---??

    Hi, I am trying to configure alerts.  (weblog--/people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated). I have created an alertcategory, assigned the users to it and saved it. When i went into RWB--> Aler