Saturday, November 14, 2009

Google Presents Go Language

Go Language is a new programming language produced by Google. The FAQ section of its website says that it compiles faster than other languages. It supports garbage collection and has ability to handle concurrency.

The only problem I see is that it currently does not support Windows-based system. It's a good thing that I'm running in Ubuntu so I could give it a try. :)

Maybe this will become more popular in the future since Google is behind it. For all the people interested, you could visit their home page by clicking here. It has different how-to's to help you get started.

Cheers!

Wednesday, November 11, 2009

Turning on the Java Web Start Console

If you are working on a Java Web Start Project. It will really be useful if you could see the console. This will help you to easily find bugs or see logs in your code as it is running.

To enable the console in your system whenever a Java Web Start Application is running you just need to follow these steps. These steps are applicable regardless whether your machine is running on Ubuntu or Windows.
  1. Open a Terminal if you are using Ubuntu (or any Unix-based system). If you are running on Windows, you need to fire up the command prompt.
  2. Once it is running, type in: javaws -viewer and press Enter.
  3. The Java Control Panel will then appear in your system.
  4. Navigate to Advanced Tab.
  5. Under Settings > Java Console, just select the Show console option.
  6. Click on the Apply  button.
The next time you open a Java Web Start Application, the console will appear. You will be able to see if there are exceptions or logs in your project.

Sunday, November 8, 2009

JTextField, JColorChooser, JTextPane

Lately, I've been assigned a module of the system our team is currently developing. This part of the system uses Java Swing. One of the tasks I had to do concerns asking the user to choose a color and assigning this to the user's profile. Being a Java Swing Noob, I had to research everything first.

I found out that using JColorChooser is an easy way to let the user pick a color he wants.
All you have to do is to call a static method which opens a dialog and returns the color the user chooses.

Then after this, I wanted to have a JTextField with a background which will change together with the color the user chose. Now, I tried using

textField.setbackground();
and
textField.setForeground();

and found out that only the text color will change and not the background inside the JTextField. So, I did a few more searches and found out that a good alternative for this is a JTextPane.

You could check out the following links to help you get started:
JFileChooser
JTextPane

Sunday, September 6, 2009

Installing windows installers in Ubuntu

I've been wanting to install some windows application in my Ubuntu System. While I was browsing through some sites, I found out that you can actually do this by installing the Wine application in your local machine.

The Wine application will allow you to install and use some of the Windows applications in your system. To do this, you need to:
  1. Navigate to System > Administration > Synaptic Package Manager
  2. Search for the wine application.
  3. Mark this all for installation, then Install.
Once this has been installed, you can then browse the net for some windows installer files. To use wine on this file:

  1. Right click on the windows installer file and choose, 'Open with "Wine Windows Program Loader"'.
  2. Follow the usual wizard to install it in your system.
Once the program has been successfully installed, you can then navigate to Applications > Wine > Programs and choose the application you've installed.

I tried it out with Firefox and it worked like a charm. Perhaps, you can use this with other popular windows application. If this doesn't work, you can always opt for a VM instead.

Friday, July 31, 2009

Installing Groovy in Ubuntu

Groovy is a programming language built on top of Java. With all the fuss about it, I decided to try installing it in my local machine. I'm currently running on Ubuntu 9.04 (Jaunty Jackalope).

I found out that there is an easier way of installing Groovy in Ubuntu which will save you from all the trouble of setting up the user variable and system path by simply typing in a one-line command in the terminal.

These are the steps to get Groovy running on your Ubuntu system:
  1. Go to Applications > Accessories > Terminal.
  2. On the terminal, type in this command.
    sudo apt-get install groovy
  3. You will then be asked for the admin password before your system starts the command. Click enter.
  4. Your system will then ask for your permission if you are willing to allot the needed memory space before it proceeds. Type in 'Y' then press enter.

Once you say yes to this, it will then begin installing Groovy on your machine.

To check if it has been properly installed, type in 'groovy -version' in your terminal. The groovy version currently installed in your system will be shown.

You can now start exploring Groovy.

Tuesday, September 23, 2008

JavaScript Triggering Events

I found out that you could create an event and fire it up on one of your elements in HTML. It does seem possible because of DOM but it just didn't cross my mind until one of my team mates suggested that I do this instead, to save me some maintenance problem in the future. It took me some time before I got to one useful article that I could read to do this work.

Things you need to do:
You have to create a variable which will hold the Event that you need to trigger. (These events include clicking a button, or pressing a key in the keyboard and more.)
Then you just have to dispatch this event on one of your HTML elements. It's pretty simple actually, but like what I've said, it took me some time to find a suitable article.

For a more detailed discussion on this, I suggest that you visit this article-DOM Events. This article helped me loads so hope it helps you. :D

Saturday, September 13, 2008

Play .rmvb file in Ubuntu :D

My friend lended me this series. The problem was, the files in the cd are .rmvb's. Since the only player that I have is the default player for Ubuntu which is Movie Player (and it doesn't have any available codecs to play rmvb files) I had to google for another suitable player to do the job.

I was able to click my way to this wonderful tutorial - Simple Help.

I wasn't able to make it work by just following the tutorial. I had to browse through the comments. So guys, if following the tutorial isn't working for you try looking in the comments 'cause it might help :)
 
Free Hit Counter