How to load an image using Toolkit
Hi anyone, please i am very new to Java and this forum too, i need help trying to create a banner for my GUI but i am trying to use the toolkit to load it. i have tried everything i can to load the image but i cant, no error occurred but the image did not load too...
please take a look at this code and help me correct what i am doing wrong. i can post the rest of the code if require it. Thank you very much.
toolkit = Toolkit.getDefaultToolkit();
if(toolkit.getScreenSize().getWidth() > 600)
setSize((int)toolkit.getScreenSize().getWidth(),(i nt)toolkit.getScreenSize().getHeight() - 20);
Dimension dimension = getSize();
Image image = getToolkit().getImage("images/defaultbanner.gif");