Adding to the content pane when a button is clicked

Hi there,
Could you have a look at my code please and tell me how I would execute the following code when a perticular button is pressed,
Container pane = getContentPane();
pane.setBackground(Color.white);
panel = new SwingOvalDrawing();
panel.setBackground(Color.white);
pane.add(panel,"Center");
If the code is left in the main method it will draw the oval when the program is launched, but if I insert the same code in the Action Performed method and press the button nothing happens, not only that but upon compiling the code the following error is shown
"local variable pane is accessed from within inner class; needs to be declared final"
Any help would be appreciated.

I tried declaring it as an object variable but still when the button is pressed nothing shows.
This is the button code
// Add the buttons.
JButton dCircleButton = new JButton("", buttonCircleIcon);
dCircleButton.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
     System.out.println("Button works ok");
     //canvasPanel = new Panel();
     //canvasPanel.add(panel, "Center");
     pane.add(panel,"Center");
});

Similar Messages

  • Is there a possibility to clear ONLY the COMPLETED downloads when a button is clicked in firefox?

    is there any way (natively, or by using an extension) to clear ONLY the COMPLETED downloads when a button is clicked in firefox. it should not clear the paused, failed or cancelled downloads. - similar to the functionality in INTERNET DOWNLOAD MANAGER software by TONEC. i have searched lots but could not find such a function. :(

    Along the lines of cor-el's last post, if you want to delete most of the downloads, you can select the entire list using Ctrl+a then Ctrl+click the ones you want to exclude from the selection.
    In some cases, Firefox supports "places queries" to drill down on specific kinds of history. However, I didn't see one for downloads documented in the MDN article, so I'm not sure whether there is a way to query just for successfully completed downloads.
    https://developer.mozilla.org/en-US/docs/Mozilla/Tech/Places/Places_query_URIs

  • How to get a form to appear on the same page when a button is clicked?

    Hi,
    I have a report on a page with a create button. When a user clicks the create button, a form should appear on another region in the same page....how do i go about doing this?
    I know how to do this if the form is on a different page, but i'd like the form to appear on the same page as the report and only when the button is clicked.
    Thanks.

    Hi,
    I did the following, but it didnt work....
    1) Created a hidden item on the page, and in the Default Value field, I set the value to N.
    2) Created a button in the report with the following values under "Optional URL Redirect":
    Target is a: Page in this application
    Page: 4
    Set these items: P1_SHOW_FORM
    With these values: Y
    3) Created a form of HTML text type with the following values under "Conditional Display":
    Condition Type: Request=Expression 1
    Expression 1: P1_SHOW_FORM='Y'
    What have I done wrong or have i missed something?
    Thanks.

  • Adding a text box dynamically when a button is clicked in normal form

    Hi all ,
    i have a form where a Add button , creates a text box when ever it is clicked .
    can you please tell me how to achieve that functionality ..
    my form is normal form .... it is not a tabular form .
    Regards ,
    Nandini .

    How about
    <script type="text/javascript">
    function getElementsByClass( searchClass, domNode, tagName)
         if (domNode == null) {
         domNode = document;
         if (tagName == null) {
         tagName = '*';
         var el = new Array();
         var tags = domNode.getElementsByTagName(tagName);
         var tcl = " "+searchClass+" ";
         for(i=0,j=0; i<tags.length; i++) {
              var test = " " + tags.className + " ";
              if (test.indexOf(tcl) != -1)
                   el[j++] = tags[i];
                   if (tags[i].innerHTML.indexOf('DoFilters') > 0 )
                   tags[i].innerHTML = tags[i].innerHTML.substring(0, tags[i].innerHTML.length - 7 )
                                       + " onfocus=javascript:alert('Put your javascript here'); >Go</a>"
                   alert (tags[i].innerHTML);
         return el;
    </script>
    <script type="text/javascript">
         var tabs = getElementsByClass('minibuttonOn');
    </script>
    regards
    John
    http://www.obiee101.blogspot.com/

  • How to use the SSO functionality when a button is clicked in Adobe Form?

    I have an offline interactive form - when the user clicks on a SUBMIT to SAP button, it asks for user id and password.
    However he user does not have a password to log into SAP directly - he will be logging in via Single Sign On.
    Can you please advise on how to achive this functionality?
    1. Click on a SUBMIT to SAP button on the Adobe Form
    2. Take this info and get the Single Sign On token from SAP portal
    3. Use this ticket/token and log into SAP ECC or validate this info within SAP ( for this 3rd step - probably use function module SUSR_CHECK_LOGON_DATA?)
    Thanks

    Hi
      I think you want to know the row number, in this case , what i would suggest is , in the action ,there is a parameter WDEVENT , which gives you the complete row where you clicked.
    In WDEVENT , you have GET_CONTEXT_ELEMENT method as well as GET_DATA method to fetch the data and it doesnt require any lead selection.
    Thanks
    Anzy

  • Multiscreen HTML 5  output  in Chrome – when scrolling down very long topics in the content pane the navigation area 'moves up' , i.e cant see search field or TOC.

    Hi,
    Multiscreen HTML 5  output  in Chrome – when scrolling down very long topics in the content pane the navigation area 'moves up' , i.e cant see search field or TOC.
    thanks
    Anat 

    This is by design. If you want to change this, the content section must have a set height and scroll. Which layout are you using? -- Check out the Responsive layouts and the Social layout. I believe those have the more traditional TOC placement.
    Kind regards,
    Willam

  • Updated to 7.0.6 on my iPhone 5s and now my phone is all out of whack. It won't sync the new playlists I added after the update though when it's plugged into iTunes it says it's synced. Help please!

    So I updated my iPhone 5s to version 7.0.6 yesterday, and now my iPhone music isn't working properly. It won't sync the playlists that I added after the update though when it's plugged in on iTunes it says that the music is synced. When I select a song in a playlist on the phone it shuffles through the playlists for like 3 seconds and picks a totally different song to play. I tried reinstalling iTunes, I tried restoring the iPhone, is it just a bug with the update? Nothing works. Any solutions are welcome.

    DFU mode? How do I do that? So far the only thing I can do is hold down both buttons to power it on and nothing is on the screen and it wont reconize on my computer....

  • How to Create a Dynamic http address that opens the Explorer Window for a List Item When a Button Is Clicked--Currently Trying to Make this Work with Javascript

    I have created a button (via Content Editor) that uses JavaScript to open the Attachments folder of a list item in the Explorer Window in SharePoint 2010. The purpose is to have drag and drop functionality for each list item, having multiple attachments.
    The button works but opens the "Attachments" folder containing all of the other folders for each list item (one folder per item). It seems that when you add an attachment to a list item, SharePoint numbers the folder based on the item's ID. What
    I'm trying to do is take the JavaScript I have and have it run when a button is clicked in a custom form. When it runs, I'm trying to get it to open the "specific" folder for the list item. I have had success creating a hyperlink in the list that
    does this; however, the link WILL NOT work until I use the Content Editor created button that runs JavaScript, that prompts me to click OK to my profile certificate, and then opens the Attachment folder. After that occurs, I can use my hyperlinks without issue
    because I'm no longer prompted to click OK for my cert.
    So I'm trying to take the JavaScript I have and place it in a list item form (custom form) and have it run when a form button is clicked. The problem is I have very little knowledge of JavaScript (did I mention little?) and
    "don't know how to take the "http:" address I have in the script and append to it the list item ID, according to the record I have open."
    So that for any record I open, the script will grab the corresponding record ID (or list item ID) and append it.
    Here's the script I'm working with (which I didn't create but am grateful for):
    <style>
    .httpFolder {behavior:url(#default#httpFolder);}
    </style>
    <script text = "javascript">
       function fnOpenFolderView(){
       oDAV.navigateFrame("https://server/collection/site/subsite/Lists/Sublist/Attachments","_self");
    </script>
    <div id = "oDAV" class = "httpFolder"/>
    <input type = "button" value = "Open Attachment Folder" onclick = "fnOpenFolderView()"/>
    The above script, in the Content Editor, creates a button that opens the Attachments folder for the corresponding SharePoint list.
    JackSki123

    Hello Thriggle,
    Thank you for pointing that out. I appended your "GetUrlKeyValue" to the end and it worked. That said, I noticed it doesn't run as smoothly as when I simply click on the Content Editor button I created that resides on the SharePoint List
    ASPX page (not the form). The Content Editor button has the same code, minus the "GetUrlKeyValue". I click it; I get prompted to choose my cert; it opens right up.
    Now go to the ASPX Display form where I dump the code in a table cell. Button appears in cell; I click it; wait; wait; I get prompted for cert; it opens. Do I need some sort of "throttle" for the JavaScript? For instance, I thought before running
    JavaScript, you reference the library first. This code doesn't do that. I'm wondering if there's something more I need to make this run smoothly. Thank you both for getting me this far. 
    JackSki123

  • Content Pane: Help getting rid of "Click to activate this control"

    I know this came up a long time ago when IE
    changed--Flash/swf content needs to be clicked to be activated
    first. I thought Robohelp 6 would address it, but not.
    The challenge: Cannot use the fixes publised because the html
    pages created by Robohelp, like the Content pane, are generated
    with Javascript. Ironically posted solutions use Javascript to
    change the Embed, object, etc. tags! And I don't know Javascript!
    The entire Content pane needs to be clicked first so you can
    click an item in the contents. Its html file seems to be
    wf_master.htm and when you look at the code, the tags are fed in
    like this:
    // Build tag to document.write
    strObject = "<OBJECT
    classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'";
    strObject += "WIDTH='100%' HEIGHT='100%' id='masterSWF'
    ALIGN='' VIEWASTEXT>";
    strObject += "<PARAM NAME='movie'
    VALUE='wf_master.swf'>";
    strObject += "<PARAM NAME=quality VALUE=high>";
    strObject += "<PARAM NAME='menu' value='false'>";
    // FlashVars for Object tag:
    strObject += "<PARAM NAME=FlashVars VALUE='" +
    strFlashVars + "'>";
    strObject += "<EMBED src='wf_master.swf' quality=high
    WIDTH='100%' menu='false' HEIGHT='100%' NAME='masterSWF'
    swliveconnect=true ALIGN='' ";
    // FlashVars for Embed tag:
    strObject += "FlashVars='" + strFlashVars + "' ";
    strObject += "TYPE='application/x-shockwave-flash'
    PLUGINSPAGE='
    http://www.macromedia.com/go/getflashplayer'>";
    strObject += "</EMBED>";
    strObject += "</OBJECT>";
    Adobe's solutions 1 or 2
    http://www.adobe.com/devnet/activecontent/
    assume you have regular html files.
    *Question/request:
    1) Has/can someone come up with a way or code (or function?)
    that can be added somewhere centrally (in a key file) so when
    robohelp renders the above html tags are replaced therefore
    eliminating the need of clicking the swf content to activate it?
    I don't know how Robohelp renders to help me find the file
    where a change like this can be made.
    2) Or can the output Javascript file be modified?
    Robohelp seems to ride on Javascript and the 'solutions' are
    in Javascript. I can't believe RObohelp developers have not
    addressed this with the Robohelp 6.
    I upgraded to Robohelp 6, use Robohelp HTML, publish using
    FlashHelp, and my users use IE,

    just search forum - this has been discussed almost everyday
    since the issue surfaced a few
    weeks/months ago - in fact somebody actually posted a link to
    an article explaining it 11 minutes
    before you posted your question
    Subject: IE Changes Due: What you can Expect.
    It's not a flash issue - it is an Eolas/Microsoft issue. Also
    google around - tons of articles on
    news sites about this and also on adobe and macromedia that
    explains it all.
    --> Adobe Certified Expert (ACE)
    --> www.mudbubble.com :: www.keyframer.com
    -->
    http://flashmx2004.com/forums/index.php?
    -->
    http://www.macromedia.com/devnet/flash/articles/animation_guide.html
    -->
    http://groups.google.com/advanced_group_search?q=group:*flash*&hl=en&lr=&ie=UTF-8&oe=UTF-8
    jrschaef wrote:
    > Why do I have to click twice to use a flash nav? When I
    first hover over the
    > nav there is a "Click to activate and use this control"
    pop up, I click it and
    > then I can use that nav but if I go to a new page it
    starts over again. I seen
    > another posting that refer to the same issue but didn't
    have a solution. Can
    > anyone help?
    >

  • Creating a plot on a java Frame when a button is clicked

    hi
    I want to create a plot in a java application in a frame when a button is clicked.I mean to say a
    a plot between two single dimensional arrays one as x-axis and the other as y-axis. Can u please suggest me with an example
    Thank u

    JFreeChart

  • Access Bidder Tab Details when PUBLISH button is clicked

    Hi All,
    I've few requirements to enhance the functionality of PUBLISH button in Rfx Creation.
    One fo them is to trigger notification mails to all bidders when RFx is re-PUBLISHed by clicking PUBLISH button.
    I need to fetch all the bidder list from Bidder Tab whenever PUBLISH is clicked.
    Need to know where / which method has all these details so that I can enhance it.
    I know that PUBLISH is in the toolbar for FPM_OIF_COMPONENT.
    View - CNR_VIEW
    RFx Bidder tab details will get from the component /SAPSRM/WDC_UI_DO_BIDDER.
    I want to access the bidders when PUBLISH button is clicked.
    I want to which method is executed when PUBLISH button is clicked.
    Tried with CL_ABAP_DEBUGGER and CL_WDR_ACTION but not getting the ecaxt component which is calling.
    Is there any other way to debug?
    Thanks in Advance
    Rgrds,
    Sravan

    A bit late, but method /SAPSRM/IF_FPM_OVRIDE_EVT_OIF~OVERRIDE_EVENT_OIF from /SAPSRM/CL_FPM_OVRIDE_OIF is extremely useful trying to debug where the info comes from.
    Basically, there are several mappers classes that access to pdo layer somehow. It is always the same process more or less, but you have to know which classes are involved.
    You can usually get a class that is accesible from your wd component. If no BAdIs or no other way of doing some z modification, it is always posible to directly enhance such class...
    Hope this helps
    Regards

  • Display success message in same page when submit button is clicked

    I have a jsp page, where i use a form to submit data into my database.when submit button is clicked, i am able to display "Data entered Successfully" in a different page. But i want to display the message in the same jsp page.
    what do i do?
    PS :- i have tried a javascript message box, but that is not working properly. I need this solved urgently.
    Thanks

    Hi Deeptha,
    What is APEX version your using and is it your select list with submit option ?
    Regards,
    Ajay Periwal

  • Cant sync music from iphone 5... When sync button is clicked starting sync appears and dissapears and nothing happens i cannot find a solution for this... Someone help me please

    I Cant sync please help me... Im using iphone 5 ios 7.1... when sync button is clicked starting sync comes and nothing happens and no music on my phone... Im trying to sync my playlist in itunes... I have itunes 11.1.3.8 64-bit Windows 8

    My apologies...the version is 11.1.4.62 not as stated aboive in my problem description.  I'm trying again and it just finished syncing fine and my iPhone 5 is still connected to iTuns physcially with USB lightening cable and is displaying the iPhone icon top right.  I clicked on it and iTunes is now "hung' or  locked up.  Shows to be an active running application but can't get back to it so willl have to kill with task manager.  There is some kind of problem going on with the latest version of iTunes and Wndows 7 and 8.1 or something.  My iPhone 5 now has a new feature that it is now asking me if I "Trust" this computer.  iTunes just came "unhung" after several minutes while I was typing this. Now I am going to start the backup to this computer HP Winsows 8.1 and iTune 11.1.4.62 and see what happens.  Says it is Backing up Jerrys iPhone but the Barber Pole progress bar is not turning an iTunes is hung again and I cant get back to it from this page I am typing on.  Maybe it will eventually release as it did a moment ago. 

  • Badi/userexit for va01,when save button is clicked

    hi friends,
    i want badi/userexit which triggers when save button is clicked in va01 tcode.
    Thanks,
    Gaurav

    Hello,
    You can debug the standard code ( /h before pressing save button) searching for user-exits or badis.
    Set breakpoints in statements. For example if you are looking for call customer-fuction, click on:
    Breakpoint --> Breakpoint at --> Breakpoint at Statement
    and then here write: CALL CUSTOMER-FUNCTION
    Then pressing F8 it will go directly to the next breakpoint (user exit for this transaction).
    I hope it will help you.

  • I can't see the Audio Waveforms in the timeline. No triangle button to click. Just switched from FCP. Help!?

    I can't see the Audio Waveforms in the timeline. No triangle button to click. Just switched from FCP. Help!

    When I click on the wrench or right click to customize the box, these are the options I'm given.  I don't see waveform.  I've edited in Adobe Audition for years, and see the waveform panels in all the Premiere Pro tutorials, am I missing something?  (besides a brain?)

Maybe you are looking for

  • Released PO's Report

    Hi Gurus, I want to know, list of PO's which are released ( Final Release) in a month. Is there any Std SAP Report / Query available for this. Best Regards

  • How to set up Link Aggregation on Windows 7 ?

    I am going to buy a new Switcher that is LACP (Link Aggregation Control Protocol) supported so I can get a little bit better internet by combining my two ethernet ports on my MacPro (Mid 2012) where i have Windows 7 Ultimate installed as well as Mac

  • Running Out of Memory Since Yosemite

    Let me start by saying I was originally part of the Yosemite Beta and was running into the same issue. After running my system for >20-25 minutes a menu pops up and says I've run out of memory and it has paused my programs.  Looking at my Activity Mo

  • EXIF Information while in Safari?

    Is there any way (via customization or add-in) to allow Safari to display EXIF information from a jpeg photograph? I know that I could safe the image and load it into iPhoto or use some other piece of software (like CocoView) but I was curious if the

  • What are the differences of the following titles?

    What are the differences of the following titles? Oracle Database Design Analyst Oracle DBA - Design Oracle DBA Oracle Database Analyst - Design Oracle Database Designer Oracle e-Commerce Database Architect Oracle system administrator Thank you