JFrame bleed-through

T

Todd

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
 
K

Knute Johnson

Todd said:
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

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

Andrew Thompson

Todd wrote:
...
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()?

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

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200708/1
 
D

Daniel Pitts

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

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.
 
T

Todd

Thanks all!! I changed from JPanel to JComponent in the plot method
and that cleared everything right up!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top