I’m using Abeille Forms Designer as my Swing app’s WYSIWYG editor. I’ve used this tool to create a test.jfpr file which I then import into my Eclipse project and put on the classpath. Then I just create a JFrame that uses that file as its FormPanel, and when the application launches – voila – you have a very nice looking GUI that took zero programming effort. I love it!
The only problem is that when the app loads up, nothing inside the “client area” (Windows terminology) is drawing – the menubar, as well as the main content of the screen.
When I resize the JFrame‘s window, everything immediately draws/paints and looks great.
If I then do something (selecting a menu item, etc.) that should change the main screen, nothing happens. But if I resize the window, then bam! I see the changes take effect.
To me, it seems that this is a painting/re-painting issue, where there is a disconnect between my application logic and Abeille forms I created.
Is there a way – in Swing – to programmatically force the entire window (client- and non-client areas alike) to repaint/refresh? If not, then does anybody have an idea as to what is happening here? Thanks in advance!
You can register an actionListener on the menu. Once your menu routine is done, call the repaint function on the appropriate component.
Some additional work might required to avoid flickering.