Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2007

Tip: Looking for answers? Try searching our database.

JFrame bleed-through

Thread view: 
Todd - 29 Aug 2007 18:11 GMT
Hello,

This is just an information collecting pre-question as I have not yet
figured out how to make an SSCCE for my issue.

I have two JFrame windows.  The first window has a single embedded
JPanel upon which points and lines are painted (i.e., a plotting
window).  The second window has multiple embedded JPanel's upon which
many different widgets are placed for application configuration.

My problem is that when updates are performed in the plotting window,
it grabs the visual aspects of the application window and overlays
them upon the plot.  Not what I really want.  BTW, by visual aspects,
I mean that the application window is redrawn within the plot window,
widgets and all, but there is no functionality to any of the widgets.

Has anyone else experienced this?  I was thinking that this may be a
JDK issue as I don't see it on machines where JDK 6 update 1 is
installed, however this is not a very satisfactory intuitive response.

If you have constructive comments on this topic, I would love to see
them.  Please don't flame me for not yet having an SSCCE.

Thanks,
Todd
Knute Johnson - 29 Aug 2007 18:20 GMT
> Hello,
>
[quoted text clipped - 21 lines]
> Thanks,
> Todd

Sounds to me like you are using the same component in two places?

Signature

Knute Johnson
email s/nospam/knute/

Andrew Thompson - 29 Aug 2007 18:29 GMT
...
>This is just an information collecting pre-question as I have not yet
>figured out how to make an SSCCE for my issue.

Don't worry, it'll probably be a cinch once we
figure what the problem is.  ;-)

>I have two JFrame windows.  The first window has a single embedded
>JPanel upon which points and lines are painted ..

Using paint() or paintComponent()?

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Daniel Pitts - 29 Aug 2007 18:30 GMT
> Hello,
>
[quoted text clipped - 21 lines]
> Thanks,
> Todd

Sounds like you're JPanel getOpaque() is returning true, but it is
NOT, in fact, opaque. In other words, its not drawing the background
that its supposed to.

My suggestion is either to do a fillRect in the paintComponent object,
or setOpaque(false) in the initialization code for your panel.

Alternatively, use JComponent rather than JPanel.  JPanel implies
container, while JComponent does not.  Even though both can contain
components, JPanel's purpose is specific, where JComponent is not.

Hope this helps.
Todd - 29 Aug 2007 18:35 GMT
Thanks all!!  I changed from JPanel to JComponent in the plot method
and that cleared everything right up!!


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.