Adding Dynamic JButtons & JLabels on the JTool

On occerance of certain ActionEvent i need to add dynamic JButtons & JLabels on the JToolBar. Initially JToolBar will be empty.
Code below is not working properly...
It is creating buttons dynamiclly but i cant set any property for that one.
class DeviceAction extends AbstractAction
     public DeviceAction()
     // Add this action to the toolbar resulting
     // in a new button getting added to the
     // toolbar
     JButton jbutton = xmlFilesToolBar.add( this);
     xmlFilesToolBar.addSeparator();
     jbutton.setActionCommand( "Dynamic" );
I will call " new DeviceAction(); " when ever ActionEvent occurs.
I need to have controle over the dynamically added JButtons & JLables, bcoz each JButtons shld do some Actions when it is clicked.
Plz do the needful.
Reg,
Bha.

Multi-post: http://forum.java.sun.com/thread.jspa?threadID=725394&tstart=0

Similar Messages

  • Adding more JButton/JLabel to a frame?

    I have a two frames, one for the meny and one the text. (like a framebuilt website)
    The problem is that the text frame must have diffrent buttons, labels and textareas according to what the user choses in the menu. So it is not only a textarea that is needed to be set .
    Here is the code;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class GUI extends JFrame implements ActionListener
         //Konto
         String konto = "konto";
         //Logo
         String logo = "logo";
         //Meny
         String meny = "meny";
         String login = "login";
         //text
         String text = "text";
         int rattigheter = 0; //0 = kund, 1= personal 2=admin
         //Konto
         private JButton GUIkonto = new JButton (konto);
         //Logo
         private JButton GUIlogo = new JButton (logo);
         //meny
         private JButton GUImeny = new JButton (meny);
         private JButton GUIlogin = new JButton (login);
         //text
         private JLabel GUItext = new JLabel (text);
         private JLabel GUIlogintext = new JLabel ("Skriv in ditt anv�ndarnamn och l�senrod nedan");
         private JLabel GUIlogintext2 = new JLabel ("... Fast eftersom systemet fortfarande testas kan du bara skriva in vilka r�ttigheter du vill ha 1=kund, 2=personal 3=admin");
         private JTextField GUIloginfalt = new JTextField ("", 10);
         private JButton GUIloginknapp = new JButton ("login");
         public GUI()
              Container c = getContentPane();
              c.setLayout(new GridLayout(2, 2));
              JPanel konto = new JPanel(new GridLayout(1, 1));
              konto.add(GUIkonto);
              c.add(GUIkonto);
              JPanel logo = new JPanel(new GridLayout(1, 1));
              logo.add(GUIlogo);
              c.add(GUIlogo);
              JPanel meny = new JPanel(new GridLayout(2, 1));
              meny.add(GUImeny);
              meny.add(GUIlogin);
              c.add(meny);
              System.out.println ("ok " + text);
              if (text.equals("login"))
                   JPanel text = new JPanel(new GridLayout(4, 1));
                   text.add(GUIlogintext);
                   text.add(GUIlogintext2);
                   text.add(GUIloginfalt);
                   text.add(GUIloginknapp);
                   c.add(text);
              else
                   JPanel text = new JPanel(new GridLayout(1, 1));
                   text.add(GUItext);
                   c.add(GUItext);
              setTitle("GUI");
              setVisible(true);
              pack();
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              //------------Lyssanre----------------
              //Konto
              GUIkonto.addActionListener(this);
              //logo
              GUIlogo.addActionListener(this);
              //meny
              GUImeny.addActionListener(this);
              GUIlogin.addActionListener(this);
              System.out.println ("ok, start");
         public static void main (String[] arg)
              GUI a = new GUI();
         public void actionPerformed(ActionEvent e)
              //String konto = GUIkonto.getText();
              //----------------Konto---------------
              if (e.getSource() == GUIkonto)
                   System.out.println ("Konto");
                   GUItext.setText("konto");
              //---------------Logo----------------
              if (e.getSource() == GUIlogo)
                   System.out.println ("logo");
                   GUItext.setText("logo");
              //--------------Meny---------------
              //---------Bl�ddra---------
              if (e.getSource() == GUImeny)
                   System.out.println ("meny");
                   GUImeny.setText("meny2");
              //---------login------------
              if (e.getSource() == GUIlogin)
                   System.out.println ("login");
                   text = "login";
                   System.out.println ("text = " + text);
                   GUItext.setText("login");
                   text = "login";

    Thanks for your help, but I don't think it will work with cardLayout.
    As far as I can understand CardLayout can only show one thing at a time one JButton, or one JLabel or ...
    It must be able to show many components.
                   text.add(GUIlogintext);
                   text.add(GUIlogintext2);
                   text.add(GUIloginfalt);
                   text.add(GUIloginknapp);
                   c.add(text);

  • In outlook 2013 Add-In, Adding dynamic menu to splitButton idMso="DialMenu" is working and the same code is not working in outlook 2010 Add-In.

    In outlook 2013 Add-In, Adding dynamic menu to <splitButton idMso="DialMenu"> is working and the same code is not working in outlook
    2010 Add-In. please let me know, if i am missing something. Below is the xml and screen shot
    <contextMenu idMso="ContextMenuFlaggedContactItem">
     <splitButton idMso="DialMenu">
              <menu>
                <dynamicMenu id="CallContactwithFreedomvoice
    " label="CallContactwithFreedomvoice" 
                            getContent="OnGetContenttest"                           insertAfterMso="Call"/> 
            </menu>       </splitButton>    </contextMenu> 

    Hi Narasimha prasad2,
    Based on the description, the context menu for the flagged contact doen't work in Outlook. I am tring to rerpoduce this issue however failed.
    I suggest that you check the state of the add-in first to see wether the add-in was loaded successfully.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can we split the image when its added dynamically ?

    Hi Experts,
    I have an image where i'm calling a DAL in Entry tab Data section under section level properties.As you know that will execute during Entry process.In that DAL i'm Adding an image based on the user choice during entry.
    When image added that should be accomedate the spaces availale in the form.First half of the section can accomedate in the first page and secound half will go to next page.
    I have used CANSPLITIMAGE rule,but that is not get executed during entry process.
    Can someone help me How to split the image during entry process when its added dynamically ?
    Thanks,
    RAMAN C.

    Aside from what you might think of as the origin placement, Gendata rules are not run during Entry operations. As such, you are not able to do what you describe in versions before 12.2. Starting in 12.2, you still can't execute Gendata rules, however there is a newly supported feature when DAL adds a section that will look for the existence of the CanSplitImage rule and assigns an internal attribute that will allow the section to split during entry. This isn't the same as running the rule, but the net effect should be acceptable. (At some point in the future, perhaps this internal attribute will become something you can just set when adding the section on the form and you won't have to specify the CanSplitImage rule at all - for Batch or Entry. That would be great.) In the meantime, if you are not using 12.2, your only option is to break your section up into smaller section components and add them separately. That should help minimize unused space on the page when something doesn't fit.

  • [svn:fx-4.x] 14699: Adding pop up children to the end of automation children array so that index of static children do not change due to these dynamic children .

    Revision: 14699
    Revision: 14699
    Author:   [email protected]
    Date:     2010-03-11 06:20:06 -0800 (Thu, 11 Mar 2010)
    Log Message:
    Adding pop up children to the end of automation children array so that index of static children do not change due to these dynamic children.
    QE notes:
    Doc notes:
    Bugs: FLEXENT-1248, FLEXENT-1250, FLEXENT-1253
    Reviewer:
    Tests run: checkintests
    Is noteworthy for integration:
    Ticket Links:
        http://bugs.adobe.com/jira/browse/FLEXENT-1248
        http://bugs.adobe.com/jira/browse/FLEXENT-1250
        http://bugs.adobe.com/jira/browse/FLEXENT-1253
    Modified Paths:
        flex/sdk/branches/4.x/frameworks/projects/automation/src/mx/automation/delegates/containe rs/ApplicationAutomationImpl.as
        flex/sdk/branches/4.x/frameworks/projects/automation_spark/src/spark/automation/delegates /components/SparkApplicationAutomationImpl.as

    Revision: 14699
    Revision: 14699
    Author:   [email protected]
    Date:     2010-03-11 06:20:06 -0800 (Thu, 11 Mar 2010)
    Log Message:
    Adding pop up children to the end of automation children array so that index of static children do not change due to these dynamic children.
    QE notes:
    Doc notes:
    Bugs: FLEXENT-1248, FLEXENT-1250, FLEXENT-1253
    Reviewer:
    Tests run: checkintests
    Is noteworthy for integration:
    Ticket Links:
        http://bugs.adobe.com/jira/browse/FLEXENT-1248
        http://bugs.adobe.com/jira/browse/FLEXENT-1250
        http://bugs.adobe.com/jira/browse/FLEXENT-1253
    Modified Paths:
        flex/sdk/branches/4.x/frameworks/projects/automation/src/mx/automation/delegates/containe rs/ApplicationAutomationImpl.as
        flex/sdk/branches/4.x/frameworks/projects/automation_spark/src/spark/automation/delegates /components/SparkApplicationAutomationImpl.as

  • Adding a BSEG field to the FB03 dynamic selection screen

    Hello,
    We have a requirement wherein we want to add a field from BSEG in the dynamic selection screen of FB03.
    We found that the logical database behind this is BRF.  So we created a u2018CUSu2019 selection view for the logical database and added the field from BSEG to the functional group
    and checked the checkbox u201CPreselectu201D for it to appear automatically in the FB03 screen.
    But we still couldnu2019t see the field in FB03 dynamic selection.
    On analysis, we found that only tables are that are defined in the nodes (Extras  Selection views) can be used to create the dynamic selection and BSEG was not available
    as one of the node.  So we added BSEG as one of the node by adding the below code to the SELECTION of the logical database.
    SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE BSEG.
    Even after that, we couldnu2019t see the field from BSEG in the dynamic selection.
    Are we missing anything here?
    I see many threads here on similar lines but no one has posted the exact step. Any help is highly appreciated.
    Thanks a lot.
    Regards,
    Suganya

    Hi
    If you want to take the line item details than you can refer these t-codes rather than customizing.
    S_AC0_52000887 - Receivables: Profit Center
    S_AC0_52000888 - Payables: Profit Center
    S_ALR_87012332 - G/L Account Statements
    Here by using the dynamic selection you can get the results. Use object list display and select the layout for more fields.
    Thanks

  • Adding  prompts dynamically and then send the results to users via email

    Hi,
    We have to schedule the reports for auto delivery to users at a specific time period. Please, tell me the mechanism to schedule them and how to assign prompt values to them. Currently, the reports are run by users by selecting prompts from the dashboard. If we schedule them, we will have to add some of these prompts dynamically and then send the results to users via email.
    Thanks in advance!

    Hi,
    I haven't tested it myself...but may be the following steps can help you.
    Fill some session variables depending on the the name of the user who logs in (this can be done easily be creating different session variables and put some executing order in it)
    Then you use these session variables as default values for your prompts. So the report will be executed making use of this default values.
    And by scheduling your ibot..you can send it by mail.
    I don't know if it's this what you're looking for...probably you have to base your prompt values depending on the users that are selected in your ibot?
    Hope it can help y ou in some way or another...
    KR,
    A

  • Adding JTextField to JLabel

    Hi All,
    I already have a JButton and JLabel on the Frame.So when i press the button JTextField need to be added to JLabel.
    JLabel.setLabelFor(JComponent c).Does this method work or is there any other way in doing this.??
    Thanks in advance for all.
    regards,
    Viswanadh

    Hi Cam,
    I am posting now.Is it correct then its ok or else tell me how to do it,because i was not 100% sure of posting SSCCE.
    public class VNVGenerator extends JFrame {
    static public Hashtable<String, Integer> buffer_no_of_input_params = new Hashtable<String, Integer>();
    static public Hashtable<String, Integer> buffer_return_type = new Hashtable<String, Integer>();
    static public JComboBox functionbox=new JComboBox();
    static Font style=new Font("Palatino Linotype", Font.BOLD | Font.PLAIN,14);
    public JPanel settingsPanel;
    public JLabel typeLabel,inparam,outparam,returnparam;
    public JFrame vnvframe;
    static{
               try{
                                   File file = null;
                                     FileReader freader = null;
                                     LineNumberReader lnreader = null;
                          String parttoken[]=new String[4];                    
                                   String nameidentitiy;
                             StringTokenizer tokenizer;
                                   JFileChooser filetypechooser = new JFileChooser();
                                    String currentdir = System.getProperty("user.dir");               
                                File dir = new File(currentdir);
                if (dir.isDirectory()) {
                                        File[] files = dir.listFiles();
                            for(int i = 0; i < files.length; i++)
                               nameidentitiy=filetypechooser.getTypeDescription(files);
              if((files[i].getName().toUpperCase().endsWith("TXT"))&&(files[i].getName().toLowerCase().startsWith("tmtv")))
                                  freader = new FileReader(files[i].getName());
    lnreader = new LineNumberReader(freader);
    String line = "";
    while ((line = lnreader.readLine()) != null)
    tokenizer=new StringTokenizer(line);
                                                 int tokens=tokenizer.countTokens();                    
                                                 int nooftokens=0;
    while ((nooftokens<tokens)&&(tokenizer.hasMoreTokens()))
                                                      parttoken[nooftokens]=tokenizer.nextToken();                                   
                                                           nooftokens++;
                   functionbox.addItem(parttoken[1].toString());
                   buffer_no_of_input_params.put(parttoken[1],new Integer(parttoken[2]));
                   buffer_return_type.put(parttoken[1],new Integer(parttoken[3]));
                   Integer value = (Integer) buffer_no_of_input_params.get(parttoken[1]);
                   Integer returnvalue = (Integer) buffer_return_type.get(parttoken[1]);
                                  catch(Exception e){
         e.getMessage();
    public VNVGenerator(){
    vnvframe=new JFrame("VNVAPI Test Window");
    Border apiborder = BorderFactory.createLineBorder(Color.RED,1);               
              settingsPanel= new JPanel();
              settingsPanel.setBorder(
              BorderFactory.createTitledBorder(apiborder,"VNVAPI Manual Test Settings",TitledBorder.LEFT,TitledBorder.TOP,style,new Color(142,142,56)));
    functionbox.addActionListener(new OnCallingRequiredFunction());               
    inparam=new JLabel("In Param:");
    settingsPanel.add(inparam);
    vnvframe.getContentPane().add(settingsPanel, BorderLayout.CENTER);
    class OnCallingRequiredFunction implements ActionListener{
         final JSeparator separator = new JSeparator();
    public void actionPerformed(ActionEvent selectEvent){
              JComboBox source = (JComboBox) selectEvent.getSource();
                             Object item= source.getSelectedItem();
                             item=item.toString().trim();
    OnFetchingValueFromHashTable(item);
         public void OnFetchingValueFromHashTable(Object key){
              OnCreatingInputParametersTextFieldComponent(buffer_no_of_input_params.get(key));
         public void OnCreatingInputParametersTextFieldComponents(int inputparameters)
         GridBagConstraints constraints=new GridBagConstraints();
    final int no = new Integer(inputparameters);
    System.out.println("No of Parameters are:"+no);
    for (int i = 0; i < no; i++) {
                   inparam.add(new JTextField(2),constraints.HORIZONTAL );
    settingsPanel.revalidate();// you may comment this out because next statement is pack()
    public static void main(String args[])
              try {
                   UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
                   new VNVGenerator();
                   }catch(Exception e){
                   e.getMessage();
    regards,
    Viswanadh

  • How to hide columns that are getting added dynamically to UI Element 'Table

    In SRM 7.0 while displaying a RFx, click on "responses and awards" button.
    In the response comparision tab once the user selects response number and clicks on "compare all responses".
    Item details table is displayed with fields item number,internal number,item description,........,Price etc.
    Requirement is  to hide the price column from the table.
    The UI element type is 'Table'.
    But the catch is there is no column price visible at layout design level.
    This field is getting added dynamically at run time.
    When i right click and see the 'more field help' at the front end i get the field id as 'GRP_1_COL_3_TXTV'.
    lo_table ?= view->get_element( id = 'ITEMS_TABLE' ).
    lo_column = lo_table->get_column( id = 'GRP_1_COL_3_TXTV').
    ASSERT lo_column IS NOT INITIAL.
    lo_column->set_visible( EXPORTING value = '01' ).
    I had written the above code in the pre-exit of WDDOMODIFYVIEW.
    But i am getting dump as assertion failed.it says no column by name 'GRP_1_COL_3_TXTV'.
    Please help me inhow to hide fields or buttons getting generated dynmically.
    Regards,
    Venkat Raghavan.

    Hi Anitha,
    What i understood from your question is,you want to control the table from your inputs.I have a one question for you what do you want to show defaultly i.e when you run the application what you want to show,either no table or table with some values.
    Any how i am giving solution in this way.
    If both inputs are given proper table output is displayed
    Write your below logic in the WDDOMODIFYVIEW )
    Here i am assuming that you already have a table element in the view.
    Get the values entered in the input fields and compare those 2 values ,if the condition is satisfied then bind the values which you want to show in the table to the context node.
    but if only 1 input is given a column is empty in the output table so i want to hide this column dynamically at runtime based on my inputs
    You are telling that you know the empty column.If so get the view element reference and use the REMOVE_COLUMN to remove the column.
    data:lr_table type ref to cl_wd_table,
           lr_column type ref to L_WD_TABLE_COLUMN.
    lr_table ?= view->get_element( 'TABLE1' ).
    CALL METHOD LR_TABLE->REMOVE_COLUMN
        EXPORTING
          ID          = 'TABLE1_color'
         INDEX      =
        RECEIVING
          THE_COLUMN = lr_column.
    i want to hide some empty rows also at runtime based on inputs.
    Removing the rows is very simple.if you know the key fields data of internal table from your input fields then do in this way.
    delete itab from wa where key1= "12" and key2="abd".
    Now bind the internal table to context node.
    LO_ND_hcm->BIND_TABLE(
          NEW_ITEMS            = it_final
          SET_INITIAL_ELEMENTS = ABAP_TRUE ).

  • CProjects - Adding a new field to the detail screen of object link

    Hi All,
    I've a requirement of adding a new field to the detail screen of object link. But the field is a combination of 3 other standard fields.
    Please let me know how could i realise this functionality?
    Thanks in advance.

    Hi Srini,
    Thanks for your Reply
    I have kept 01 against the field BSEG-AUGDT and selected the preselect check box also.
    But still that field is not visible in the dynamic selection screen.
    Thanks
    Ajay.D

  • Adding a new field to the selection screen of a LDB

    Hi all,
    I want to add a new field Clearing date(BSEG-AUGDT) in the dynamic selection screen of  the report RFUMSV00.
    For adding a new field i have copied the SAP view of a Logical database to CUS view.
    Next i had added the Clearing date(BSEG-AUGDT) to the function group Document header(01) and selected the check box Preselect and saved the view.
    But still i am not able to find the newly added field in the dynamic selection screen of the report.
    Please suggest me where i am going wrong or how to do this.
    Thanks in advance
    Ajay

    Hi Srini,
    Thanks for your Reply
    I have kept 01 against the field BSEG-AUGDT and selected the preselect check box also.
    But still that field is not visible in the dynamic selection screen.
    Thanks
    Ajay.D

  • Dynamic File Name - Suppress the Substitue varible

    Hi All,
    I am doing the scenarios like File name at the recevier end would be dynamic for that i take an extra field NAME mapped with UDF which return the file name dynamically. It is working fine and doing good. But the problem here is , this field is the first field in my target structure so i am getting an empty line in the target file.
    So My structure as follows:
    <b>MT_BNK01           1..1
      NAME                1..1
      RECORD             0..Unbound
          --Record_data  0..Unbound</b>
    So in the recever side i written as follows
    Recordset Structure:: RECORD
    <b>RECORD.fieldSeparator = 'nl'
    RECORD.endSeparator = 'nl'</b>
    But according to this weblog i can suppress the empty line but it is not working
    /people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
    means, NAME is also in the same level of RECORD in the Structure. So How can i pass the structure as ??
    I tried to pass the RecordSet Structure: NAME,RECORD
    and following parameters, it is not working
    <b>NAME.fieldFixedLength =0
    NAME.fieldLengthTooShortHandling = Cut</b>
    Can you please  suggest me what could be the reason. Tell me what information i need to pass the RecordSet Structure and attrubute information also.
    One more thing like, My sender side it is not picking the empty lines. What could be the reason. I given fieldSeparator and endSeparator as 'nl'. So to catch the empty line what i need to do???
    Thanks in Advance,
    Best Regards,
    Vijay

    Hi Vijaya,
    This can be solved. Actually i had the same scenario where i was getting blank line for the header. Suppose Header was carrying the file name after i cut the value i would get a blank line in file.
    So i added in content conversion parameter the following line
    Header.endSeparator - '0'
    then the first line was not blank.
    Try this, i think your issue will be solved
    Regards,
    Ramesh P
    Message was edited by:
            Ramesh Parashivamurthy

  • Adding dynamic attributes to static context node

    Hi All,
    I have defined a context node LINES with several attributes. This is done staticly during developmenttime.
    During run-time node LINES is extended with several attributes dynamicly. See below:
    10     HEADER_GUID               ->
    11     DETAIL_GUID               ->
    12     EXTERNAL_ID               ->
    13     OBJECT_TYPE               ->
    14     IN_OUT_PLAN               ->
    15     TRAFFIC_LIGHT_1               ->
    16     TRAFFIC_LIGHT_2               ->
    17     TRAFFIC_LIGHT_3               ->
    18     TRAFFIC_LIGHT_4               ->
    19     _LOCATION          \TYPE=STRING     ->
    20     _ZZTOPGROUPING     \TYPE=STRING     ->
    21     _STATUS          \TYPE=STRING     ->
    22     _100000200          \TYPE=STRING     ->
    19..22 are added dynamicly.
    I have an internal table that matches de new context. This <fs_tb_tree_new> I want to bind like:
    *&- bind table
      lr_node->bind_table( new_items =  <fs_tb_tree_new>
                           set_initial_elements = abap_true ).
    In <fs_tb_tree_new> the dynamicly added attrbutes contains values e.g. (the static attributes also have values via <fs_tb_tree_new>):
                         _LOCATION   _ZZTOPGROUPING  _STATUS              _100000200                   
    5     Africa     0002     Reporting Entity     0.000
    6     Russia, CIS     0003     Identify                          0.000
    An ALV presents the values of the attribute. But.... only the values of the static part are presented, not the dynamic attributes added during runtime.
    Please advise what I forget or do wrong .
    Thanks in advance.
    John

    I solved the issue:
    If you use a combination of static attributes added with dynanic attributes (during runtime) for dynamic ALV, I advise to create a new node and bind the values to this new created node:
    Cheers, John
    wd_this->extend_context( EXPORTING im_struc_descr =  lr_cl_abap_structdescr
                               IMPORTING ex_node = lr_node_alv ).
    Method:
    *&- Create new dynamic context LINES_DYN
    Node for alv-table
      lr_node_info = wd_context->get_node_info( ).
      CALL METHOD lr_node_info->add_new_child_node
        EXPORTING
          name                  = 'LINES_NEW'
          static_element_rtti   = im_struc_descr
          is_static             = abap_true
          is_multiple           = abap_true
          is_multiple_selection = abap_false
        RECEIVING
          child_node_info       = lr_subnode_info.
    lr_node = lr_subnode_info->get_parent( ).
      lr_node = wd_context->get_child_node( 'LINES_NEW' ).
      ex_node = lr_node.
    *&- bind table for alv
      lr_node_alv->bind_table( new_items =  <fs_tb_tree_new>
                               set_initial_elements = abap_true ).

  • AdvancedDataGrid headerrenderer children added dynamically do not display

    The AdvancedDataGrid in Flex 3.x does not correctly render children of a custom headerrenderer when the children are added dynamically. This works correctly with the DataGrid.
    An AdvancedDataGrid has a custom headerrenderer with one field to display the column header text.
    A show button below the grid adds a text input field in the header below the column text in the header.
    When the show button is selected, the AdvancedDataGrid header sizes correctly to leave space for the field but does not display the field.
    If I drag the column, the text input field displays as I am dragging. See the 3 images below.
    I have included the 3 source files. What is the correct way to dynamically add children to an AdvancedDataGrid header?
    Thanks.
    1. AdvancedDataGrid with only the column header text:
    2. After Show is selected, the header is sized for the text field below:
    3. Only dragging the column header temporarily shows the text field:
    1. TestGrid.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="onInit(event)" width="100%" height="100%">
    <mx:Script>
    <![CDATA[
         protected function onInit(event:Event):void {
              var cols:Array = grid.columns;
              var colWidth:int = grid.width;
              var col:AdvancedHeaderColumn = new AdvancedHeaderColumn();
              col.wordWrap = true;
              col.show = false;
              var headerRenderer:ClassFactory = new ClassFactory(AdvancedHeaderLabel);
              // Add any custom properties
              headerRenderer.properties = {text: "Column1 header that wraps", dataGridColumn: col};
              col.headerRenderer = headerRenderer;
              col.headerWordWrap = true;
              cols.push(col);
              grid.columns = cols;
              grid.measuredWidth = colWidth;
         protected function showText(event:Event):void {
              var cols:Array = grid.columns;
              for each (var col:AdvancedHeaderColumn in grid.columns) {
                   col.show = show.selected;
              grid.columns = cols;
    ]]>
    </mx:Script>
         <mx:AdvancedDataGrid id="grid" height="100%" width="100%" variableRowHeight="true" editable="true" lockedColumnCount="1"/>
         <mx:Button label="Show" id="show" click="showText(event)" selected="false" toggle="true"/>
    </mx:Application>
    2. AdvancedHeaderLabel.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" verticalScrollPolicy="off">
    <mx:Script>
    <![CDATA[
         import mx.controls.TextInput;
         import mx.core.UITextField;
         // properties
         public var text:String;
         public var dataGridColumn:AdvancedHeaderColumn;
         // Column header
         public var textField:UITextField;
         // Optional text input field
         public var textInput:TextInput;
         override protected function createChildren():void {
              super.createChildren();
              // Always add the header text
              textField = new UITextField();
              textField.text = text;
              textField.multiline = true;
              textField.wordWrap = true;
              textField.percentWidth = 100;
              addChildAt(textField, 0);
         override protected function commitProperties():void {
              super.commitProperties();
              // Add the text input field?
              if (dataGridColumn && dataGridColumn.show && !textInput) {
                   textInput = new TextInput();
                   box.addChild(textInput);
         override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
              super.updateDisplayList(unscaledWidth, unscaledHeight);
              // Position and size the textInput field
              if (dataGridColumn.show && textInput) {
                   textInput.y = textField.getExplicitOrMeasuredHeight();
                   textInput.setActualSize(unscaledWidth, textInput.getExplicitOrMeasuredHeight());
         override protected function measure():void {
              super.measure();
              measuredWidth = textField.getExplicitOrMeasuredWidth();
              measuredHeight = textField.getExplicitOrMeasuredHeight();
              // Make room for the text input field
              if (textInput) {
                   measuredHeight += textInput.getExplicitOrMeasuredHeight();
    ]]>
    </mx:Script>
         <mx:VBox height="100%" width="100%" id="box" verticalAlign="bottom"/>
    </mx:VBox>
    3. AdvancedHeaderColumn.as
    package {
         import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
         public class AdvancedHeaderColumn extends AdvancedDataGridColumn {
              public var show:Boolean = false;
              public function AdvancedHeaderColumn(columnName:String=null) {
                   super(columnName);

    Thanks Hackintosh.
    It prints as it views, as a corrupt jpeg. I also dug into console and it confirmed there was an error about a corrupt jpg. The most interesting thing is if I open the bad pdf in Photoshop the whole image is there with no signs of corruption. This leads me to believe it's something with how OSx and/or Safari are rendering the jpgs. Another curious sidenote, Safari on Windows works fine but if you save the pdf, move it to a mac and open it, you get the corrupted jpg again.
    I think I'm going to try and stop swimming upstream now. At the end of the day I don't care if the images are pngs, tiffs, or eps. I'm going to try feeding a few different formats and see if that doesn't fix the problem.

  • Adding dynamic panels

    My application needs to dynamically decide how many components will be present in the panel depending on the clauses. For each clause, I have designed a seperate panel,(its design is fixed) . But the number of clause panels to be included in the main panel is dynamic. How do I add the panels to the main panel for display?
    I was successful in adding a single panel to the main panel. For this I had to define the layout of the panel again and set its horizontal and vertical group. But how do I add a list of components. If I add a for loop within the layout.setHorizontalGroup() or layout.setVerticalGroup(), it does not work. Also panel.addLayoutComponent() did not work. Can anyone please tell me how will I add the components dynamically.

    Its still not working.
    In my application I have some user defined panels. The component I need to add to the main panel is a user defined panel.
    The code is as follows, where panelBetween is a user-defined panel in the package com.HelperTool
    com.HelperTools.panelBetween between1 = new com.HelperTools.panelBetween();
                between1.jCheckBoxBetweenCondition.setText("Where userid between");
                jPanelMain.add(between1);
                jPanelMain.revalidate();
                jPanelMain.repaint();

Maybe you are looking for

  • Pavilion dv4405nr laptop hard drive and recovery

    Hi, My daughter's Pavilion dv4405nr laptop's HDD (Samsung MP0804H Spinpoint M Series 80GB) is dead. It doesn't boot, and BOIS HDD test gives error 7. I took the HDD out, and connected it to several PCs (home, work) using two HDD universal adapters (l

  • How to add attribute to ISE 1.2

    The authentication details page shows under "Other Attributes" an attribute called SelectedAuthenticationIdentityStores Is there a way I can create rules based on this attribute? I can't find it anywhere in the policy conditions options. Thanks in ad

  • Problem creating an excel with ALV GRID

    Hi all, this is my problem: i have an ALV GRID in which I display several columns in a proper order, es : A B C D E F G when i create an excel from this display i obtain a different order of the columns! in particular the 3 columns which represent nu

  • Jpeg edges in Illustrator prevent any action

    Hi, I am brand new to Photoshop and Illustrator. I have CS5.5 When I open a jpeg in Illustrator, the "edges" (i.e. the box around the picture) prevent me from doing anything. When you hover over this box it actually says "edge". I am trying to ungrou

  • Exposing Portal's User Management functionality via Web Service issue

    Dear experts, I am trying to create and deploy a web service that will tap into User Management functionality (UMFactory) of the Portal. I created a Java project with a Java class with one of the methods exposed via Web Service. Since this is a Java