What Java Swing event can be used to know when application has finished starting? -


I am looking to hook a program to hook a program when the app is loading is .

I'm just starting with Java I am using Netbeans 6.5.1 with jdk1.6.0_13. I have used the new project wizard to create a new Java / swing desktop application. This is a singleframe application which uses a frame view with a central main jpnell where all the UI elements are kept.

I tried my code in the first framework constructor, but when I try to organize my GPNL on the boundary rectangle, I have added one of the design time controls to the UI, Not yet deployed and shaped so I am receiving all the zeros for coordinates.

I have confirmed my code as it is expected that after app loading, calling from one click event is finding out how to find out my problem when everything is shaped and organized.

I also tried component, Shower event from Main JPanel, but later I have read that only is removed if the setvich is clearly stated which is not normally common during normal startup is.

Can anyone provide some hint? Thank you.

Update:

In addition to what I mention in my reply given below, I also read about application.ready () method is. To know this, there will also be a point at the time of interest that when there is a need to complete the UI section of an application, there was something wrong with communicating my thoughts with the application.

The solution I actually had was the combination of replies by Charles Marin and JRLL (for credit Your both answers have been raised, thanks).

My framework class was enforced with WindowListener.

  ... prevents the public category's MyView frameviews WindowListener ...  

And in my frameview constructor I have added listener to the main frame of the application .

  ... getFrame () .addWindowListener ((WindowListener) this); ...  

Then in the implementation of the window, I could call that code which I could control and arrange on the main genellage based on the location and size of the main controller.

  Public Zero Window Active (WindowEvent E) {// Application should now end its startup stuff // Control of a position and size based on other UI controls}  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -