Hi Guys
Can someone please tell me what the best way of placing images in the GUI is ?
Thank You.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hi Guys
Can someone please tell me what the best way of placing images in the GUI is ?
Thank You.
"Extraordinary Claims Require Extraordinary Evidence" .... American Astrochemist Carl Sagan.
Hello Ciwan,
Take a look at this tutorial:
How to Use Icons (The Java™ Tutorials > Creating a GUI with JFC/Swing > Using Swing Components)
This may also be of use to you:
http://www.javaprogrammingforums.com...d-banners.html
Please use [highlight=Java] code [/highlight] tags when posting your code.
Forum Tip: Add to peoples reputation by clicking the button on their useful posts.
lol you've got to be kidding me !!
All that code just to display an image onto the GUI !!!
"Extraordinary Claims Require Extraordinary Evidence" .... American Astrochemist Carl Sagan.
Thats Java Swing for you.. It takes a lot of code to do simple things.
Please use [highlight=Java] code [/highlight] tags when posting your code.
Forum Tip: Add to peoples reputation by clicking the button on their useful posts.
Hi all, i havent been here for a while (due to an argument with the admin here) but the code below is all you need to display an image:
I've also written an updated version with new features such as adding an image to a default position on your GUI so you don't need to write cb.setBounds(); but i haven't linked the updated files here.cb2.setBanner("http://www.engineeringserver.com/Software/banner.gif");
getContentPane().add(cb2);
cb2.setBounds(7, 280, 469, 63);
Reliable Hosting Service since 2005.