(Urgent) Dynamically created buttons: which one?

I need to dynamically create an array of gridpanels. There is a button and some other components on each gridpanel. I need to implement an action handler for the button (using method binding). But how do I know which button fires the event?
Thanks a lot!

Hi,
One of the possible solutions is:
Have a hidden field in the form. For each of the buttons write a javascript onclick event method in which the id of the button clicked is assigned to the hidden field. The value of this hidden field is available in the method handler. This helps in identifying which button was clicked.
Hope this helps
Cheers
Giri

Similar Messages

  • Accessing Dynamically created Button

    Hi,
    Can someone give me an example how to access dynamically created button? 
    I know how to create a button dynamically but don't know how to access from AS3.
    Thanks!

    Hi,
    Please go through following links.
    1) http://www.daveoncode.com/2009/05/20/objectcollector-accessing-dynamic-generated-flex-obje cts-by-id/
    2) http://stackoverflow.com/questions/6740813/flex-assigning-events-to-dynamically-created-bu ttons
    3) http://www.justskins.com/forums/adding-click-event-to-35785.html
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • Dynamically create button

    Good evening,
    Can you help me,
    How can i dynamically create button?
    Can you give me example code, and how i can make event for this button.
    Regards.
    Points garantied.

    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/11/ba74412cba127de10000000a155106/frameset.htm">Sap Library</a>

  • Futureproof and dynamically created button

    I have been looking solution how to make buttons dynamically so that I can fetch dynamically values for buttons:
    - value,onclick,class,type,request
    This excellent page has very closely what I am looking: http://www.laureston.ca/2012/04/20/simple-workflow-implementation-in-apex/
    but I have challenges getting the escaped special characters to work especially for the apex.submit - part.
    Maybe that is just because 'copy-pasting' the plsql-region code from www-page didn't work out of the box
    Application Express 4.2.3.00.08
    Because dealing with the escape chars make the page easily break and there are now the new dynamic actions, I need to check what would be futureproof way of dynamically creating the buttons.
    If this is anyway the most practical way to proceed, then where I should look for further information about htp.p(....) button creation examples with rich escapes?
    Made small test page, where you can see one of my trials trying to get the escapes right.
    user test
    pass test
    http://apex.oracle.com/pls/apex/f?p=1403:2
    rgrds paavo
    --below the code for dynamic plsql region -- very likely the escape chars are not copypasted and shown correctly:
    DECLARE
    --PL/SQL Dynamic Region
    --thisworks too??
      v_showme varchar2(3000);
    BEGIN
      for c in (select sysdate||'asdasd;asdasas'  as button_label
                , 'PIMREQUEST'  as button_request
                , 'button-gray' as button_class
                , 'button'      as button_type
                , 'P38_XPIMPOM' as button_setme
                , 'JUUSTOA'     as button_setme_value
                from dual) loop
    htp.p('<button value='''||c.button_label||''' onclick=\"apex.submit('''||c.button_request||''');'' class='''||c.button_class||''' type='''||c.button_type||'''>
    <span>'||c.button_label||'</span>
    </button>');
      end loop;
    END;

    Hi Paavo,
    Your right about the button_id. It's value comes from an input parameter. The button won't show up in the "When button pressed"-list_of_values. This is not only because you write the id yourself, but more because the entire button is created on the fly. The button isn't stored internal in an apex table, that's why it won't show up in a list of values.
    If you want to trigger a dynamic action with the button, you can use a jQuery selector as triggering element. Here you can refer to the button_id using the '#' as jQuery marker for ID, e.g. '#myButton'.
    What the button that you render does, depends on what you put in the p_link parameter. A normal save button would submit the page with condition 'SAVE', you can do that by setting p_link to 'apex.submit("SAVE")'. If the button should do a page redirect, you set p_link to 'http://www.page2go.com', or whatever url you wish to redirect to.
    The text you put in the button attributes is added as HTML element definition, so if you set p_attrs to 'alt="alternate text"', that will be added to the html of your button.
    An example for a conditional button call could be:
          if p_order_id is null
          then
            create_button
              ( p_id        => 'newOrder'
              , p_link    => 'javascript:apex.submit("CREATE"');'
              , p_label     => 'New Order'
              , p_css       => 'customButton'
          else
            create_button
              ( p_id        => 'updateOrder'
              , p_link    => 'javascript:apex.submit("SAVE"');'
              , p_label     => 'Update Order'
              , p_css       => 'customButton'
          end if;     
    This would create a 'CREATE' button for a new order (p_order_id is null), or a 'SAVE' button for an existing order.
    Regarding your ps: if you mean can you conditionaly create a button using dynamic actions? Then the answer would be yes. Yes you can use the create_button procedure in a dynamic action, however by writing it as stored procedure in the database, or in a database package, you can easily reuse your code and still have only one version of your procedure that you need to maintain.
    Regards,
    Vincent
    http://vincentdeelen.blogspot.com

  • For loop and xml - how to point the right content in a XML file with a dynamically created button?

    Hi Everybody,
    as my first experience in AS3 I'm bulding a photo multigallery. In that gallery I have some buttons, each one pointing to its respective set of images.
    Each button is created with the for loop, that picks the information from a XML file. From this XML I get the text of the button, the position etc. What I did with some sucess. But there is a scary problem: I don't know how to make each button load the respective and unique set of images.
    I've tryied several different methods, with no effect, to make each loop to give to each button an unique identity to load the respective set of images.
    I imagine that the solution pass by the use of arrays. I wrote some code, and I guess that I'm almost there (but not sure). Here is my AS3 code until now:
    // CREATE MENU CONTAINER //
    var menuContainer:MovieClip = new MovieClip();
    menuContainer.x=10;
    menuContainer.y=300;
    addChild(menuContainer);
    // CREATE IMAGES CONTAINER //
    var imagesContainer:MovieClip = new MovieClip();
    imagesContainer.x=10;
    imagesContainer.y=10;
    addChild(imagesContainer);
    //// LOAD XML ////
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, whenLoaded);
    xmlLoader.load(new URLRequest("XML/roiaXML.xml"));
    var xml:XML;
    function whenLoaded(evt:Event):void {
         xml=new XML(evt.target.data);
         var mySetsList:XMLList=xml.children();
         //// MENU BUTTONS ////
         // CREATE ARRAYS //
         var totalArray:Array = new Array();
         var setNodesArray:Array = new Array();
         var setNamesArray:Array = new Array();
         // POSITIONING BUTTONS INSIDE MENU CONTAINER//
         var rowsQuantity:Number=3;
         var columnsQuantity:Number=Math.ceil(mySetsList.length()/rowsQuantity);
         var cellWidth:Number=160;
         // CREATE BUTTONS //
         for (var i:int=0; i< mySetsList.length(); i++) {
              var newSetButtonMC:setButtonMC=new setButtonMC();
              //what do I do here to make it works? To give each button created a unique id.
              setNodesArray.push(i);
              //trace(setNodesArray);
              var imageNodesArray:Array = new Array();
              for (var j:int=0; j<mySetsList[i].IMAGE.length(); j++) {
                   imageNodesArray.push(mySetsList[i].IMAGE[j].attribute("imageTitle"));
              totalArray.push(imageNodesArray);
              newSetButtonMC.setButtonText.text=mySetsList.attribute("galeriaTitle")[i];
              newSetButtonMC.setButtonText.autoSize=TextFieldAutoSize.LEFT;
              var cellX:Number=Math.floor(i/rowsQuantity);
              var cellY:Number=i%rowsQuantity;
              newSetButtonMC.x=cellX*cellWidth;
              newSetButtonMC.y=cellY*(newSetButtonMC.height+10);
              newSetButtonMC.addEventListener(MouseEvent.CLICK, onClick);
              menuContainer.addChild(newSetButtonMC);
         totalArray.push(setNodesArray);
         //// MENU BUTTONS ACTIONS ////
         function onClick(mevt:MouseEvent):void {
              trace(totalArray [0][0]);
              trace(totalArray [0][0]);
              // in the line above I achieved some success loading a specific info from XML.
              // but I don't know what to do with it.
              //what do I do here? To make each button to load its own node from XML.
    Here is my XML:
    <GALERIA galeriaTitle="galeria 01">
      <IMAGE imageTitle="imageTitle01">feio.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle02">muitofeio.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle03">aindamaisfeio.jpg</IMAGE>
    </GALERIA>
    <GALERIA galeriaTitle="galeria 02">
      <IMAGE imageTitle="imageTitle01">estranho.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle02">maisestranho.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle03">aindamaisestranho.jpg</IMAGE>
    </GALERIA>
    Thanks everyone . ABSTRATO

    you can assign each newSetButtonMC and ivar property that points to its i value or, even easier:
    // CREATE MENU CONTAINER //
    var menuContainer:MovieClip = new MovieClip();
    menuContainer.x=10;
    menuContainer.y=300;
    addChild(menuContainer);
    // CREATE IMAGES CONTAINER //
    var imagesContainer:MovieClip = new MovieClip();
    imagesContainer.x=10;
    imagesContainer.y=10;
    addChild(imagesContainer);
    //// LOAD XML ////
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, whenLoaded);
    xmlLoader.load(new URLRequest("XML/roiaXML.xml"));
    var xml:XML;
    function whenLoaded(evt:Event):void {
         xml=new XML(evt.target.data);
         var mySetsList:XMLList=xml.children();
         //// MENU BUTTONS ////
         // CREATE ARRAYS //
         var totalArray:Array = new Array();
         var setNodesArray:Array = new Array();
         var setNamesArray:Array = new Array();
         // POSITIONING BUTTONS INSIDE MENU CONTAINER//
         var rowsQuantity:Number=3;
         var columnsQuantity:Number=Math.ceil(mySetsList.length()/rowsQuantity);
         var cellWidth:Number=160;
         // CREATE BUTTONS //
         for (var i:int=0; i< mySetsList.length(); i++) {
              var newSetButtonMC:setButtonMC=new setButtonMC();
              //what do I do here to make it works? To give each button created a unique id.
              setNodesArray.push(i);
              //trace(setNodesArray);
              var imageNodesArray:Array = new Array();
              for (var j:int=0; j<mySetsList[i].IMAGE.length(); j++) {
                   imageNodesArray.push(mySetsList[i].IMAGE[j].attribute("imageTitle"));
             nextSetButtonMC.imageArray = imageNodesArray;
              //totalArray.push(imageNodesArray);
              newSetButtonMC.setButtonText.text=mySetsList.attribute("galeriaTitle")[i];
              newSetButtonMC.setButtonText.autoSize=TextFieldAutoSize.LEFT;
              var cellX:Number=Math.floor(i/rowsQuantity);
              var cellY:Number=i%rowsQuantity;
              newSetButtonMC.x=cellX*cellWidth;
              newSetButtonMC.y=cellY*(newSetButtonMC.height+10);
              newSetButtonMC.addEventListener(MouseEvent.CLICK, onClick);
              menuContainer.addChild(newSetButtonMC);
         totalArray.push(setNodesArray);
         //// MENU BUTTONS ACTIONS ////
         function onClick(mevt:MouseEvent):void {
              var mc:setButtonMC=setButtonMC(mevt.currentTarget);
    for(i=0;i<mc.imageArray.length;i++){
    trace(mc.imageArray[i]);
    Here is my XML:
    <GALERIA galeriaTitle="galeria 01">
      <IMAGE imageTitle="imageTitle01">feio.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle02">muitofeio.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle03">aindamaisfeio.jpg</IMAGE>
    </GALERIA>
    <GALERIA galeriaTitle="galeria 02">
      <IMAGE imageTitle="imageTitle01">estranho.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle02">maisestranho.jpg</IMAGE>
      <IMAGE imageTitle="imageTitle03">aindamaisestranho.jpg</IMAGE>
    </GALERIA>
    Thanks everyone . ABSTRATO

  • Adding f:Attribute dynamically to a dynamically created Button

    Hi ,
    I am trying to dynamically create a CommandButton and attach a f:Attribute to the same. But somehow I am not able to get hold of the correct API to do the same -
    >RichCommandButton button=new RichCommandButton();
    >button.setText("Ok");
    >AttributeTag attr=new AttributeTag();
    >attr.setValue("DC_OPERATION_BINDING", "bindings.DENY");
    >button.getChildren().add(attr);
    The issue is that the add method expects a UIComponent and attr is of type com.sun.faces.taglib.jsf_core.AttributeTag

    gues u can use it like
    button.getAttributes().put(DC_OPERATION_BINDING", "bindings.DENY");
    {code}
    http://docs.oracle.com/cd/E17802_01/j2ee/j2ee/javaserverfaces/1.2/docs/api/javax/faces/component/UIComponent.html#getAttributes%28%29                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Dynamically creating buttons or hyperlinks

    Hi all,
    I am new to JSF and I am having some trouble. Hope you can help.
    Situation: I have a database that contains contacts (i.e. names, addresses, telephone numbers, etc). I want to display a list of contacts in a table. For each item of this list I want a link in order to come to a detail screen of this item.
    Creating a table that displays the names is no problem. However, the button (or hyperlink) seems to be problematic. I have looked in the archives and have found some people asking similar questions, but no alternative approach was really described. (See http://forum.java.sun.com/thread.jsp?forum=427&thread=448135) I am wondering what the best approach is at this moment in time.
    Patrick

    Roger,
    Thanks for the suggestion. Unfortunatley, JSF does not do what you suggest. The id's that it generates are all the same.
    Here is the jsf page:
    <f:use_faces>
    <h:form formName="form1" id="form1">
    <h:panel_list id="contacts" >
    <h:panel_data id="contact" var="contact" valueRef="searchDatabase.queryResult">
    <h:command_hyperlink actionRef="searchDatabase.select" label="View Details" commandName="submit">
    <f:parameter name="contactID" valueRef="contact.contactID" />
    </h:command_hyperlink>
    </h:panel_data>
    </h:panel_list>
    </h:form>
    </f:use_faces>
    And here is the resulting html:
    <form method="post" action="/wc2/faces/protected/search_database_result_test.jsp">
    <table border="0" cellspacing="0" cellpadding="6" >
    <tr>
    <td><a href="# onmousedown="document.forms[0.id0.value='submit'; document.forms[0].submit()">View Details</a><input type="hidden" name="id0"/><input type="hidden" name="contactID" value="1216"/></td>
    </tr>
    <tr>
    <td><a href="#" onmousedown="document.forms[0].id0.value='submit'; document.forms[0].submit()">View Details</a><input type="hidden" name="id0"/><input type="hidden" name="contactID" value="1432"/></td>
    </tr>
    <tr>
    <td><a href="#" onmousedown="document.forms[0].id0.value='submit'; document.forms[0].submit()">View Details</a><input type="hidden" name="id0"/><input type="hidden" name="contactID" value="1511"/></td>
    </tr>
    <tr>
    <td><a href="#" onmousedown="document.forms[0].id0.value='submit'; document.forms[0].submit()">View Details</a><input type="hidden" name="id0"/><input type="hidden" name="contactID" value="2871"/></td>
    </tr>
    </table>
    </form>
    See the problem... all id's are the same, i.e. "id0".
    Patrick

  • Trying to pivot based on a dynamically created query which generates XML data

    Hi there,
    Hope someone can help
    I'm trying to pivot row data into a pivot type result set where the records for a given employee are pivoted to a single row.
    To do this, I've declared a dynamic query to retrieve the GUID values of the different training course- the actual course names are full of SQL escape characters e.g. ', (,) which I thought might mess up the dynamically generated query
    I've got as far as writing
    DECLARE
    @employeeidsVARCHAR(10)
    DECLARE
    @coursesVARCHAR(max)
    DECLARE
    @queryVARCHAR(max)
    SELECT
      @courses=STUFF((SELECT 
    DISTINCT[TRAIN_ID]
    FROM  
    [Megapay_IWA].[dbo].[HRS_TRAINING]
    FORXMLPATH('')
    ),2,0,'')+']'
    SET
    @query=
    'SELECT * FROM
    (  SELECT t.TRAIN_TRAINING,
       EMPL_EMPLOYEE_ID
            FROM 
    [Megapay_IWA].[dbo].[HRSTRNDONE] as tc
    left  join  Megapay_IWA.dbo.PAYEMPL  as e on tc.TRND_ONRID = e.EMPL_EMPLOYEE_id
    left join [Megapay_IWA].[dbo].[HRS_TRAINING] as t on tc.TRND_TRAIN_ID =t.TRAIN_ID
    ) t
    PIVOT (COUNT(EMPL_EMPLOYEE_ID) FOR TRAIN_ID in
    +@courses+'))
    AS pvt'
    EXECUTE
    (@query)
    which generates a dynamic query along the following lines but how to I update the query to correctly read the train_id values in the xml
    SELECT * FROM
    (  SELECT t.TRAIN_TRAINING,
       EMPL_EMPLOYEE_ID
            FROM 
    [Megapay_IWA].[dbo].[HRSTRNDONE] as tc
    left  join  Megapay_IWA.dbo.PAYEMPL  as e on tc.TRND_ONRID = e.EMPL_EMPLOYEE_id
    left join [Megapay_IWA].[dbo].[HRS_TRAINING] as t on tc.TRND_TRAIN_ID =t.TRAIN_ID
    ) t
    PIVOT (COUNT(EMPL_EMPLOYEE_ID) FOR TRAIN_ID in
    <TRAIN_ID>F607BA64-BD24-4C6F-810E-001E7487FB4B</TRAIN_ID><TRAIN_ID>784EF318-628F-407E-8844-0049E3DD8F86</TRAIN_ID><TRAIN_ID>C7F3B365-7E6C-4CDF-9F0C-010207D1E493</TRAIN_ID><TRAIN_ID>7A82C4C1-5A9F-4EB0-9988-018405D3347A</TRAIN_ID><TRAIN_ID>E3FC88F5-AF5F-4D75-816A-02085190FC5C</TRAIN_ID><TRAIN_ID>BEB39D10-7887-494C-ADCC-0254A1514D06</TRAIN_ID><TRAIN_ID>6D870918-CFA1-4ADA-8427-049FF01902AC</TRAIN_ID><TRAIN_ID>61D1B40A-A9B6-4835-82C4-04FDCCAF7E6D</TRAIN_ID><TRAIN_ID>CA6D6B7-5ACA-4BE0-8A08-0EE87F77F10E</TRAIN_ID><TRAIN_ID>F86E6E93-544E-43F5-A97A-10E96834C781</TRAIN_ID><TRAIN_ID>EB898326-705F-4E70-B7BB-119B8953DFA9</TRAIN_ID><TRAIN_ID>491BFC77-0FA9-42C5-A255-11C49AA28CDD</TRAIN_ID><TRAIN_ID>C7A972FB-1E73-41FC-A4EF-12F5811C9853</TRAIN_ID><TRAIN_ID>3FD2CEE3-E85F-4624-87D7-13767D2DB391</TRAIN_ID><TRAIN_ID>F8A784C0-6E56-4769-92D2-1480BCAB2BEA</TRAIN_ID><TRAIN_ID>60D36A51-E642-40A2-A2F7-14D158B59781</TRAIN_ID><TRAIN_ID>67ED29A3-E2AD-42EC-8312-156084C0BB26</TRAIN_ID><TRAIN_ID>64B637B9-CC7D-47C8-9220-15D5FA76E65F</TRAIN_ID><TRAIN_ID>59B5D61C-4228-485D-89EE-185B74E42F3C</TRAIN_ID>
    Note I'm also fine with updating the dynamic query to generate a statement that generates a normal where in constraint e.g.
    PIVOT (COUNT(EMPL_EMPLOYEE_ID) FOR TRAIN_ID in
    ('F607BA64-BD24-4C6F-810E-001E7487FB4B','784EF318-628F-407E-8844-0049E3DD8F86')
    Thanks
    John

    Thanks guys, that helped immensely,
    For the record here is the slightly modified version [made generic to show the overall principle] that got it working for me in the end
    DECLARE @ColumnList VARCHAR(MAX) = '';
    DECLARE @query VARCHAR(max);
    WITH Data AS (
            SELECT columnname
             FROM    dbo.table
             SELECT         @ColumnList +='[' +  [columnname] +'],'
             FROM         Data;
    SET @ColumnList = STUFF(@ColumnList, 2, 0, '');
    SET @ColumnList = LEFT(@ColumnList, LEN(@ColumnList) - 1)
    --print @columnlist
    SET @query=
    'SELECT otherfields, ' +@ColumnList +' FROM
    (  SELECT   otherfields,columnname, datefield
             FROM        dbo.table
    ) t
    PIVOT (max(datefield) FOR [columnname] in (' +@ColumnList + ')
    ) AS pvt'
    execute (@query)

  • How to create Button which size is calculated from its text ?

    I think JButton works like this: either in constructor or by setText() method the text is set and according the lenght, font and fontRendererContext preffered size is calculated before the layout manager ask for the prefferedSize for first time.
    I want to override paint() method because i want to draw my own text(and the only way i discovered how to force button not to paint text is to set text to
    null or empty String). I want the button to be as long as length of text plus insets.
    But layout manager ask for preffered size before paint method is invoked but i find out what size should be in paint method because i need graphics
    parameter to get FontRendererContext from it. So layout manager shrink button to minimum because first time the preffered size calculated from null or
    empty String is returned.
    public class MyButton extends JButton {
            public MyButton() {
                this.setText(null);  //or setText("");
                this.setContentAreaFilled(false);
                this.setFocusPainted(false);
                this.setBorderPainted(false);
                                                          ////already here i need to know what the size should be
            @Override
            public void paint(Graphics g) {
                Graphics2D g2 = (Graphics2D) g;
                TextLayout textLayout = new TextLayout("MyButton", this.getFont(), g2.getFontRenderContext());
                Rectangle2D boundsOfText = textLayout.getBounds();                                                                    /////////here i find out what size should be
                this.prefferedSize = new Dimension((int)boundsOfText.getWidth()+10,(int) boundsOfText.getHeight()+10);
                g2.setColor(Color.WHITE);
                g2.fillRoundRect(1, 1,(int)getPreferredSize().getWidth(),(int) getPreferredSize().getHeight(), 10, 10);
                g2.setColor(Color.BLACK);
                g2.drawRoundRect(1, 1,(int)getPreferredSize().getWidth(),(int)getPreferredSize().getHeight(), 10, 10);
                g2.drawString("MyButton", 7, (int)boundsOfText.getHeight() + 6);
                g2.dispose();
        }So how can i do that? How can JButton know prefferedSize before its paint method is invoked?

    The previous example was simplified.
    public class MyButton0 extends JButton {
        private String myText;
        public MyButton0(String text) {
            this.myText = "Button";
            //this.myText = text.toUpperCase();
            this.setFont(new Font("SansSerif", Font.PLAIN, 13));
            setContentAreaFilled(false);
            setBorderPainted(false);
            setFocusPainted(false);
        @Override
        public void paint(Graphics g) {
            Graphics2D g2 = (Graphics2D) g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            //backround painting
            GradientPaint background = new GradientPaint(0, 0, new Color(255, 255, 255), 0, getPreferredSize().height / 2, new Color(0, 0, 0), true);
            if(getModel().isRollover()){
                background = new GradientPaint(0, 0, new Color(255, 255, 255), getPreferredSize().width , getPreferredSize().height , new Color(0, 0, 0), true);
            if(getModel().isPressed()){
                background = new GradientPaint(0, 0, new Color(255, 255, 255), 0, getPreferredSize().height / 2, new Color(210, 210, 210), true);
            g2.setPaint(background);
            g2.fillRoundRect(1, 1, getPreferredSize().width - 3 , getPreferredSize().height - 3, 10, 10);
            //Border painting
            g2.setColor(new Color(255, 255, 255));
            g2.setStroke(new BasicStroke(2.0f, BasicStroke.CAP_BUTT, BasicStroke.CAP_BUTT, 10.0f));
            g2.draw(new RoundRectangle2D.Double(1, 1, getPreferredSize().width - 3, getPreferredSize().height - 3, 10, 10));
            //text paiting
            g2.setFont(getFont());
            TextLayout tl = new TextLayout(this.myText, getFont(), g2.getFontRenderContext());
            int startPositionOfText = getPreferredSize().width - (int) tl.getBounds().getWidth();
            startPositionOfText = startPositionOfText / 2;
            g2.setColor(new Color(255, 255, 255));
            g2.drawString(this.myText, startPositionOfText -2, getHeight() / 2 + 5);
            g2.dispose();
        @Override
        public Dimension getPreferredSize() {
            return new Dimension(133, 31);
    }Assume text is so long as doesn't fit inside button. I have hard-set preffered size but i would like to calculate preffered size from text lenght.
    Or i need calculate startPosition of text to center it. But i don't want have preffered size hard-set.

  • Scroll bars & creating buttons problem

    I am trying to create a basic photo browser. The upper area is the enlarged view of the image. The lower portion is a scrollable view of the thumbnails in the directory chosen. I have most of it working...except that the scrollable view doesn't scroll, and the buttons that I created don't cause the image to show up in the main view port.
    There is the main window, divided into two parts: upper and lower. The upper part is the main view, as described above. The lower part is a panel. That lower panel contains two things, another panel and a button. This panel inside the lower section contains the scrollable window; this scrollable window is a viewport onto another panel that contains the dynamically created buttons (which are thumbnails of the images in the directory).
    I was trying to force the scrollbar policy to always show the horizontal bar (that is the only one I want visible) but that wasn't working either; I would get compiler errors when that was included. I have tried adjusting sizes of things, and the order that things are added to the main JFrame.
    Any suggestions would be appreciated.
    Here is the code:
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.File;
    import java.io.FileFilter;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.ScrollPaneConstants;
    import javax.swing.border.EtchedBorder;
    import javax.swing.filechooser.FileNameExtensionFilter;
    * PhotoGUI Browse
    * Description:  Generate a GUI interface for viewing a large view of an image and previews of thumbnails
    * in a directory.  There are two parts to the GUI:  large upper section for main viewing, and a short lower
    * section for viewing the thumbnail previews.  The lower section is also split into two parts:  the left part
    * is a scrollable pane where the thumbnails will be previewed, and then a small section to the right where
    * a button for changing directories will be present.  (I wanted the button to always be visible so didn't
    * put it in the scrollable area.)
    public class PhotoGUI extends JFrame {
         final int SIZE = 75;     //scaling size for images in thumbnail browser
         boolean firstRunThrough = true;               //Changes behavior of directory requester
         private JPanel thumbs;
         private JPanel pickNThumbs;
         private ImagePanel bigView ;
         private JScrollPane scroller;
         private JButton pickDirButton;
         private thumbSelectedListener thumbPicksNose;
         public PhotoGUI () {
              this.setDefaultCloseOperation (EXIT_ON_CLOSE);
              this.setSize(600,600);       //Starting size of the overall container.
              this.setTitle("Eye Photo photo browser");
              //The upper portion of the GUI, where the large view of the image will be held
              bigView = new ImagePanel();       
              //bigView.setSize (600,500);
              //The bottom section of the GUI; will hold the thumbnail previews
              //(in a scrollable panel) and a button for changing directories.
              pickNThumbs = new JPanel();             
              pickNThumbs.setBackground(Color.WHITE);
              pickNThumbs.setSize(600,100);
              pickDirButton = new JButton("Pick directory...");
              //pickDirButton.setSize(75,150);
              dirPickListener dirButton = new dirPickListener ();
              pickDirButton.addActionListener(dirButton);
              thumbs = new JPanel();              //The panel that will hold the thumbnail previews
              scroller = new JScrollPane(thumbs);       //Setting the scroll bar pane to view the thumbnail panel
              //scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
              //scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
              // scroller.setSize(525,100);          
              scroller.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
              pickNThumbs.add(scroller);
              pickNThumbs.add(pickDirButton);
              this.add(bigView);
              this.add(pickNThumbs, BorderLayout.SOUTH);
              String pickedDir = pickDir();               //Setting up the while loop so it will keep requesting
              if (pickedDir.equals("-1")) {
                   if (firstRunThrough)   System.exit(0);          //End program if they don't pick a dir the first time through.
              }else {
                   thumbsUp(pickedDir);                  //They picked good Dir; populate thumbnails
                   firstRunThrough = false;
         public String pickDir () {          
              // This is the file chooser method. 
              JFileChooser dirPicker = new JFileChooser();
              dirPicker.setDialogTitle("Pick a directory");
              dirPicker.setApproveButtonText("Open directory");
              dirPicker.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
              int x = dirPicker.showOpenDialog(getParent());   //maybe I don't need this?
              if (x == JFileChooser.APPROVE_OPTION) {
                   return dirPicker.getSelectedFile().getAbsolutePath();
              } else return "-1";              //Just to cover all possible conditions
         public void thumbsUp (String chosenDir) {
              // Thumb populater method.  It adds each thumb-button to the scroller panel
              thumbs.removeAll();         //Need to remove old directory's buttons
              File selectedDir = new File(chosenDir);
             FileNameExtensionFilter filter = new FileNameExtensionFilter("JPG/GIF/BMP/PNG Images", "bmp", "jpg", "jpeg", "gif", "png");
              File [] dirEntries = selectedDir.listFiles();
              for (File tempFile : dirEntries) {    
                   if (filter.accept(tempFile) && tempFile.isFile()) {       //That way I only get certain types
                        JButton howToNameMultipleButtons = new JButton();
                        howToNameMultipleButtons.setActionCommand(tempFile.getAbsolutePath());
    //                    System.out.println(tempFile.getAbsolutePath());
    //                    System.out.println(howToNameMultipleButtons.getActionCommand());
                        howToNameMultipleButtons.setIcon(new ScaledIcon(tempFile.getAbsolutePath(), SIZE));
                        howToNameMultipleButtons.addActionListener(thumbPicksNose);
                        thumbs.add(howToNameMultipleButtons);
              this.setVisible(true);   //Down here so first run through program opens Dialog before showing
         public class dirPickListener implements ActionListener {
              public void actionPerformed (ActionEvent ae) {
                   thumbsUp(pickDir());     //Opens Dir selection dialog and feeds the thumbnail populater
         public class thumbSelectedListener implements ActionListener {
              public void actionPerformed (ActionEvent ae) {
                   String thumbPicked = ae.getActionCommand();    //Should return path string of thumbButton clicked
                   // System.out.println(ae.getActionCommand());    //TSing step; to see if this bit even fires off.
                   bigView.setImage(thumbPicked);
                   bigView.setToolTipText(thumbPicked);
                   //  bigView.setBackground(Color.GREEN);
    }

    Ah! I got some of it figured out at least...
    Setting the preferred size parameter has caused the scroll bars to display! :) Thanks for the hint on that.
    But I get an error when I try and use the scrollbar policy settings. Here are the results:
    Exception in thread "main" java.lang.IllegalArgumentException: invalid verticalScrollBarPolicy
         at javax.swing.JScrollPane.setVerticalScrollBarPolicy(Unknown Source)
         at javax.swing.JScrollPane.<init>(Unknown Source)
         at PhotoGUI.<init>(PhotoGUI.java:70)
         at PhotoBrowser.main(PhotoBrowser.java:15)And the code I used:
    scroller = new JScrollPane(thumbs,
                        ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS,
                        ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);       //Setting the scroll bar pane to view the thumbnail panel
              Edited by: Mole_Hunter on Feb 1, 2010 9:57 AM

  • Getting error on clicking the create button in apps which is working fine

    Hi All.
    We had created an application using OAF technology which is working fine in Jdeveloper.
    Basically the application consists of 3 pages.
    1) MainPG
    2) CreatePG
    3) UpdatePG.
    Now after deploying all the required files in apps environment,i am able to open the pages individually.
    Now after opening the MainPG i clicked on the create button which directs to CreatePG,but CreatePG is not opening instead its giving below error.(Individually if i click on CreatePG,UpdatePG pages are opening),where as the CreatePG and UpdatePG working fine in Jdeveloper.
    Below is the error i am receiving.PLease Help.
    oracle.apps.fnd.framework.OAException: No data found for region (/oracle/apps/ar/VOAM/webui/CreatePG).
         at oracle.apps.fnd.framework.webui.JRAD2AKMapper.getRootMElement(JRAD2AKMapper.java:529)
         at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getWebBeanTypeDataFromJRAD(OAWebBeanFactoryImpl.java:3719)
         at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getRootApplicationModuleClass(OAWebBeanFactoryImpl.java:3452)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1006)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430)
         at oa_html._OA._jspService(_OA.java:84)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
         at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187)
         at oa_html._OA._jspService(_OA.java:94)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    ## Detail 0 ##
    Exception:
    oracle.adf.mds.MetadataDefException: Unable to find component with absolute reference = /oracle/apps/ar/VOAM/webui/CreatePG, XML Path = null. Please verify that the reference is valid and the definition of the component exists either on the File System or in the MDS Repository.
         at oracle.adf.mds.internal.MetadataManagerBase.findElement(MetadataManagerBase.java:1350)
         at oracle.adf.mds.MElement.findElement(MElement.java:97)
         at oracle.apps.fnd.framework.webui.JRAD2AKMapper.getRootMElement(JRAD2AKMapper.java:503)
         at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getWebBeanTypeDataFromJRAD(OAWebBeanFactoryImpl.java:3719)
         at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getRootApplicationModuleClass(OAWebBeanFactoryImpl.java:3452)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1006)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430)
         at oa_html._OA._jspService(_OA.java:84)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
         at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187)
         at oa_html._OA._jspService(_OA.java:94)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    Exception:
    oracle.adf.mds.MetadataDefException: Unable to find component with absolute reference = /oracle/apps/ar/VOAM/webui/CreatePG, XML Path = null. Please verify that the reference is valid and the definition of the component exists either on the File System or in the MDS Repository.
         at oracle.adf.mds.internal.MetadataManagerBase.findElement(MetadataManagerBase.java:1350)
         at oracle.adf.mds.MElement.findElement(MElement.java:97)
         at oracle.apps.fnd.framework.webui.JRAD2AKMapper.getRootMElement(JRAD2AKMapper.java:503)
         at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getWebBeanTypeDataFromJRAD(OAWebBeanFactoryImpl.java:3719)
         at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getRootApplicationModuleClass(OAWebBeanFactoryImpl.java:3452)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1006)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430)
         at oa_html._OA._jspService(_OA.java:84)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
         at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187)
         at oa_html._OA._jspService(_OA.java:94)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)

    Hi gaurav,
    After your update i remember that the path should be uploaded one.i had imported the PG with the below command.
    import f:\p4045639_11i_GENERIC\jdevbin\Tutorial\jdev\myprojects\oracle\apps\ar\VOAM\webui\UpdatePG.xml -rootdir f:\p4045639_11i_GENERIC\jdevbin\Tutorial\jdev\myprojects -userId vramana -rootPackage /oracle/apps/ar/VOAM/webui -username apps -password testmunim -dbconnection "(description = (address_list =(address = (community=tcp.world)(protocol = tcp)(host =)(port = )))(connect_data = (sid =TEST)))"
    which has give imported page as /oracle/apps/ar/VOAM/webui/oracle/apps/ar/VOAM/webui/UpdatePG.I need to give this path in jdeveloper which i had forgotten,instead i have given as /oracle/apps/ar/VOAM/webui/UpdatePG.
    My issue is resolved.
    Thanks a lot gaurav and all the people who participated in this thread.
    Regards

  • Creating a Function logic for dynamically created XML buttons

    Hi!
    It's me...... again! Now I've dynamically created some buttons using XML. They're spread around the stage and I've modified a tooltip script to give each button a tooltip on Mouse_Over. But to se the logic and make it work using AS3 is hard (for me). I want a function that accept to parameters: Tooltip text and  Object to tooltip.
    In my code I get this error msg when initiating the function on dynamically created buttons:
    1118: Implicit coercion of a value with static type flash.display:Sprite to a possibly unrelated type flash.display:MovieClip.
    I beleive there are more than one thing here needing a fix.
    Can someone have a look and give me a pointer?
    Thanks
    function contentTooltip(ttt:String, ttclip:MovieClip):void {
        ttclip.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
        function mouseOverHandler(e:MouseEvent):void {
            ttip.descr.text=ttt;
            ttip.x=stage.mouseX;
            ttip.y=stage.mouseY-15;
            ttclip.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
            ttclip.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
            ttip.visible = true;
        function mouseOutHandler(e:MouseEvent):void {
            ttip.visible = false;
            ttclip.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
            ttclip.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
        function mouseMoveHandler(e:MouseEvent):void {
            ttip.x=stage.mouseX;
            ttip.y=stage.mouseY-15;
    contentTooltip("Scale button",scale_btn);
    contentTooltip("Hide button",hide_btn);

    I totally agree with what Ned says and suggests. Nevertheless, I would like to support your thinking process.
    From the way you wrote the tooltip functionality it is apparent to me that you conceptualize as a programmer. Again, as Ned said, nested functions are evil. BUT, in a way, what classes accomplish is encapsulation/nesting of properties and functions under the same umbrella. It actually feels that what timeline does in general is nesting named functions within a single function we have no access to.
    How you wrote the code is actually a blueprint for a class that could handle the functionality. You, perhaps, are very ready to start coding with classes - not on the timeline.
    With that said, for the sake of theory, here is how your functionality can be rewritten on timeline:
    scale_btn.toolTip = "Scale button";
    test_btn.toolTip = "Test button";
    hide_btn.toolTip = "Hide button";
    scale_btn.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
    test_btn.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
    hide_btn.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
    var overTarget:MovieClip;
    function mouseOverHandler(e:MouseEvent):void {
         overTarget = e.currentTarget;
         ttip.descr.text = overTarget.toolTip;
         ttip.x = stage.mouseX;
         ttip.y = stage.mouseY - 15;
         overTarget.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
         overTarget.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
         setChildIndex(ttip, numChildren - 1);
         ttip.visible = true;
    function mouseOutHandler(e:MouseEvent):void {
         ttip.visible = false;
         overTarget.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
         overTarget.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); 
    function mouseMoveHandler(e:MouseEvent):void {
         TweenMax.to(ttip, .5, { x:stage.mouseX, ease:Quart.easeOut } );
         TweenMax.to(ttip, .5, { y:stage.mouseY - ttclip.height / 2, ease:Quart.easeOut } );
         //ttip.x=stage.mouseX;
         //ttip.y=stage.mouseY-ttclip.height/2;

  • I need to create Buttons dynamically Please Help

    I am currently developing a card game. I represent my cards as buttons. But as the player draws more cards from the deck I have to generate buttons dynamically at run-time. I could use arrays of buttons and store new buttons inside that arrays of buttons. But the only problem is I need ActionListener for each of my buttons. How do you create ActionListener for each different dynamically created buttons? Please Help.

    Here is my code. I just do not understand how to create those functions dynamically that functions different each time.
    Here is my code please take a look.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class run108{
    JButton setbutton;
    JButton ButtonUp;
    JButton ButtonDeal;     
    JButton slot1;
    JButton slot2;
    JButton slot3;
    JButton slot4;
    JButton slot5;
    JButton slot6;
    JButton slot7;
    cards[] card = new cards[55];
    public static void main(String[] argv)
         run108 startgui = new run108();
         startgui.createframe();     
    void createframe()
         //Standard of way of creating Frame
         JFrame frame = new JFrame("108");
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.setLocation(300,200);// Tells the startup position;
         //Adding Panels to the framework
         JPanel panelA = new JPanel();
         panelA.setBackground(Color.white);
         panelA.setLayout(new BoxLayout(panelA,BoxLayout.Y_AXIS));
         JPanel panelB = new JPanel();
         JPanel panelC = new JPanel();
         //Adding buttons with card images
         JLabel label1 = new JLabel("       Set of Cards");
         panelA.add(label1);
         ImageIcon pic1 = new ImageIcon("cards/backd.png");
         setbutton = new JButton(pic1);          
        panelA.add(setbutton);
        ImageIcon picdeal = new ImageIcon("cards/deal.png");
         ButtonDeal = new JButton(picdeal);
         panelA.add(BorderLayout.CENTER, ButtonDeal);
        ButtonDeal.addActionListener(new DealListener());
         JLabel label2 = new JLabel("       Your Target");
         panelA.add(label2);
         ButtonUp = new JButton(pic1);          
        panelA.add(BorderLayout.CENTER, ButtonUp);
        frame.add(BorderLayout.WEST,panelA);
        // Adds 7 initial card slots.
         ImageIcon pic2 = new ImageIcon("cards/backc.png");
         slot1 = new JButton(pic2);
        panelB.add(slot1);          
        slot1.addActionListener(new Slot1Listener());
        slot2 = new JButton(pic2);
        panelB.add(slot2);
        slot2.addActionListener(new Slot2Listener());
         slot3 = new JButton(pic2);
        panelB.add(slot3);
        slot3.addActionListener(new Slot3Listener());
         slot4 = new JButton(pic2);
        panelB.add(slot4);
        slot4.addActionListener(new Slot4Listener());
         slot5 = new JButton(pic2);
        panelB.add(slot5);
        slot5.addActionListener(new Slot5Listener());
         slot6 = new JButton(pic2);
        panelB.add(slot6);
        slot6.addActionListener(new Slot6Listener());
         slot7 = new JButton(pic2);
        panelB.add(slot7);
        slot7.addActionListener(new Slot7Listener());
        frame.add(BorderLayout.CENTER,panelB);
        // This has to be added @ the end to show the components
        //that were added after on. If it is placed before the components
        //the components shall not appear since they sit on the frame
         frame.setSize(600,500);
         frame.setVisible(true);
    class DealListener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot1Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot2Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot3Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot4Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot5Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot6Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot7Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    }

  • Dynamic Email Button

    Hi Everyone
    I know how to setup a Dynamic Email button which will format the Body of the Email using \n  and some of the others like \t and \r but are there others? Is there a way to control the font size, color, or alignment like centering? Thank you in advance.

    I tried that but it is interesting that if I create a new message in outlook it is in a format of
    html and if I use the email button in the pdf it creates it in plain text which just displays the text in this format.
    <html>/n/n/n<body>/n <p>/n <center>Center</center>/n </p>/n </body>/n </html>/n
    Any suggestions?
    the control used to open outlook and attach is
    this.mailDoc({bUI: true, cTo: cToAddr, cCc: cCCAddr,
                      cSubject: cSubLine, cMsg: cBody});

  • How do I install a foxit button on my tool bar? I recently upgraded to the latest version, but my tool bar does not contain a firefox button which is need for certain tasks, such as private browsing.

    I had an existing laters 3 point whatever version of Firefox and recently upgraded to Firefox 10. This new version still has the old toolbar across the top, but there is no "Firefox button" which one has to use to activate certain action such as "private browsing." Is there anyway I can install the button on the toolbar, or is there a way to change to the new version 10 interface which includes the Firefox Button. I would prefer the former (the old configuration with the tool bar on top, but if that cannot be done, how to I migrate to the new configuration which apparently puts the tools on the side, if I'm not mistaken.
    Thanks for any help you can provide. I have Windows XP.

    If you have the old fashioned toolbar, you can still go into Private browsing by clicking Tools, then "Start Private Browsing". All the options that are in the Firefox button are in the old style toolbar, just maybe a little more hidden.
    To enable te Firefox button, go into View, then Toolbars, then uncheck "Menu Bar". You should have the Firefox button.

Maybe you are looking for