Hi, I am trying to load an iconed button onto a toolbar. If the graphic file does not exist, results are the same. To me, this implies I am not calling the .gif incorrectly. My best attempt is a very small button, no icon. Checked the JavaRanch messages, and could not find one that addressed this issue. If you remember reading a solution to this, please reply with the link. Apparently no one else has had a problem with this. Is there some kind of plug-in I am missing This is from day 21 of Cadenhead & Lemay�s Professional Edition of Teach Yourself Java 2, p. 536. The code has been edited in the interest of brevity. Initially there were three buttons.
Thomas, Thank you for verifying the code worked correctly. Fiddled around with it, and found the codet worked correctly when the graphics were called with an absolute path - �C:\foo\bar\graphic.jpg� rather than �graphic.jpg�. The next question is "how is the cwd determined?", but that is a question for another forum. My apologies for nuisancing this forum with a non-swing inquiry. Connie
Connie, we have had several questions in several forums regarding loading images. A bunch were resolved by the solution you referred to: absolute path. Are you aware of any way to load an image file using relative paths? I haven't had a chance to search the API for this info, but if you come across an answer, please post it.
it's a teeny, tiny, wafer thin ad:
a bit of art, as a gift, that will fit in a stocking