Wrox Programmer Forums
|
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
 
Old July 29th, 2003, 07:16 AM
Registered User
 
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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...

 
Old August 18th, 2003, 04:55 AM
Registered User
 
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Since when u resize the frame, the "repaint()" method is called, so the components u have placed are displayed correctly.Try, calling repaint() explicitly.

 
Old September 17th, 2003, 02:03 AM
Registered User
 
Join Date: Jun 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to cyrusds_asp
Default

Hello,

     you might have put the setVisible() method, before add()ing the components in the Frame..

      hope it helps...

Cyrus


Cyrus
 
Old September 23rd, 2003, 05:48 AM
Authorized User
 
Join Date: Aug 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to egolileopablo Send a message via Yahoo to egolileopablo
Default

u might not have placed the add() correctly.

 
Old June 7th, 2005, 06:51 AM
Registered User
 
Join Date: Jun 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to palak2u Send a message via Yahoo to palak2u
Default

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 Shah
 
Old June 23rd, 2005, 08:04 PM
Registered User
 
Join Date: Jun 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old June 24th, 2005, 06:06 PM
Authorized User
 
Join Date: Jul 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to merediths
Default

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

 
Old June 30th, 2005, 05:11 PM
Registered User
 
Join Date: Jun 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception AWT-EventQueue-0 native method Floetic Java GUI 1 April 21st, 2008 02:21 AM
Swings and servlets sharadagarwal BOOK: Beginning Java 2 3 September 12th, 2006 04:39 AM
Swings based applications kishore25 Java GUI 2 August 26th, 2005 03:36 AM
awt event model help thanasis_gr Java GUI 2 October 20th, 2004 08:10 AM
Images in Frame AWT Window cyrusds_asp Java GUI 1 November 2nd, 2003 09:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.