Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Russell Tristen

Greenhorn
+ Follow
since Nov 29, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Russell Tristen

Thank you all for your replies. I have done as suggested and all is now fixed
12 years ago
Thank you Pete. My code is very large so reducing it down to a workable example will take a while, I'll get started. In the mean time, it may be useful to know that:

I draw the circles on the main panel by:



and I am 'drawing' on the glass panel by updating the text in a JLabel present on it:



I've had a look in a few of my reference books and is it possible that I need to override the glass pane's paint method? If I set it's visibility to true before I start drawing the circles, it appears beneath these circles. Why isn't the glass pane always staying on top?

Sorry about all the questions - I hope you can help me further! Thanks again.
12 years ago
Hi,

Whilst I've been searching and reading these forums for a couple of months now, I've had to register as I've got an issue that Googling just can't fix!

I have a main panel on the frame, and a transparent glass panel over this. Here are the main steps in my program:

1) Glasspane visibility set to false. I then draw circles upon the main panel
2) Glasspane visibility set to true and update text on this (which should appear 'above' the circles)
3) Glasspane visibility set to false and I recolour these circles

Problem is, as soon as I update the text on the glasspanel, the circles beneath disappear, not appearing again until I redraw them. I know that I should be using threading, so I can't understand why this doesn't work:



Anybody got any tips? Thank you!
12 years ago