I am looking for a place to select code for programmatically creating, the size and position of JPanel after the application has finished loading.
I am just starting with Java. I am using NetBeans 6.5.1 with jdk1.6.0_13. I used the new project wizard to create the main Java / Swing application. This is a SingleFrameApplication that uses a FrameView with a central core JPanel where all user interface elements are hosted.
At first I tried my code in the FrameView constructor, but when I try to arrange my JPanel based on the bounding box of one of the design time controls that I added to the user interface, this control has not finished positioning and size yet, so I'm getting everything zeros for coordinates.
I checked that my code works as expected, triggering it from the click event after the application has loaded, so my problem is to find out when it was all over, size and location.
I also tried the componentShown event from the main JPanel, but later I read that it only fires if setVisible is explicitly called, which apparently does not happen when the application starts normally.
Can someone point out some pointers? Thanks.
Update:
In addition to what I mention in my answer below, I also read about the Application.ready () method. It will also be a point of interest to find out when part of the user interface of the application is completed, doing whatever it takes. Communication with my view from the app seemed a bit dirty though.
java swing
Arnold spence
source share