29
Sep

Blink your image in Java  

Posted by Fast Fire Fish in ,

Ever need to make an image blink continuously to signal for some kind of incoming activity? Well....I'm going to share a simple sample on how to do that.



import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Image;
import java.awt.image.BufferedImage;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JLayeredPane;


public class BlinkingLabel extends JLabel implements Runnable{

private boolean show=false,blink=true;
private Icon iconImg;
private JLayeredPane parent;

public BlinkingLabel(Icon icon, JLayeredPane pane)
{
super(icon);
this.iconImg = icon;
this.parent = pane;

this.setVisible(true);
new Thread(this).start();

}

public void run() {
while (blink) {
show=!show;

if(show)
parent.moveToFront(this);
else
parent.moveToBack(this);

repaint();
try { Thread.sleep(400); } catch (Exception e) { }
}
}

public boolean isBlink() {
return blink;
}

public void setBlink(boolean blink) {
this.blink = blink;
}

}

The concept of this BlinkingLabel class is to pass in a secondary image along with another JLayeredPane object which is the main container for the original image. That is to say we are actually making use of the 2 images one of which shows the original state and the other is actually the lighted up state. Upon instantiating an object with this class, the secondary image will be toggled on and off with a variable of 400 milliseconds. You can tweak this setting if you wish it to be faster or slower.


Of course this is just one of the ways to make an image blink repeatedly. I'm sure there are other methods like overriding the paintComponent method or something.

If you've enjoyed this article, drop me a comment!


Bookmark this post:
StumpleUpon Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

25
Sep

How to insert a Custom RSS Icon  

Posted by Fast Fire Fish in

I was meddling with some of the blog sites and I saw they have this customized RSS icon at some corner of the site. I thought to myself ...why not? If you are close follower of my blog, you would have noticed the addition of the black cowboy hat that lingers at the top right corner of my blog site. On it is a signature RSS logo which was tied to this white ribbon around the hat. So.... for those of you who shares the same thought for the moment, I'm going to provide a guide on how to add that personal touch to that site of yours.


GUIDE

Step 1
Firstly you got to get a custom RSS icon which at least you fancy. If you got no idea where to get it, you could try here.


Step 2 
 Look around your site's template design to source for a suitable location for the placement of the custom rss logo.


Step 3

Upload the picture to some online photo hosting sites like photobucket. Create an account if you do not have one, upload the picture and get the URL which points directly to the image. (Eg. http://myrsslogo.jpg)


Step 4

Use the following code block to insert the image link in your desired location. Insert the URL of the picture where you uploaded in Step 3, and replace the code at "YOUR IMAGE URL" with the URL you've got.



<a href="YOUR FEED ADDRESS URL" target="_blank">
<img src="YOUR IMAGE URL" border="0" />
</a>

Also remember to link your rss logo image to your feed address URL which should be replace at "YOUR FEED ADDRESS URL".

You should see your custom logo up and running. Congrats!! IF your logo is in a odd shape like mine, you might want to customized the hyperlink to the shape of your image. That way, your hyperlink only works within the shape of the image. I used Microsoft Frontpage to generate the what you call the "Image Map" that bounds the region of the hyperlink.

Read More...


Bookmark this post:
StumpleUpon Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

22
Sep

Hello!!!!!!!!!!!! Firefox Lovers...  

Posted by Fast Fire Fish in

I assume you are at least a little bit curious about what I have to share about this add-on. Yes it is an add-on. U heard me. Alright let's spill the beans. Straight to the point.

 QUESTION
But whats the hit about this one in a million add-on?



Let's take a sneak...how about browsing images like this....

Cooliris Snap


Read More...


Bookmark this post:
StumpleUpon Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

21
Sep

Don't you just love Nintendo Wii?  

Posted by Fast Fire Fish in ,

Don't you just love what technology has changed our lives? Maybe not all, but most of it, I do. For those gamers out there, specifically Nintendo Wii lovers or owners, are u really sure you know what appears to be packed and hidden in
Nintendo Wii? Well... let's find out!



Pretty impressive if you asked me. Well who stole the limelight this time? It appears that the big guy(Nintendo Wii console) is not real deal after all. It is the REMOTE that allows such a high end solution to be available at a cheap cost.

This video was sort of inspiration too as people's thoughts' are often bounded by the box. Sometimes we just got to think of out of usual and make miracles happen. Easier said than done I know, but don't give up, one day it might be your turn.


Bookmark this post:
StumpleUpon Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

18
Sep

Can't wake up early? Yes u can!!!  

Posted by Fast Fire Fish in

Waking up early either for work, during your weekends or even during your free time can be a challenge for most people. At least for me. Maybe its just me, however, during the days that I do actually manage to get my lazy bum off the bed EARLY, indeed I will feel fresher and also be more competent in carrying out task. Some may nod their head and agrees with what I have to say. Sounds good but hard to do? Maybe the tips that I'm going to share will have a life impact on the rest of our life. If you really wanna become an early riser, READ ON!



Early Riser Step 1: Stop blaming yourself.
Stop giving excuses of why u can't do it. Don't blame it on your genes, health, the things you ate last night or whatever u can think of!? It has nothing to do with why u need more sleep!

Early Riser Step 2: Get plenty of fresh air.
The first thing you have to do when you wake up is to breathe in fresh air! Stop going back to your bed for 1 more minute of lazing around and go for fresh air instead!

Early Riser Step 3: Don't eat before you sleep.
The last thing that goes to your mouth should be 3 hours before you sleep.

Early Riser Step 4: Don't use the snooze button.
According to research, it is harder to wake up after using your snooze button than waking up when the alarm first goes off!

Early Riser Step 5: Put flowers in your bedroom.
It has been proven that people who woke up sleeping in a room full of flowers seem to be happier? (I'm gonna pass on this one :p)

Early Riser Step 6: Brighten up your walls.
Bright wall colors has been proven to activate energy cells!

Early Riser Step 7: Stretch.
Give your body 5-15 minutes of stretching, it might work wonders for u.

Early Riser Step 8: Start the day with a smile.
The physical act of smiling actually produces endorphins which in fact gives you energy and drive. So smile your day away! (*Important* Be careful to do it discretely or people might steer clear from u!)

That's a quickie! I'm not saying I have done all that...but err....lets just say we all work hard together to achieve a more healthier life.

Taken from: How to become an Early Riser


Read More...


Bookmark this post:
StumpleUpon Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

17
Sep

The Top Commentators Widget for Blogger  

Posted by Fast Fire Fish in

Today I've added another new widget to my sidebars. As the title suggest, yes it is called the "Top Commentator" widget. I guess it is pretty self explanatory from the look of the name. Though it is not the first widget I've added to my list, I thought I should start sharing my widgets with the rest of the community.

WHY THIS WIDGET?



The reason why I recommend this widget is that it provides ease of adding it to blogger and I thought it will be great to recognize and appreciate your readers.



Read More...


Bookmark this post:
StumpleUpon Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

16
Sep

Create your own media player with Java Media Framework(JMF)  

Posted by Fast Fire Fish in ,

For those who are working with Java, you might be interested with Java's capability of playing media files with its Java Media Framework(JMF). Today I'm going to share a simple guide to get this working.

Steps

1)Get the installation software from Sun's website here.

2)You might need to restart your machine as one of my friends had this problem and it was resolved after that.

3)Copy and paste the code from here

4)If you do not have a sample mpeg file, you might want to download it here. Save the file to some location in your harddisk and remember where u save it.

5)Compile and launch the code with assuming you already have the standard jdk package installed. Select the mpeg file from the location where it is stored and it should start the video playing.

That's it! I hope I made it simpler if you are looking for a crash course.
For a more detailed explanation of the codes, I believe the source has already explained in great detail.


Bookmark this post:
StumpleUpon Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

10
Sep

Hate your iTunes? Maybe you should hack it......  

Posted by Fast Fire Fish in

Hey its been a while since my last entry. But anyway I was toying around with my iTunes. I know its not such a great player and there are tons of more fantastic players out there. The reason I started using it is because I had an ipod mini back and thought iTunes would "probably" be the best man to interface with the syncing of songs. I'm not a fussy person when it comes to media song player so just stick on for the sake of familiarity.

TODAY, I'm going to share with you a hack on iTunes. Guess it always started with the problem huh?

Problem: How do I delete duplicated songs in bulk?

Read More...


Bookmark this post:
StumpleUpon Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

03
Sep

Ready, Aim, SHOOT!  

Posted by Fast Fire Fish in

What's the first thing on your mind? Hopefully not something out of the way :p. U know what I'm talkin about. Well finally after years of yearning to own a my very own digital camera(camera phone's not counted), I finally brought myself to do it at the Singapore's very own "Comex IT Fair"! Of course not wholeheartedly as I was "forced"(in a good way) to buy something so as to claim back part of the cost. Thats beside the case.

I'm going to showcase some of my opening shots here which I have taken very unprofessionally. I didn't even start reading my user manual before I took the shots as I was unable to withstand the temptation of my Fujifilm Finepix F50fd. I won't even go into why I bought this camera and not others and the fact is that it is not according to planned. Enough said: here's my unprofessional random shots....brace yourself and enjoy(hopefully).



Read More...


Bookmark this post:
StumpleUpon Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

01
Sep

Drink Driving or Drink Flying?  

Posted by Fast Fire Fish in

Whats wrong with super heros nowadays. It seems that they r breaking the laws more than helping out. Don't get what I'm sayin..? See for yourself!




Ouch! ***BUSTED***


Bookmark this post:
StumpleUpon Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

01
Sep

Ever desire to create your own graffiti?  

Posted by Fast Fire Fish in

How you wish you could create those fanciful graffitis that you see on the walls of some god forsaken alleys. Well...if you do, this website provides you a decent tools to get things going just a little bit closer....erm except on the walls of course. I find that the tools and sprays are pretty realistic in a sense that if you hold on to the spray button, the paint will appear getting denser on the targeted area of impact. Below is an image created by one of my friends from the very website that I am recommending u today.




Can you guess what he is drawing? He is trying to mimic a portrait of "The Crow".
Have a go, try it! Who knows you might have some hidden talent within :P

Graffiti Customizer!


Bookmark this post:
StumpleUpon Ma.gnolia DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google

Your Ad Here