Hunt this blog

Wednesday, July 8, 2009

How to add a HyperlinkListener to a Java component

Using hypertext and hyperlinks in Java JFC/Swing applications makes them look more like web applications, and that's often a good thing. Here's a quick example of how to add a HyperlinkListener to a component in Java. In this case the component I'm going to use is a JEditorPane.

1. First, create JEditorPane, and place it on a container. I've created an object named
menuEditorPane that is a a JEditorPane
2. Next, set the content type of the JEditorPane to "text/html", like this:

menuEditorPane.setContentType("text/html");

3. Next, set the actual content of the JEditorPane. In my case I've done it in a
method, like this:

void setMenuItems()
{
StringBuffer sb = new StringBuffer();
sb.append("Do the foo action
");
sb.append("Do the bar thing
");
menuEditorPane.setText(sb.toString());
}

4. Import two needed classes, like this:

import javax.swing.event.HyperlinkListener;
import javax.swing.event.HyperlinkEvent;

5. Implement a HyperlinkListener, as shown below. Note that the text you get when you
look at e.getDescription() is the URL of the hyperlink.

class MenuPaneHyperlinkListener implements HyperlinkListener
{
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
StringTokenizer st = new StringTokenizer(e.getDescription(), " ");
if (st.hasMoreTokens()) {
String s = st.nextToken();
System.err.println("token: " + s);
}
}
}
}

6. Add your HyperlinkListener to the JEditorPane, like this:

menuEditorPane.addHyperlinkListener(new MenuPaneHyperlinkListener());

Sunday, July 5, 2009

How to train to become an efficient Motivational Speaker

Get a good tutor or guide - Get the guidance from a successful motivational speaker. With the proper guidance from a good guide, you can easily deal with aggravation, frustration, and confusion which can accompany you during speech delivery. Also the guide may teach you the thinks you must not do while preparing and making your motivational speech. Moreover, an experienced guide may provide you with strong suggestions.

You must be trained to choose an important problem or message as your speech topic - Choose to speak about a problem in your society. Try to give simple solutions for an important problem that you find in your society. Speak about what you know the best.

You must be trained to market your speech profession - Market your motivational speech business through fabulous promotional booklets such as brochures, testimonials, demos, referrals, and websites.

You must be trained to develop your speaking ability - You should develop your speaking ability through enough practice in order to become a great motivational speaker.

You must be trained to create an outline of your speech presentation - Create an outline of what you have to speak during a show. The outline you created for your speech can be used as a framework for your talk.

You must be trained to give visual presentations related with your speech topic - Most people can gain more information about your speech only through a visual presentation than a spoken one. Hence, it is very important to prepare and give visual presentations related with your speech topic.

You must be trained to overcome nervousness- When you forget what to say or when you get nervous in front of the audience, do not continue your speech. Instead, take a deep breath, and speak from your heart to give some of your truthful experiences. Do not worry about what the audience will think about you. But just focus on how you can satisfy your audience.

You must be trained to present your speech carefully - It is very important to speak legibly and clearly. Stress and repeat your main messages at least three to four times. Avoid using filler words such as uh, um, eh, etc. Do not give a long pause in between your speech. Do not bore your audience with your continuous speech. Instead make it a point to create a fun and lively environment.

You must be trained to notify your availability- You must notify not-for-profit corporations, professional groups and Contact speakers' bureaus of your availability as a motivational speaker. Some Contact speakers' bureaus may charge you to put your service under list.

You must be trained to present yourself smart before the audience - Dress up yourself such that you express professionalism and success. Business apparel is doubtlessly the best one for any motivational speech.

If you start your motivational speech career strongly under a good guidance and make certain that you are moving ahead in the right direction carefully, I am sure that you can enjoy the speech time and financial freedom as a successful motivational speaker.

What Is .NET...?

.NET


The .NET Framework is Microsoft's application development platform that enables developers to easily create Windows applications, web applications, and web services using a myriad of different programming languages, and without having to worry about low-level details like memory management and processor-specific instructions.

The Runtime

At the heart of .NET is the Common Language Runtime, commonly referred to as the CLR. The CLR is made up of a number of different parts, which I will be covering here piece by piece (if you didn't want a technical article then you should've followed the marketing link).

1. Language Independence

One of the most important facets of the .NET Framework is language independence. You can write .NET applications using any number of different programming languages. The most popular languages tend to be C# and VB.NET, but many other languages now have .NET versions including Python, COBOL, and more. You can see a list of many of the languages you can use with .NET over at dotnetpowered.com/languages.aspx.

Language independence is attained through the use of an intermediate language (IL). What this means is that instead of code being compiled in actual machine code (code that the CPU would run), it is instead compiled into a high-level generic language. This means that whatever language you write your code in, when you compile it with .NET it will become IL. Since all languages eventually get translated into the intermediate language, the runtime only has to worry about understanding and working with the intermediate language instead of the plethora of languages that you could actually use to write code.


2. Just-in-Time Compilation

If your mantra is, "Why do something now you can put off till tomorrow?" then you have something in common with the CLR. When you compile your code and it is translated to the intermediate language it is then simply stored in an assembly. When that assembly is used the CLR picks up that code and compiles it on-the-fly for the specific machine that is running the code. This means the runtime could compile the code differently based on what CPU or operating system the application is being run on. However, at this point the CLR doesn't compile everything in the assembly; it only compiles the individual method that is being invoked. This kind of on-the-fly compilation, referred to as jitting, only happens once per method call. The next time a method is called, no compilation occurs because the CLR has already compiled that code.

3. Memory Management

One of the constant assailants on productivity in unmanaged programming platforms is manually managing memory. Having to deal with memory management is also one of the largest sources for bugs and security holes in many applications. .NET removes the hassle of manually managing memory through the use of the aptly named garbage collector. Instead of the developer needing to remove objects from memory, the garbage collector looks at the current objects in memory and then decides which ones aren't needed anymore. For some developers this will be a tough pill to swallow; if you are used to managing memory then turning it over to an automated process can be somewhat troubling. This is when you have to take a step back, stop worrying, and embrace the runtime. There are bigger problems to solve (namely the business problems that are probably the real goal).


Alternative CLR Implementations

The .NET runtime is actually based on a standard developed by Microsoft called the CLI or Common Language Infrastructure, portions of which have been submitted to Ecma as an international standard. Because the CLR is based on an open standard, there have been a number of alternative CLR implementations, most notably Rotor and Mono. Rotor was a project from Microsoft Research, is a version of the CLR that will run on Mac OS, and is shared source. Mono is an independent open source implementation of the CLR that runs on various Linux distributions. While "Write once, run away" is not always realistic with .NET, there are some options available when it comes to other platforms. (Some code can be moved without issue, but most will require some tweaking, as different implementation includes different functionality.)


The Library

While the runtime is definitely the most important part of .NET, you can't do too much with it by itself. This is where the Base Class Library (or BCL) comes in. The BCL includes a lot of the plumbing of .NET, including the system types, IO, and functions for working with text. In addition to the BCL, there is the Framework Class Library (FCL). The FCL is an extended library that makes working with the .NET Framework practical and includes the following major pieces:

Apple's White 13-inch MacBook; What lies inside?

On 27 may 2009, Apple introduces its latest update of white MacBook called as MC240LL/A. It can be treated as the replacement to both the iBook and the 12-inch PowerBook.

New Features:

• Apple increases the speed of the laptop's Core 2 Duo processors from 2GHz to 2.13GHz and also increased the hard drive capacity from 120GB to 160GB, which can be expandable up to 500GB.

• The new MacBook now uses faster 800MHz DDR2 memory than its last iteration, which used 667MHz DDR2 RAM. The minimum operating system required for the laptop is Mac OS X Leopard 10.5.7.

• The white MacBook now meets Energy Star Version 5.0 requirements and is rated EPEAT Gold, compared to Silver rating on the previous model.

• The MacBook uses magnets instead of a physical latch to hold the lid closed.

• Graphics: nVidia GeForce 9400M using 256MB RAM.

• Dimensions: 1.08 x 12.78 x 8.92 in/27.5 x 325 x 227 mm.

• Weight: the laptop weighs around 5.0 lb/2.3 kg.

These updates amount to not only a better performing entry-level MacBook, but also a system that's faster than the 2.0GHz aluminum unibody MacBook that Apple sells for $200 more.

Apart from the changes from the aluminum MacBook, both systems have Core 2 Duo processors with 3MB of shared L2 cache, 8x DVD-burning SuperDrives, 160GB hard drives, and 2GB of RAM (expandable up to 4GB). Also, they sports glossy 13.3-inch LCD displays with 1280 x 800 pixel resolution, 1066MHz system buses and use Nvidia GeForce9400M graphics. The new device uses the older polycarbonate shell, has the older mini-DVI port and is the only current MacBook to include FireWire.

In addition there are two USB 2.0 ports, an integrated iSight camera above the screen. Networking options include 802.11g Wi-Fi, Gigabit Ethernet, and Bluetooth 2.0+EDR.

Performance:

After various tests, it is found that the new device is approximately 6.5% faster than the 2GHz white MacBook it replaces. The new model sports about an 8% speed up in Photoshop times and iTunes MP3 encoding scores. Cinema 4D was about 5% faster on the new white MacBook.

Battery life:

The US Apple store now advertises that the white 13-inch MacBook has 5 hrs of battery life up from a promised 4.5 hours. But with full brightness it could run for about three and half hours, which is about half-an-hour more than its predecessor.

Real Strength of Mind

Real Strength of Mind

Nick Vujicic, 26, was born without arms and legs, but nothing and nobody can stop this brave guy.
Despite the absence of limbs, he is doing surf and swimming, and playing golf and soccer. This is what it means to have the real strength of mind!

















Wednesday, July 1, 2009

The Y generation.........

The " Y " Generation :

People born between 1925 and 1945....Are called...
The Silent Generation

People born between 1946 and 1964...Are called....
The Baby Boomers

People born between 1965 and 1982...Are called....
Generation X.

People born after 1983...Are called....
Generation Y

BUT.........Y
Why do we call the last group of people...Generation Y ?
I had no idea until I saw this caricaturist' s explanation!
A picture is worth a thousand words!














The King of Pop is Dead !



King of Pop Michael Jackson is dead - official
Michael Jackson, the child star turned King of Pop who set the world dancing but whose musical genius was overshadowed by a bizarre lifestyle and sex scandals, died on Thursday. He was 50.
Jackson was pronounced dead at about 2:26 p.m. PDT (2126 GMT) after arriving at a Los Angeles hospital in full cardiac arrest, said Fred Corral of the Los Angeles County Coroner's office. The cause of death was not known and an autopsy would likely take place on Friday, he said.
Jackson's sudden death had been reported earlier by U.S. media, which said he was taken ill at his home and rushed to the hospital by paramedics who found him not breathing when they arrived.
Known as the "King of Pop," for hits that included "Thriller" and "Billie Jean," Jackson's dramatic, one-gloved stage presence and innovative dance moves were imitated by legions of fans around the world.
He transformed music videos and his lifetime record sales tally is believed to be around 750 million, which, added to the 13 Grammy Awards he received, made him one of the most successful entertainers of all time.
But Jackson's belief that "I am Peter Pan in my heart", his preference for the company of children, his friendship with a chimp, his high-pitched voice and numerous plastic surgeries also earned him critics and the nickname "Wacko Jacko."
Jackson, who had lived as a virtual recluse since his acquittal in 2005 on charges of child molestation, had been scheduled to launch a comeback tour from London next month.
Quincy Jones, who helped arrange the music on the album "Thriller" and produced the "Off the Wall" album, told MSNBC: "I am absolutely devastated at this tragic and unexpected news."
"For Michael to be taken away from us so suddenly at such a young age, I just don't have the words. I've lost my little brother today, and part of my soul has gone with him."



SOLD-OUT SHOWS
Jackson had been due to start a series of concerts in London on July 13 running until March 2010. The singer had been rehearsing in the Los Angeles area for the past two months. The shows for the 50 London concerts sold out within minutes of going on sale in March.
"Rarely has the world received a gift with the magnitude of artistry, talent, and vision as Michael Jackson," said Neil Portnow, president and CEO of The Recording Academy in a statement.
"He was a true musical icon whose identifiable voice, innovative dance moves, stunning musical versatility, and sheer star power carried him from childhood to worldwide acclaim."
There were concerns about Jackson's health in recent years but the promoters of the London shows, AEG Live, said in March that Jackson had passed a 4-1/2 hour physical examination with independent doctors.
Outside the hospital in Los Angeles about 200 fans and reporters gathered on Thursday, waiting for confirmation of Jackson's death or condition.
Some fans were crying and hugging each other, and others were climbing atop fences to get a better look at a microphone stand where a news conference was supposed to take place.
"I hope he's gone to God, and I hope that he's free of all the troubles he's been plagued with," Tonya Blazer, 50, who said she had been a fan going back more than four decades to his days as a child star.
"I just feel like I'm paying tribute to him," said Dawn Burgess, 42, a fan who said she had posters of Michael pinned to her bedroom wall when she was a child.





CHILD STAR TO MEGASTAR
Jackson was born on Aug. 29, 1958, in Gary, Indiana, the seventh of nine children. Five Jackson boys -- Jackie, Tito, Jermaine, Marlon and Michael -- first performed together at a talent show when Michael was 6. They walked off with first prize and went on to become a best-selling band, The Jackson Five, and then The Jackson 5.
Jackson made his first solo album in 1972, and released "Thriller" in 1982, which became a smash hit that yielded seven top-10 singles. The album sold 21 million copies in the United States and at least 27 million worldwide.
The next year, he unveiled his signature "moonwalk" dance move while performing "Billie Jean" during an NBC special.
In 1994, Jackson married Elvis Presley's only child, Lisa Marie, but the marriage ended in divorce in 1996. Jackson married Debbie Rowe the same year and had two children, before splitting in 1999. The couple never lived together.
Jackson has three children named Prince Michael I, Paris Michael and Prince Michael II, known for his brief public appearance when his father held him over the railing of a hotel balcony, causing widespread criticism.



New Yorkers and tourists in the city's Times Square were shocked at the news of Jackson's death.
"I don't know what to say. It's sad, it's really, really sad," said Nicole Smith, an 18-year-old student from Brooklyn, New York, in Times Square. "My mother was a fan. I listened to his music."
"I'm shocked. I thought someone was lying to me when I first heard it. I was a fan from when he was a little boy and then he got weird," said Sue Sheider, 51, a teacher from Long Island.
(Additional Reporting by Jill Serjeant in Los Angeles and Michelle Nichols in New York)



FACTBOX - Key facts about Michael Jackson

Michael Jackson, 50, one of pop music's biggest stars, was rushed to a Los Angeles-area hospital by paramedics who found him not breathing when they arrived at his home, the Los Angeles Times said, quoting fire officials. The TMZ website reported later he had died.
There was no official confirmation of the reported death, and spokesmen for Jackson could not be reached for comment.
Here are some key facts about Jackson.



EARLY LIFE:
* Jackson was born on Aug. 29, 1958, in Gary, Indiana, the seventh of nine children. Five Jackson boys -- Jackie, Tito, Jermaine, Marlon and Michael -- first performed together at a talent show when Michael was 6. They walked off with first prize.
* Their group later became The Jackson Five, and when it was signed by Motown Records in the late 1960s it underwent its final metamorphosis to become The Jackson 5. Jackson made his first solo album in 1972.

SUCCESS:
* Jackson released "Thriller" in 1982, which became a smash hit that yielded seven top-ten singles. The album sold 21 million copies in the United States and at least 27 million worldwide.
* The next year, he unveiled his signature "moonwalk" dance move while performing "Billie Jean" during an NBC special.
* Jackson's lifetime record sales tally is believed to be about 750 million, which, added to the 13 Grammy Awards he has received, makes him one of the most successful entertainers of all time.



ACCUSATIONS:
* In 1993, Jackson was accused of sexually abusing a 13-year-old boy, and police raided his California ranch "Neverland."
* The same year, Jackson announced he had become addicted to painkillers and abruptly canceled a world tour to promote his album, "Dangerous."
* He reached a settlement in 1994, later reported to be $23 million, with the family of the boy he was accused of abusing.

MARRIAGE & FAMILY:
* In 1994, Jackson married Elvis Presley's only child, Lisa Marie, but the marriage ended in divorce in 1996. Jackson married Debbie Rowe the same year and had two children, before splitting in 1999. The couple never lived together.
* Jackson has three children named Prince Michael I, Paris Michael and Prince Michael II, known for his brief public appearance when his father held him over the railing of a hotel balcony, causing widespread criticism.



MORE CONTROVERSY:
* A television documentary "Living with Michael Jackson" was aired in 2003, saying that Jackson still had sleepovers with young boys and had his third child with a surrogate mother. Jackson aired his own rebuttal.
* Jackson went on trial in 2005 on charges of molesting a 13-year-old boy in 2003, as well as conspiring to abduct the boy. The singer faced nearly 20 years in prison if convicted.
* The four-month trial ended in June 2005 with his being acquitted of all charges. Jackson has spent time in Bahrain, Ireland and France since the child molestation case ended.



COMEBACK?
* After several false dawns, Jackson and music promoter AEG Live announced he would perform 50 concerts at London's O2 Arena. Jackson had been due to start the concerts on July 13. Jackson had been rehearsing in the Los Angeles area for the London shows, which sold out within hours of within hours of going on sale in March.