Results 1 to 14 of 14
Thread: Dialog Image
- 02-24-2009, 04:41 PM #1
I have wrote a periodic table app that displays the periodic table. If you click on the appropriate box the app loads up a modal dialog box for that particular element. The dialog contains information and an image. 99% of the time the dialog box loads up ok. Occasionaly the dialog frame will load but nothing is displayed. If i move the Dialog behind another window or the edges of the screen the picture appears, its as if the window is locked up and needs repainting. Any ideas about whats going on?
You've got a bug in your code?
- 02-24-2009, 08:25 PM #3
Im not so sure about having a bug in my code. The program does not lock up. When you close the dialog and then reopen the dialog it works fine. Only occasionaly does the dialog not show the image and the data. I am only asking here in case more experienced java users have come across this problem or similar problems. I have checked and rechecked my classes, search java resources on the net, all to no avail. If "You've got a bug in your code?" is the best you can come up with, then this place is off no help also.
Last edited by Fubarable; 02-24-2009 at 08:58 PM.
- 02-24-2009, 10:20 PM #5Senior Member
- Join Date
- Jul 2008
- Rep Power
I can kind of recall experiencing a
problem like this long ago.
So I've tried to simulate your
problem in a dialog of one of my
I think your problem is not in the
dialog. It seems like code elsewhere
my be pre-empting the dialog update.
The only other idea I can think of
is that you have a very outdated
version of Java.
(I hate making that suggestion.)
- 02-25-2009, 03:33 AM #6
Thanks for the prompt responses lads and/or ladies. I will go over my app 1 more time, if i get no joy i will post the relevent code snippits.
- 02-25-2009, 04:19 AM #7
Cheers Fubarable "especially if you run foul of swings thread safety". This made me think, I was testing my app in bluej, which must be running its own threads. I suspect the app was getting tangled in bluej threads so to speak. I created a jar file, ran the program and cannot reproduce the error, everything works fine. As i say im new to Java and grateful for any help.
Good day to all.
- 02-25-2009, 05:35 AM #8
> I suspect the app was getting tangled in bluej threads so to speak.
That's just... silly.
It's far more likely that your way of loading and/or displaying the image is incorrect.
- 02-25-2009, 06:07 AM #9
Darryl.Burke says "I suspect the app was getting tangled in bluej threads so to speak.
That's just... silly.". Well explain why the executeable byte code version does not have any errors. It works perfectly. but in the blueJ enviroment it produces the error eluded to in the above discussion. Im suprised at a senior member coming out with illogical tripe like that Darryl.Burke. Another thing i find on some forums and this place looks no different is people butting in when they have nothing constructive to say. As if they are some kind of Guru.
I would listen and take to heart to what Darryl says here. He knows more about image display in Swing components than you or I will ever know.
- 02-25-2009, 06:19 AM #11
From the Swing concurrency tutorial* (emphasis added)
Programs that ignore this rule may function correctly most of the time, but are subject to unpredictable errors that are difficult to reproduce.
* The Event Dispatch Thread (The Java™ Tutorials > Creating a GUI with JFC/Swing > Concurrency in Swing)
Since you haven't shown any code, there's no point in anyone here trying to guess what you might have done wrong. If you want to get help, post a SSCCE** that demonstrates the problem. (It doesn't matter if it shows that problem in your IDE and not when run outside of the IDE.)
** SSCCE : Java Glossary
Last edited by DarrylBurke; 02-25-2009 at 06:28 AM.
- 02-25-2009, 06:21 AM #12
Your just ganging up now like school yard bullies. Explain why the executable works perfectly but does not work properly in the bluej enviroment. It may not be threads, but it is something in the Bluej enviroment causing the problem, simple as, compendo. The problem is fixed, no more help is needed, the images display perfectly, the application is a masterpiece, get the picture. I have looked around at some post and this place looks a bad place to do business. It has brain dead senior members, image graphic expert with no common sense, need i say more. Good bye All and good ridence.
- 02-25-2009, 06:35 AM #13
All I can say is, I sincerely pity the developers who wlil one day work with you in the same team.
And there'll be a lot of them, because nobody'll want to keep you long.
I'm reporting your post to the moderators for being confrontational and inflammatory. Nobody was rude to you here, but you chose to resort to personal attacks to cover up your unwillingness to learn to do things the corect way.
- By sruthi_2009 in forum AWT / SwingReplies: 14Last Post: 04-10-2009, 08:46 AM
- By SpaceY in forum New To JavaReplies: 2Last Post: 11-11-2008, 01:25 PM
- By hunterbdb in forum Java 2DReplies: 9Last Post: 10-30-2008, 06:17 PM
- By JavaLerner in forum AWT / SwingReplies: 27Last Post: 07-07-2008, 11:29 AM
- By archanajathan in forum Advanced JavaReplies: 0Last Post: 01-08-2008, 05:29 PM