Sunday, April 27, 2008

My Timer Label Swing Component

For sometime I wanted to create a swing component and for some business issues I wanted to calculate time I worked to calculate my payments. So I created a program that counts time in milliseconds. Then I wanted to create the same program with more features and thought if some other programs may need such component. Here comes the idea of extending Java Swing JLabel component to have the time counter then use it whenever possible and distribute it for other developers.

You can download the component from the link: http://www.4shared.com/file/45525258/ea7339d0/TimerLabel.html

NetBeans is recommended for development. You can add the component by adding it to the palette of swing by using the palette manager the "Add from jar" and select my jar file which contains TimerLabel class which represents the component.

The component contains three main functions:
  • start(): which starts the timer.
  • pause(): pause the running timer.
  • reset() resets the timer to zero state.
you can find further documentation in doc folder.

Wednesday, April 16, 2008

Slow Linux Internet? Here is a solution

Some distribution such as Debian etch enable IPv6 by default (I don't know why to use IPv6 now). This may cause the internet connection to slow down as the system searches for IPv6 first and most of internet connections uses IPv4 (which is the appropriate one).

To fix this problem you need to edit file /etc/modprobe.d/aliases to disable IPv6 support. Edit the file and search for the line:

alias net-pf-10 ipv6
and edit it to be:
alias net-pf-10 off #ipv6

Then reboot your machine to enable new settings and enjoy flawless speed.