Triggering method after loading of gui

hi there.
I have a single frame java application that connects to a mysql instance for data storage.
What I would like is to trigger a method after the gui loads.
How can this be accomplished?
Cheers

Just do what all the IDEs generate code to do: invoke SwingUtilities.invokeLater() after creating all the GUI objects.

Similar Messages

  • Calling a backing bean method after load of fragment in adf

    I needed to call a backing bean method after page load of fragment in adf.
    I used the method suggested in:
    https://community.oracle.com/message/11044570
    only difference is im giving the if clause as:
    if (refreshFlag == RegionBinding.RENDER_MODEL ) {
    instead of
    if (refreshFlag == RegionBinding.PREPARE_MODEL)
    It was working fine, but page was not getting refreshed so used the code as mentioned in example:
    public void refresh() {
              FacesContext facesContext = FacesContext.getCurrentInstance();
              String refreshpage = facesContext.getViewRoot().getViewId();
              ViewHandler  viewHandler =facesContext.getApplication().getViewHandler();
              UIViewRoot viewroot =  viewHandler.createView( facesContext, refreshpage);
              viewroot.setViewId(refreshpage);
              facesContext.setViewRoot(viewroot);
    Now issue is once page is loaded and backing bean method is called, the refresh code refreshes the page and upon page load, refresh method is called again in recursive fashion.
    please advise what to do in such scenario?
    I tried to do selective refresh using some variable(also with static) but it does not help as page wont be refresh at all or page will keep refreshing recursively.

    Use clientListener on the page load event
    <af:document id=”d1″>
        <af:serverListener type=”onloadEvent”
                           method=”#{<managedbean name>.<method name>}”/>
        <af:clientListener method=”onLoadClient” type=”load”/>
        <af:resource type=”javascript”>
        function onLoadClient(event) {
          AdfCustomEvent.queue(event.getSource(),”onloadEvent”,{},false);
          return true;
        </af:resource>

  • How to call a javascript method after table load on JSFF Fragment load?

    Hello,
    The usecase is to invoke a javascript method after table is done loading (fetching data) when user lands to a JSFF fragment. With JSPX pages I can achieve that by using PagePhaseListener. I have tried with RegionController as follows, and the problem i face is that I cannot prevent multiple calls to the Javascript call when user presses a tab or button in a screen, or changes drop-down value with autosubmit on.
    import javax.faces.context.FacesContext;
    import oracle.adf.model.RegionBinding;
    import oracle.adf.model.RegionContext;
    import oracle.adf.model.RegionController;
    import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
    import org.apache.myfaces.trinidad.util.Service;
    public class MyListener implements RegionController{
    public MyListener() {
    super();
    @Override
    public boolean refreshRegion(RegionContext regionContext) {
    int refreshFlag = regionContext.getRefreshFlag();
    System.out.println("Render flag is: "+refreshFlag);
    if (refreshFlag == RegionBinding.PREPARE_MODEL)
    initializeMethod();
    regionContext.getRegionBinding().refresh(refreshFlag);
    return false;
    public boolean validateRegion(RegionContext regionContext) {
    regionContext.getRegionBinding().validate();
    return false;
    public boolean isRegionViewable(RegionContext regionContext) {
    return regionContext.getRegionBinding().isViewable();
    public void initializeMethod() {
    FacesContext f = FacesContext.getCurrentInstance();
    ExtendedRenderKitService service = Service.getRenderKitService(f, ExtendedRenderKitService.class);
    service.addScript(f, "myJSFunction();");
    @Override
    public String getName() {
    return null;
    I need the javascript to be called only once after the table is done loading when user lands to a fragment (jsff).
    Any ideas appreciated?
    JDeveloper version is 11.1.1.5.0
    Thank you.
    Valon
    Edited by: Valon on Apr 11, 2013 3:10 PM

    One of the requirements is to compare every row with the next row and highlight the changes. There are other requirements as well where JavaScript solution is used.
    The question remains the same. Is it doable or not without changing the solution from JavaScript solution to server-side solution ? Can we call a JavaScript only once when the user lands to a jsff fragment ?
    Hope that is clear.
    Thanks.
    Valon

  • How to execute a method after page Load?

    My question is very similar to what was discussed in following thread:
    How to execute a method after page Load?
    My requirement is that I want to run a method in backing bean of a page, immediately after the page gets loaded. In that method I want to invoke one of the method action included in the pagedef of this page, conditionally.
    I tried using the approach given in the above thread, i.e to use <f:view afterPhase="#{backing_security.setPermPriv}">, but the problem is that our page is not using 'f:view' , so I explicitly added one f:view with afterPhase property set , but it is not working, page it self is not getting loaded, it is throwing the error:
    Root cause of ServletException.
    java.lang.IllegalStateException: <f:view> was not present on this page; tag [email protected]e8encountered without an <f:view> being processed.
         at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.setProperties(UIXComponentELTag.java:108)
         at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:733)
         at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1354)
         at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:71)
         at oracle.adfinternal.view.faces.taglib.UIXQueryTag.doStartTag(UIXQueryTag.java:41)
         at oracle.adfinternal.view.faces.unified.taglib.UnifiedQueryTag.doStartTag(UnifiedQueryTag.java:51)
         at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:50)
         at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:262)
         at oracle.jsp.runtime.tree.OracleJspNode.execute(OracleJspNode.java:89)
         at oracle.jsp.runtimev2.ShortCutServlet._jspService(ShortCutServlet.java:89)
         at oracle.jsp.runtime.OracleJspBase.service(OracleJspBase.java:29)
         at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:665)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:387)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:822)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:746)
    Please help to resolve this issue, or am I doing anything wrong?

    Hi,
    I assume that your view is a page fragment and here - indeed - the f:view tag cannot be used. If you use ADF then one option would be to use a custom RegionController on the binding layer to listen for the render phase to invoke the method. Another option would be to use a hidden field (output text set to display="false" and have this component value referencing a managed bean property. The managed bean property's getter method can now be used to invoke the method you want to run upon view rendering
    Frank

  • Adf faces: execute bean method after table is loaded

    Hi,
    How can I execute a method after an adf table is rendered on the page?
    This is what I want to do:
    I have a master/detail:
    - the master part contains a list of materials
    - the details contains a list of customers and volumes depending on the selected material.
    I tried to add totals on the details table:
    - I created an output text in the footer-facet of the colums containing volumes
    - I created a binding of the detail table to a CoreTable.
    - I created a method in a managed bean related to this CoreTable binding, so I can browse to all rows in the table and calculate the sum.
    - I then set the value of the output text to the total calculated in the managed bean.
    the problem is that I don't know how to execute the calculate procedure after the data in the detail table exists.
    What I tried:
    - call the calculate procedure in the setCoreTable method. --> at this point, there is no data in the table and this results in a nullPointerException when the pages is loaded.
    - call the calculate procedure on the valueChangeListener of the material list --> this doesn't work because totals are calculated for the previous details set.
    - I tried to add the call in one of the table listeners but I cannot find a listener that is executed after data is loaded in the table...
    for testing purpose only, I added a button: calculateTotals that calculates the totals. This works correctly.

    Hi,
    if you use page fragments exposed in an ADF region, you have two options I see
    1. Use a method call activity to call the managed bean
    2. Use a hidden UI component that references the setter/getter exposed in a managed bean and just use this as an indication for the page fragment being loaded
    Keragala

  • How to call a method after a page  complete load

    Hi,
    Environment: JSF1.2.12+Spring
    I have a startpage, i will call a methode after startpage complete load. (I do not want to use javascript)
    How can i implement it.
    Edited by: zlzc2000 on Nov 6, 2009 2:53 AM

    goal: optimize load startpage(accelerate to load startpage)
    in startpage i use sql to load user's information, that in startpage is required.
    in other page i need the complete User Object (hibernate load user Object).
    i want to after dispay startpage load the user Object whith Hibernet.
    if during load startpage with hibernate to load user object, that is too slow.
    concept: 1step: with sql load user information (not full, for example: id, forename, surname,...)
    2step: results display( load startpage )
    3step: after load complete startpage, call method to load user object(it include all information of user )
    then the user object can be uesed in anywhere in the future.
    but i dont know how to impement it.
    Edited by: zlzc2000 on Nov 6, 2009 3:37 AM

  • What is the best way to get another object's method to update my GUI?

    package stuff;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    public class Test extends JFrame{
      private static JButton ProcessButton = new JButton();
      private static JLabel jLabel2 = new JLabel();
      public static void main( String args []){
         Test f = new Test();
         f.setSize(500,500);
         Container c = f.getContentPane();
         ProcessButton.addActionListener( new ActionListener(){
                                     public void actionPerformed(ActionEvent e) {
                                        jLabel2.setText("Connecting to DB");
                                        //Connection connection = Tools.setUpConnectionToDB(url,userName,pwd);
         c.add(ProcessButton, BorderLayout.NORTH);
         jLabel2.setText("My Label");
         c.add(jLabel2, BorderLayout.SOUTH);
         f.setVisible(true);
    {\code]
    The method setUpConnectionToDB can take 1 - 10 mins to complete. By this time a user will prob have quit my app thinking
    it's crashed because it doesn't update the GUI with a progress status. :(
    What is the best way to get this method to update the GUI of the app which calls it?
    Something like  Connection connection = Tools.setUpConnectionToDB(url,userName,pwd, this);
    ie this being a reference to the GUI's JFrame is what I'm trying to use?

    A handy class to know about but not really what I'm after.
    I need the method call
    Tools.setUpConnectionToDB(url,userName,pwd);
    to be able to update a component ( The JLabel ) on the GUI
    Connection connection = Tools.setUpConnectionToDB(url,userName,pwd, this);
    [\code]
    method defn:public static Connection setUpConnectionToDB( String url, String user, String pwd, JFrame f ){
    //Why doesn't this code below modify the GUI on the calling App?
    f.jLabel2.setText("Setting UP DB Connection");
    f.repaint();
    Connection c = null;
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    c = DriverManager.getConnection(url,user,pwd);
    catch(ClassNotFoundException e){
    JOptionPane.showMessageDialog(null , "Error loading DB driver");
    System.exit(0);
    catch(Exception e){
    JOptionPane.showMessageDialog(null , "Error connecting to DB, check config file");
    System.exit(0);
    return c;
    }[\code]

  • AIR App Crashes iOS After Loading Remote Image

    I have had this problem both with the latest official AIR SDK 3.3 (3.3.0.3670) and 3.4 release (3.4.0.2540) when doing a Standard build.  I am loading a few files one after the other from a remote server on an iPad.  After loading some xmls and swfs successfully, my app crashes and closes without any error message upon loading an image file (I've tried both png and jpg with the same result).  I have both progress and complete event listeners on the loader and the crash happens after all bytes are loaded and before the complete event triggers.  So it seems as if there is some problem with initializing/decompressing the image.  The crash log reports things along the lines of "EXC_BAD_ACCESS" and "KERN_INVALID_ADDRESS."
    This problem does not occur if the files are loaded from the application directory --- only when they are loaded from the remote server.  It is also not occuring with the preview AIR SDK 3.4 with iOS6 Support release (3.4.0.3010).  It is also not occuring on the desktop simulator (adl) or the Fast mode debug option.
    Right now all I can gather is that it is a bug with the AIR SDK that seems to be resolved in upcoming versions, however I am due to submit my app to the app store September 4th so I don't really have the time to wait!
    Please advise on how I can go about tackling this issue.
    The issue occurs with any combination of the following:
    Flash Builder 4.6
    Flex SDK 4.5.1 or 4.6
    AIR SDK 3.3 or 3.4
    iPad 1/2/3 with iOS 5.1.1

    Hi,
    Could you please consider it raising via bugbase.adobe.com and share the bug number here for reference. Also, we would request you to attach sample source files which can replicate the issue.
    -Thanks for reporting it.
    Pahup

  • 2LIS_03_UM - is Compression required after Load ??

    Hello Gurus,
    Do I need to Compress the data after loading from Infosource 2LIS_03_UM. If yes then , Should the "No Marker Update" be checked or unchecked.
    I am using the "non-ciummulative key figures" method for stock upload.
    The how to.. guide does not speak much abt the compression of the UM infosource.
    Pls advice with explanation. Thanks in Advance.
    rgds

    Hi,
    Generally you should compress every InfoCube as soon as possible because it saves space and speed up queries.
    It is especially important for InfoCubes with non-cumulatives.
    There is special How-to guide:
    https://websmp104.sap-ag.de/~sapidb/011000358700002121282004
    The same rules are applied for InfoSource UM as for BF.
    Krzys

  • Triggering methods when a user clicks on a tabb in a JTabbedPane

    triggering methods when a user clicks on a tabb in a JTabbedPane.
    How can it be done? what listener should i use?

    Well, after READING the JTabbedPane API, it appears
    there is an addChangeListener()[/i[ method, so my guess
    would be a [i]ChangeListener ?
    And the source for the ChangeEvent would be the JTabbedPane
    so you could then easily call getSelectedIndex() to find
    out which pane is selected.

  • How to increase BoundingSphere radius after loading .3ds model

    I can properly load in all .3ds models, however, after loading them into the canvas some .3ds models are far too large. When I zoom out (by pushing the model back with MouseZoom) the model disappears from view even though I have the boundingsphere declared as:
    BoundingSphere bounds = new BoundingSphere(new Point3d(), Double.POSITIVE_INFINITY);
    I add the loaded model (transformgroup.addChild(model.getSceneGroup());) and this contains the bounds as shown above.
    The weird thing is when I load .obj files using the same method it works fine. I can zoom out on these objects to infinity (until they are small dots).
    Why are the .3ds models disappearing from the bounds even when I have them set to POSITIVE INFINITY?
    Any ideas? Thanks.

    Try the Java 3D forum: [http://forums.sun.com/forum.jspa?forumID=21]

  • 7941 tftp failure after loading SCCP41.9-2-3S

    After loading 9.2.3S on CUCM 8.6.1, my phones will only update some of their config.
    I've looked at the settings on the phone and noticed the following.
    The ITL file is not there and  the TFTP server is not listed. The status messages show a TFTP error while trying to load the cnf.xml file.
    I'm able to set the alternate TFTP server on the phone, but it is deleted as soon as the phone resets. this is verified through the phone settings and the phone web page. the console logs also seem to confirm this.
    Any ideas anyone.

    Even though this is an old thread I though I would share what I found regarding this issue. It looks like this is a bug but only if the TFTP server has a 255 in the address. The workaround is to change the TFTP server IP. The bug is fixed in newer versions of the code. Here is the link.
    http://tools.cisco.com/Support/BugToolKit/search/getBugDetails.do?method=fetchBugDetails&bugId=CSCtx99669&from=summary

  • Can´t view photos in full screen after loading photos to dropbox? what to do?, can´t view photos in full screen after loading photos to dropbox? what to do?

    after loading photos to dropbox i can´t view them in full screen in iphoto ... i can only view them small ... when i click on them this sign "!" appears... do you know how to fix this????

    If you're loading photos to drop box why do you expect to see them in iPhoto?
    The ! turns up when iPhoto loses the connection between the thumbnail in the iPhoto Window and the file it represents.
    Remember: we cannot see your machine. There are 9 different versions of iPhoto and they run on 8 different versions of the Operating System. The tricks and tips for dealing with issues vary depending on the version of iPhoto and the version of the OS.  So to get help you need to give as much information as you can. Basic things like :
    - What version of iPhoto.
    - What version of the Operating System.
    - Details. As full a description of the problem as you can. For instance: 'iPhoto won't export' is best explained by describing how you are trying to export, and so on.
    - History: Is this going on long? Has anything been installed or deleted?
    - Are there error messages?
    - What steps have you tried already to solve the issue.
    - Anything unusual about your set up? Or how you use iPhoto?
    Anything else you can think of that might help someone understand the problem you have.

  • HT1386 I just reinstalled my windows operating system and decided to put on windows 8.  After loading all of my music back into a freshly installed itunes, my 4th gen ipod is not recognized by itunes.  My 1st gen ipod nano works with no problem.  Help!

    reinstalled my windows operating system and decided to put on windows 8.  After loading all of my music back into a freshly installed itunes, my 4th gen ipod is not recognized by itunes.  My 1st gen ipod nano works with no problem.  I can eliminate any problems with the cable and connection.
    I've stopped and started the service, and also have performed cold reboots.
    Nothing seems to have helped the situation.
    Help!

    See:
    iOS: Device not recognized in iTunes for Windows
    I would start with
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    iTunes for Windows: Device Sync Tests
    Have you tried on another computer to help determine if you have a computer or iPod problem?
    The iPod Classic uses different drivers than the Nano

  • Error message unable to load a GUI

    HELLO THERE.  I AM TRYING TO READ A MANUAL BUT I MOST HAVE ADOBE READER WHEN INSTALLING I GET A MESSAGE UNABLE TO LOAD A GUI THEREFORE I HAVE NOT BEEN ABLE TO COMPLETE THE INSTALLATION PROCESS OF ADOBE NOR READ THE MANUALS THAT I NEED.  CAN ANYONE TELL ME WHAT TO DO. THANKS

    Thank you MerryMort, you've been a lifesaver! I checked out your last post, and the link you put up helped. It started up the download manager instantly. I tested out youtube and the videos there started up instead of giving me the message to install last version of flash player! Again thanks.

Maybe you are looking for

  • XY graph question

    I have an XY graph that I'm using to display data read from a TDMS file. I'm using a property node to set the XScale.Maximum and XScale.Minimum to allow the user to see only a portion of the graph at once. This way they see the latest data more easil

  • FTP Adapter and Seeburger

    Hi, We are using the FTP adapter and the Seeburger BIC adapter (is configured as a module in the FTP communication channel) When we receive EDIFACT files the first step that is performed is the conversion from EDIFACT to XML messages (done by Seeburg

  • How to capture user name and date in the database

    How to capture the person name who edits the application and the date of edit in the database... Pallavi

  • HP Elite 7100 freezes randomly

    Mostly brand new (about 3 months old) HP Elite 7100 mT (i5 750, 4GB RAM, ATI 5450) freezes randomly. Tried reinstalling OS with clean Windows and fresh drivers of HP website and/or INTEL/AMD accordingly, still happens. When it freezes, the windows lo

  • I am using Firefox.  I am unable to upgrade

    I am using forefox, and am unable to upgrade.  What do I do.