Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JFrame bleed-through

Reply
Thread Tools

JFrame bleed-through

 
 
Todd
Guest
Posts: n/a
 
      08-29-2007
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

 
Reply With Quote
 
 
 
 
Knute Johnson
Guest
Posts: n/a
 
      08-29-2007
Todd wrote:
> 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?

--

Knute Johnson
email s/nospam/knute/
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      08-29-2007
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.asp...neral/200708/1

 
Reply With Quote
 
Daniel Pitts
Guest
Posts: n/a
 
      08-29-2007
On Aug 29, 10:11 am, Todd <todd.heident...@lmco.com> wrote:
> 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.

 
Reply With Quote
 
Todd
Guest
Posts: n/a
 
      08-29-2007
Thanks all!! I changed from JPanel to JComponent in the plot method
and that cleared everything right up!!


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How Can I Get One JFrame To Appear Above Another JFrame clusardi2k@aol.com Java 2 08-27-2012 03:00 PM
start a new JFrame from an existing one, and when old JFrame closes new one does not jakester Java 3 04-02-2007 11:13 PM
Re: where is the JFrame constructor Passero Java 2 07-11-2003 11:05 PM
JFrame URL Link René Kikkenborg Java 1 07-09-2003 06:55 AM
Where is the JFrame constructor? Passero Java 6 07-05-2003 08:52 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57