 |
| Java GUI Discussions specific to programming Java GUI. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

July 29th, 2003, 07:16 AM
|
|
Registered User
|
|
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
AWT / Swings
hi,
i have created a small application using AWT (using the components Frame, button, etc...). when i execute the application, i get a blank frame with no components displayed. but when i resize the frame all the components are displayed properly as coded. The same problem occurs with swings (JFrame) as well. Please provide help...
|
|

August 18th, 2003, 04:55 AM
|
|
Registered User
|
|
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Since when u resize the frame, the "repaint()" method is called, so the components u have placed are displayed correctly.Try, calling repaint() explicitly.
|
|

September 17th, 2003, 02:03 AM
|
|
Registered User
|
|
Join Date: Jun 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hello,
you might have put the setVisible() method, before add()ing the components in the Frame..
hope it helps...
Cyrus
Cyrus
|
|

September 23rd, 2003, 05:48 AM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
u might not have placed the add() correctly.
|
|

June 7th, 2005, 06:51 AM
|
|
Registered User
|
|
Join Date: Jun 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi dharmesh this is palak am getting the same error here
did you got the solution for this.
If so please help me to resplve this matter
Palak Sh  ah 
|
|

June 23rd, 2005, 08:04 PM
|
|
Registered User
|
|
Join Date: Jun 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi all,
I wanted to bind the JDesktopPane JFame in a way that it dynamically on runtime. I couldn't find away of doing this. Could you guys help me please. I would appreciate your prompt response.
cheers
Mudasir
|
|

June 24th, 2005, 06:06 PM
|
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
don't forget to validate() too -- the validate() is actually where the logic occurs to size and place your components on the form. validate() causes a repaint(), and actually, when you resize your form it's implicitly validate()ed to reize your controls according to the forms new dimensions, so when you resize your window it's a validate() that's implicity calling repaint() and making your controls visible -- so if it works when you resize, call window.validate() instead ... kinda the same as programmatically resizing your form, without changing the size ;)
HTH
Regards,
Meredith Shaebanyan
|
|

June 30th, 2005, 05:11 PM
|
|
Registered User
|
|
Join Date: Jun 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thank you merediths, I got that sorted. I have another question. Could any one let me know that is it possible to add scrollbar to the JDesktopPane, if yes then how. What I am doing is that I've got a JDesktopPane added to a JFrame, now I want scrollbars to come up when user shrinks size of JFrame which automatically shrinks the size of JDesktopPane. How can I incorporate scrollbars to the JDesktopPane.
Again your prompt response would be highly appreciated.
Kind regards,
Mudasir Waraich.
|
|
 |