Friday, 5 October 2012

JLabel and imageIcon


This swing java program is used for displaying image, label in an applet.

place a required picture in a folder, copy and paste the following code in a note pad and
save as "JLabelDemo.java" as the file name. Note that picture and java file must be stored
in the same folder.

compilation: javac JLabelDemo.java
run: appletviewer JLabelDemo.java


program code:
-------------------------------------------------------------------------------------------


import java.awt.*;
import javax.swing.*;

/* <applet code="JLabelDemo" width=355 height=200>
</applet>
*/

public class JLabelDemo extends JApplet{

public void init() {
// Get content pane
Container contentPane = getContentPane();

// Create an icon
ImageIcon ii = new ImageIcon("sateesh.jpg");

// Create a label
JLabel jl = new JLabel ("SATEESH.BAGADHI", ii, JLabel.CENTER);

// Add label to the content pane
contentPane.add(jl);
}
}
 
-----------------------------------------------------------------------------------------
output:

23 comments:

Anonymous said...

That is a very good tip especially to those fresh to the blogosphere.
Brief but very precise info… Many thanks for sharing this one.
A must read post!

Feel free to visit my webpage :: affordable seo service

Anonymous said...

I was suggested this web site by my cousin. I am not
sure whether this post is written by him as nobody else know such detailed about
my trouble. You are amazing! Thanks!

Also visit my site; typing jobs from home

Anonymous said...

Hi there! I could have sworn I've been to this blog before but after checking through some of the post I realized it's
new to me. Anyhow, I'm definitely happy I found it and I'll be book-marking
and checking back frequently!

Feel free to surf to my weblog; Parfum Outlet Online

Anonymous said...

Hi there everyone, it's my first visit at this website, and paragraph is truly fruitful in favor of me, keep up posting these types of articles or reviews.

Also visit my webpage; All inclusive Resorts

Anonymous said...

Attractive section of content. I just stumbled upon
your web site and in accession capital to assert that I get actually
enjoyed account your blog posts. Any way I will be subscribing to your augment and even I achievement you access consistently fast.


my blog: private krankenversicherung kind

Anonymous said...

I am no longer certain the place you are getting your information, however good topic.
I must spend some time finding out much more or working out more.
Thank you for great information I used to be in
search of this info for my mission.

Also visit my web blog :: cheap unlimited reseller hosting

Anonymous said...

Greetings! I know this is kinda off topic but I was wondering
if you knew where I could find a captcha plugin for my comment form?

I'm using the same blog platform as yours and I'm having difficulty finding one?
Thanks a lot!

Also visit my blog post; Stay At Home Phone Jobs

Anonymous said...

My brother recommended I would possibly like this website.
He was entirely right. This post truly made my day. You can not believe simply how so much time I had spent for this information!
Thank you!

Review my page :: krankenkasse vergleich gesetzlich

Anonymous said...

Hello! I know this is kinda off topic but I was wondering which
blog platform are you using for this website?
I'm getting sick and tired of Wordpress because I've had problems with
hackers and I'm looking at options for another platform. I would be fantastic if you could point me in the direction of a good platform.

Take a look at my site :: paradise island vacation deals

Anonymous said...

I am genuinely glad to glance at this blog posts which
carries lots of helpful facts, thanks for providing such statistics.



Here is my blog post :: refinancing loans for bad credit

Anonymous said...

Its like you read my mind! You seem to know a lot about this, like you wrote the book in it
or something. I think that you can do with some pics to drive the message home a bit, but other than that, this is magnificent blog.

A fantastic read. I will definitely be back.


My page Be Bold When Trying These New Suggestions For Affiliate Marketing Online - Business.

Anonymous said...

My brother suggested I may like this web site.
He was totally right. This submit truly made
my day. You cann't consider just how much time I had spent for this information! Thank you!

Also visit my site travel all inclusive resorts

Anonymous said...

My developer is trying to convince me to move to .net from PHP.
I have always disliked the idea because of the expenses.
But he's tryiong none the less. I've been using Movable-type on several websites for about a year and am nervous about switching to another platform.
I have heard good things about blogengine.net. Is there a way I can import all my wordpress posts into it?
Any kind of help would be greatly appreciated!

Also visit my web site damenschuhe billig

Anonymous said...

Please let me know if you're looking for a author for your weblog. You have some really good posts and I believe I would be a good asset. If you ever want to take some of the load off, I'd really like to write some material for your blog in exchange for a
link back to mine. Please blast me an e-mail if interested.
Regards!

my blog: How To Make Money Through Clickbank

Anonymous said...

You can certainly see your enthusiasm within
the work you write. The sector hopes for even more
passionate writers such as you who are not afraid to say how they believe.

At all times follow your heart.

Also visit my webpage ... home Mortgage Refinance rates

Anonymous said...

This blog was... how do you say it? Relevant!!
Finally I have found something that helped me.
Appreciate it!

my webpage :: Bedingungen private krankenversicherung

Anonymous said...

What i do not understood is if truth be told how you're no longer actually a lot more well-preferred than you may be right now. You are so intelligent. You understand thus considerably relating to this matter, made me in my opinion imagine it from so many numerous angles. Its like women and men aren't fascinated until it's one thing to do with Woman gaga! Your personal stuffs nice. All the time maintain it up!

My web-site :: private krankenzusatzversicherung vergleich

Anonymous said...

I was able to find good information from your
articles.

My homepage; can i get a loan with bad credit

Anonymous said...

I do consider all the ideas you have offered for your post.
They're really convincing and can certainly work. Nonetheless, the posts are very quick for beginners. May just you please prolong them a bit from subsequent time? Thank you for the post.

Check out my web blog ... credite ohne schufa

Anonymous said...

When someone writes an paragraph he/she keeps the idea of a user
in his/her mind that how a user can know it. Thus that's why this article is outstdanding. Thanks!

Check out my web page; easy home loans for bad credit

Anonymous said...

You actually make it seem so easy with your presentation
but I find this topic to be actually something which I think I would
never understand. It seems too complex and extremely broad for
me. I am looking forward for your next post, I'll try to get the hang of it!

my homepage :: addsense

Anonymous said...

I love it when individuals come together and share opinions.
Great site, continue the good work!

my web blog house loans for bad credit

Anonymous said...

What's Going down i am new to this, I stumbled upon this I've discovered It positively useful and it has aided me out loads.
I hope to give a contribution & aid different users like its aided me.
Good job.

Also visit my web site - consolidation loans for credit cards