Button only visible after method setting it visible has terminated

Hello all,
I guess I am now at the edge of the Java technology where I am not very familiar with the internals of that language. Apologies for being uninformed.
My problem is the following: I have a button that is constructed in this way:
protected JButton getButtonMetadataAndFilesUpload() {
          if (buttonMetadataAndFilesUpload == null) {
               buttonMetadataAndFilesUpload = new JButton();
               buttonMetadataAndFilesUpload.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                         labelProcessingOnServer.setVisible(true);
                         buttonServerActivity.setVisible(true);
                         sendDataToServerAndCopyDataToFinalLocation();
               buttonMetadataAndFilesUpload.setBounds(508, 11, 236, 43);
               buttonMetadataAndFilesUpload.setText("Upload Metadata and Files");
          return buttonMetadataAndFilesUpload;
     }What I am trying here is to set a button visible only if this above "upload button" is being pressed . What I get is the following: When I press the button, the method sendDataToServerAndCopyDataToFinalLocation() is being executed and only after it has finished the button appears. I guess this is a problem of synchronization, right? What do I have to do to make it appear_before_ the method sendDataToServerAndCopyDataToFinalLocation() is being executed? I am sorry if I miss here some Java coding fundamentals, but maybe someone can help me out.
Thanks in advance again
Jan Peters-Anders

Try putting the call to your method: sendDataToServerAndCopyDataToFinalLocation();
in an invokeLater call.
i.e.
SwingUtilities.invokeLater(new Runnable()
public synchronized void run()
sendDataToServerAndCopyDataToFinalLocation();
You may wish to read this page: http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html

Similar Messages

  • Buttons only appear after menu loops

    I am new to encore and I am having some problems. I have set up my menu to loop and a certain point and I have put all my buttons on the menu. When I go to preview the menu, the buttons only appear after the menu loops for the first time. I am sure there is a simple solution, but if someone could help me out that would be great.

    >Please provide a bit more detail about your Menu and your Project. The Buttons should appear, when the Menu is navigated to.
    Yes, after the menu enters the loop point that you can define for each of your menu.

  • Pipeline namespaces only valid after a set?

    If I try to access a pipeline session attribute before called a set method
    on it, I'm getting the following type of error. Can someone confirm this is
    either a bug, or that there is a requirement to have "set" something into
    the pipeline session before the namespace is considered "valid"?
    [java] <Nov 21, 2002 6:44:20 PM CST> <Info> <EJB> <010051> <EJB
    Exception during invocation from home: com.bea.p13n.appflow.pipeline.in
    ternal.PipelineExecutorImpl_x8bn7v_HomeImpl@167892 threw exception:
    Exception[com.bea.p13n.appflow.exception.InvalidArgumentException: Attem
    pting to work with an attribute in the PipelineSession and the supplied
    namespace [my_account] is invalid.]
    [java]
    Exception[com.bea.p13n.appflow.exception.InvalidArgumentException:
    Attempting to work with an attribute in the PipelineSession a
    nd the supplied namespace [my_account] is invalid.]
    [java] at
    com.bea.p13n.appflow.common.internal.PipelineSessionImpl.containsSessionScop
    edAttribute(PipelineSessionImpl.java:450)
    [java] at
    com.clinsights.presentation.portal.pipelines.principals.LoginSummaryCreation
    PC.process(LoginSummaryCreationPC.java:60)
    [java] at
    com.bea.p13n.appflow.pipeline.internal.PipelineExecutorImpl.executePipeline(
    PipelineExecutorImpl.java:299)
    [java] at
    com.bea.p13n.appflow.pipeline.internal.PipelineExecutorImpl_x8bn7v_EOImpl.ex
    ecutePipeline(PipelineExecutorImpl_x8bn7v_EOI
    mpl.java:46)
    [java] at
    com.bea.p13n.appflow.webflow.internal.PipelineProcessor.process(PipelineProc
    essor.java:157)
    [java] at
    com.bea.p13n.appflow.webflow.internal.WebflowExecutorImpl.processTarget(Webf
    lowExecutorImpl.java:1233)
    [java] at
    com.bea.p13n.appflow.webflow.internal.WebflowExecutorImpl.gotoNode(WebflowEx
    ecutorImpl.java:746)
    [java] at
    com.bea.p13n.appflow.webflow.internal.WebflowExecutorImpl.gotoNextNode(Webfl
    owExecutorImpl.java:684)
    Also - I found I needed to add the weflow_servlet.jar to the pipeline.jar's
    META-INF classpath before I was able to get past some "class not found
    issues"... this is not really mentioned in the documentation (To the best of
    my knowledge). I have seen mention in the newsgroups of having to add your
    own code's classpath to this METAINF however.
    Another issue.... its unclear from the documentation whether or not I can
    use the i18n:getMessage tag from within my own portlets.... I mean I'm sure
    you can add the tags into the code, but where are the property file(s) which
    are then accessed. I see in the framework subdirectories that virtually
    every jsp file has its own resource bundle.... does this behavious not
    translate into the portlet jsp files.
    Thanks for any replies,
    Markus

    Hello Kamlesh,
    Indeed <webflow:getProperty was fixed by specifing the namespace... I was
    assuming that by "default" it would use the namespace associated with the
    portlet.
    However there is more to the original problem, since in the
    PipelineComponent itself, I was getting errors with the
    pipelineSession.containsxxxx() method and I also was not able to retrieve an
    attribute right after having set it (using the same namespace, and in the
    same piece of code... ie 2 lines of code - set followed by get).
    It's working now though - I'm not sure what the difference is. I changed the
    get/set methods to use the ones in the PipelineComponentSupport class. It
    appears to me as though these function differently then the get/set methods
    in the pipelineSession class.
    Also I think maybe having included the servlet_webflow.jar in the pipeline
    ejb's manifest classpath is causing some unwanted sideeffects.... even
    though doing so stopped the class not found issues I was having.
    thanks again,
    Markus
    "Kamlesh Nanda" <[email protected]> wrote in message
    news:[email protected]...
    >
    Hi Markus,
    it seems to me that the problem with your scenario is that you aresetting the
    values in a different namespace in Pipeline component and trying toretrieve if
    from a different namespace.
    By default if you use "<webflow:getProperty" without a namespace it willuse
    the current namespace which might be different from the one in which youhave
    set the property. Most probably (again its my guess) that you are usingthe getDefaultNamespace()
    method in your pipeline component and then setting the property in thedefault
    name space.
    To debug this at a page level the easiest thing you can do is to include<Portal_HOME>\applications\portal\stockportal\framework\error\configuratione
    rror.jsp
    at the bottom of you page. [Note: before doing this copy the
    <Portal_HOME>\applications\portal\stockportal\framework\error> folder under your web application folder
    This page will give you complete details of what and where all theproperties
    exist in terms of namespace.
    Cheers
    Kam
    "Markus Blumrich" <[email protected]> wrote:
    Finally I'm having some success with pipelines....
    Can someone with source confirm my hunch that calling the
    get/setSessionAttribute method in PipelineComponentSupport has additional
    functionality than being just a shortcut to PipelineSession's methods?
    Otherwise I'm at a loss to explain why it is working.
    Also... as a side note I had to specify the namespace in the portlet
    <webflow:getProperty namespace=" attribute before the JSP was able to
    get
    at the pipeline session attribute.
    Markus

  • Radio Buttons only work after selecting another field

    In my Access 2010 database, I have an option group consisting of 3 radio buttons.  If I select the first button I Access will allow me, but if I then want to change my selection to the third button I can only do so if I select another field
    before I can make the button change.  Now, if I want to change my selection again from the third button to the second button, I must select another field then select the second button.
    I just can't figure out what is going on here.  Does anyone have any clue or explanation that will help me???  Thank you!

    I will add that originally this option group of radio buttons was working perfectly fine.  This issue surfaced when I included a tab control to the form and moved all the fields onto the first tab.
    It seems that having to select another field before changing a radio selection is limited when using the mouse; however, if I use any of the up/down or left/right arrow keys on the keyboard it will change radio button selections without selecting another field
    (as one would expect it to).
    Hi Eli,
    Probably it has something to do with the focus of the form (first tab) with the radio buttons. Someway that form looses focus when clicking a radio button. By selecting another field the form receives focus again, so you can use the radio buttons again.
    You can check it happens in this way.
    Imb.

  • Home button not working after installed ios5! Anyone has such problem?

    Just installed ios5 and found home button doesn't work. Anyone has such problem and resolution?

    1.Unlock it, open an application and hold down the Lock / Power slider appears on the screen until the closing device.
    2.Take a handful of Lock button, lightly press the Home button and hold it down for 5-10 seconds until the menu disappears and the display shows that the Springboard.
    3.This technique is a recalibration of the Home button and after they make everything should work normally without problems.

  • Window only visible on maximize, not visible on any other setting

    Seemingly at random a FF window will "disappear." It is only visible when I maximize the window. When I click on the restore down button the window "disappears."
    I have had to rebuild the window several times, and it is frustrating to have to do this, especially when there are several tabs in the window.

    Not sure if this is exactly the same as the other reported problems.
    But creating a new (via command N or via menu selection) window creates a long thin nearly zero width but full height window. Selecting the window via the window menu and zooming brings it up at full size.
    I tried turning off all add-ons and things seemed to work but then stopped working again (sorry can't find a consistent set of symptoms here).
    MacOSX 10.6.8 Firefox 6.0.2

  • How do I make pages only visible if the user touches a button?

    I'm creating a travel guide where I list out the attractions, give directions, and show a map of the area. Originally I was just going to have it set up like a book. Users would swipe to the attraction page, the next page would be the directions,  the following page would be a map, and then they would get to the next attraction. I've now set up buttons so that on the attraction page you can just touch the directions button or map button and you will go right there. Unfortunately the pages are still there in the app, so essentially the buttons serve no purpose.
    I want the maps and directions only visible if the user touches the button. Is there anyway to do this?

    I've moved your post to the DPS forum.
    This would best be created using a multi state object. You can set the options up using the slideshow pane in the folio overlays panel.

  • Photo gallery menu button not visible (black on bl...

    Lately (I don't know when it changed because before it was not like this) there is some strange behavior on my N8 when viewing photos in the gallery.
    If I chose a photo to view and then tap on screen to get the options I don't see the two buttons at the bottom of the screen (Options and Back buttons). I found out that the buttons are present but they are in black - meaning they are not visible if there is no picture covering those parts of the screen (see attached photos). They are only visible if the background is very bright (white).
    Is there any settings to change this annoyance?
    P.S. The same is true if I open pictures in Photo Editor.
    Attachments:
    P1050880.JPG ‏1634 KB
    P1050881.JPG ‏2361 KB

    Okay, I've tried .ac3 audio and I get the same result.
    I had a friend of mine try this test. He had two different Progressive scan DVD players. It played perect on one and showed these errors on the other (the audio not playing and the text appearing in a different font). He said it had somthing to do with the progressive scan settings of the player. One player could switch to this type of DVD and the other one could only do it manually in the menu screen. He said that even hollywood DVDs do this on these types of DVD players. Since I have NEVER seen this problem before what could he be talking about? And why would previous versions of DVD's that I have made in DVD Studio Pro 1, 1.5 and 2 work fine on these same DVD players?
    This is driving me nuts. Why would one DVD player play the DVD perfect and another one play the video fine, but mess up the audio and text buttons on the menu?
    Other people I have talked to stay that it may be the media it is burned to, but I'm using the same DVD media that I have always used?
    Please help!

  • " change" button not visible in check status ?

    HI,
    We are under upgrade of SRM 4.0 to SRM 5.0 . In SRM 4.0 "change" button
    is visible in check status even if shopping cart is under approval
    state.
    But in SRM 5.0 "change" button is not visible in check status if
    Shopping cart is under approval state.
    Please let me know if any one face this issue.

    Hi,
    Goto SU01 and fill in the user ID for which the button is greyed.
    Navigate to role tab
    Double click on the role so that the system opens transaction PFCG
    Select the "personnalization" tab where you will find the WFL security... (don't remember exactly the name as i do not have any system right now)
    This WF security has 4 level.
    By default it is set to none
    Select level 4 for maximum authorization.
    Save, log-off from ITS access et relogon.
    Then the button won't be greyed anymore
    Kind regards,
    Yann

  • Creating a reports folder that's only visible to the Admin role

    Hi all,
    I want to create a new Shared Custom Analyses folder to contain Admin reports. I need to make this folder only visible to users with the Administator role. But you can't seem to add the Admin role when setting up User Visibility to Shared Report Folders. Help says that it's because the Admin role has visibility to all folders.
    I understand this - but how can you resrict access to a reports folder to just the Admin role (ie. it should not be visible to other roles)??
    Many thanks.

    You will need to assign all the other folders to rest of the roles.This would be the only way so that your required folder access is given only to admin and not to other users.
    -MR

  • How do I create a new layer that is only visible in the current animation frame?

    Normally when you create a new layer it's automatically visible in all animation frames. I want to set it so that the new layer is only visible within the frame it was created.

    I was doing some playing with frames just to verify what is going on. and as far as I can see when you create a new layer it is applied to the last frame only, but if you create a new frame is is copied.
    What I did was create 2 layers one a background gradient, second is a raster rectangle.
    For frames, the first is the background, second is the rectangle and the third is the same rectangle, now I can click on either frame and move that rectangle.

  • Letters only visible lower part!

    I hav e a problem in a document where in a table some letters only visible from the middle and down. I know what it says, but it looks so unprofessional! I have tried many solutions but still this problem persists. There is another problem as well where
    I have written the year 2014 but 14 is just half the width. Not Another fontsize, but like I physically sqeezed the letters.
    What  can I do?
    Thanks!

    Check that the line height isn't set to an 'exact' point size that's less than the point size you're using, or a multiple of less than 1 line.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • Show my caller id button turns off after setting att

    show my caller id button turns off after setting at&t, any help

    Hi,  try this method, it works for me on an iphone4 & 4S (iOS7)
    make sure you have all apps closed before next steps.
    -Go to Settings, Phone, Show My Caller ID. (if button is Greyed Out)
    -Pull down Control Centre & Turn On Airplane Mode & return to Show My Caller ID screen.
    -Now slide your screen from right to left taking you to another screen, then slide back to your Show My Caller ID screen.
    -Now You Can turn ON or OFF your Caller ID Button.
    -Lastly slide down you Control Centre again and Turn OFF your Airplane Mode.
    Thats it Job done.
    Please note, it will now stay in the mode that you have chosen(ON or OFF) even if you respring or reboot your phone. But if you return back to
    Show My Caller ID screen, then you SIM Provider will automatically Disable your Caller ID screen BUTTON once again. So just repeat the steps
    above and your be fine.
    Hope this helps.

  • How do i set up my iPhone to chime when a new email arrives? right now, the chime only works after I tap the mail icon

    How do I set up my 4S phone to chime when a new email arrives?  Right now, the chime only sounds after I tap the mail icon.  I need an alert to check my mail.  Comcast mail.  Settings for mail set at "fetch new data". Thank you

    Try if this works for you
    1. Tap Settings on Home Screen
    2. Go to Mail, Contacts, Calendars
    3. Tap on Fetch New Data
    4. Turn "Push" to On
    5. Back to Mail, Contacts, Calendars again
    6. Under "Advanced", make sure that it is set to "Push" for all your mail accounts
    Push means the server will literally push the mails to your iPhone whenever there is new mail. Fetch like the word says is where you have to manually update to receive new mail (what you are doing now)

  • Push button not visible in Quality

    Hi,
    We have created one push button for the tcode fbl1n and fbl5n using the standard BADi  "FI_ITEMS_MENUE01".
    Now, the problem is the button is visible in Development server but not in Quality server.
    We have checked the version management but the code is very much visible in Quality.
    But, the push button is not visible in the Quality.
    Could anyone please provide with a solution to this problem.
    Thanks in advance,
    Kalyani.

    Hi,
    We have transported the Class name as well as BADi name to Quality.
    The implemented code along with the Fcode is visible in Quality.
    But while executing the tcodes FBL1N and FBL5N the push button which was implemented, is not visible in Quality.
    Thanks,
    Kalyani

Maybe you are looking for

  • How to add two different images on photoshop cs5?

    I was learning about the layers and masks and i seen that i have to have two images under each others under the layer option pannel, i tried many times to add images but it always shows in two different pannels as the folloing image I want to add two

  • How to fix number of messages waiting in screen icon?

    I need to know to make the mail icon on IPhone screen be accurate to the number if unopened messages actually waiting, how do I correct this?

  • DBMS_JAVA Execute for PUBLIC , is it needed in 11.5.10.2 environment

    DBMS_JAVA Execute for PUBLIC , is it needed in 11.5.10.2 environment

  • Problem in FB60 bapi

    Hi friends , i m developing a prog with bapi of FB60 it always fire the error no 014 i.e. FI/CO interface: Line item entered several times i am feeding the data which is given below in the BAPI . Please help me if anybody has worked on this BAPI w_it

  • Periodic Schedule failures due to locked objects

    We are periodically encountering issues with nightly schedules against BW Bex universes.  Some schedules will fail with the error "A database error occured.  The database error text is: Error getting variables for cube (Cube\Query name) (catalog cube