Posts Tagged ‘how to’

The resource is not on the build path of a java project eclipse

May 11, 2012

Hi everyone,

I have moved this post to my new blog site. Click here to get to the post.

Thank you.

Regards,
Manohar Bhattarai (मनोहर भट्टराई)

Ubuntu 12.04 on Virtualbox pae error – “Unable to boot – please use a kernel appropriate for your CPU”

May 5, 2012

Hi everyone,

I have moved this post to my new blog site. Click here to get to the post.

Thank you.

Regards,
Manohar Bhattarai (मनोहर भट्टराई)

How to Create Translucent and Shaped Windows in java.

September 4, 2011

Hi all,

I am back after a long time. This time I want to tell you all how I set a window as translucent in java. It was a very cumbersome thing to do before recently. From JDK 6 update 10, java has this facility to set the window as translucent  and its very easy.

Recently I did this in one of my projects and wanted to share it with you all.

As of the Java Platform, Standard Edition 6 (Java SE 6) Update 10 release, we can add translucent and shaped windows to our Swing applications.

The translucent and shaped window API was first added to the Java SE 6 Update 10 release as a private API. This functionality was moved to the public AWT package in the JDK 7 release.

Here is an example :

import java.awt.*;
import javax.swing.*;
import static java.awt.GraphicsDevice.WindowTranslucency.*;

public class MyWindow extends JFrame {
    public MyWindow() {
        super("MyWindow");
        setLayout(new GridBagLayout());

        setSize(300,200);
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        add(new JButton("Just a Button"));
    }

    public static void main(String[] args) {
        // Determine if the GraphicsDevice supports translucency.
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
 GraphicsDevice gd = ge.getDefaultScreenDevice();

        //If translucent windows aren't supported, exit.
        if (!gd.isWindowTranslucencySupported(TRANSLUCENT)) { 
 System.err.println( "Translucency is not supported"); 
 System.exit(0); 
 }

        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                MyWindow tw = new MyWindow();

		// Set the window to 55% opaque (45% translucent).
                tw.setOpacity(0.55f);

		// Display the window.
		tw.setVisible(true);
	    }
        });
    }
}

To learn more please check this link.

 

Here is how you can select which methods to use according to your JDK version.

 


Regards,
Manohar Bhattarai (मनोहर भट्टराई)
http://about.me/manoharbhattarai
http://www.facebook.com/pages/Manohar-Bhattarai/130973796914160
Blogs:
http://manoharbhattarai.wordpress.com/
http://manoharbhattarai.posterous.com/
http://manoharbhattarai.blogspot.com/
Microblogs:
Twitter :- http://twitter.com/mhrbhattarai
Identi.ca :- http://identi.ca/manoharbhattarai

How to add spring capabilities to Eclipse IDE using SpringSource Tool Suite from the Release Update Site

July 9, 2011

Hi everyone,

I have moved this post to my new blog site. Click here to get to the post.

 

Regards,
Manohar Bhattarai (मनोहर भट्टराई)

Remove question mark and add your own icon to the ubuntu 11.04 natty narwhal unity launcher

June 28, 2011

Hi everyone,

I have moved this post to my new blog site. Click here to get to the post.

Thank you.

Regards,
Manohar Bhattarai (मनोहर भट्टराई)

How to Create an executable JAR file

April 7, 2011

Hi everyone,

I have moved this post to my new blog site. Click here to get to the post.

Thank you.

Regards,
Manohar Bhattarai (मनोहर भट्टराई) 

Add xfce or KDE Desktop environment to ubuntu

November 28, 2010

Hi all,

If you want to add xfce/KDE desktop environment to your Ubuntu(Gnome), that can be done  using following steps-

1. Go to System->Administration->Synaptic Package Manager.

2. Click search and write xubuntu-desktop/kubuntu-desktop and search.

3. Check Mark for installation and then click Apply

This will install xubuntu-desktop/kubuntu-desktop to your Ubuntu system.

To login to xfce or KDE environment change the session on the main Log-on screen.

I have three desktop environments(Gnome(default), xfce and KDE) on my Ubuntu 8.04 system.

Enjoy all environment. :)

 

Regards,

Manohar Bhattarai

http://about.me/manoharbhattarai

 

Execute java program in ubuntu from terminal

September 23, 2010

Hi everyone,

I have moved this post to my new blog site. Click here to get to the post.

Thank you.

Regards,
Manohar Bhattarai (मनोहर भट्टराई) 

Echofon 1.9.6.6 is not working on FF 3.6.8 Ubuntu customized version

September 6, 2010

Hi all,

Recently i updated echofon addon for firefox and it stopped working on my FF 3.6.8 showing an error message. I was unable to use echofon. So today i found a solution and it is working again. Actually it is not solution for recent updated version.

To solve this problem i installed the old version of echofon again and it is working fine now.

Here is the link ==> https://addons.mozilla.org/en-US/firefox/addon/5081/eula/88620?src=version-history

Hope it helps those having similar problem.

Regards,

Manohar Bharttarai

http://manoharbhattarai.com.np/

How to Install Chromium (Google Chrome) web browser in Ubuntu

May 24, 2010

Hi,

Here is how we can install google chrome (chromium) web browser in Ubuntu. It is an open-source browser project that is safer, faster, and more stable.

1) First you need to edit the /etc/apt/sources.list file

manohar@manohar-desktop:~$ sudo gedit /etc/apt/sources.list

2) Add one of the following

a) For ubuntu 9.10 (Karmic) Users add the following two lines

deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main

deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main

b) For ubuntu 9.04 (Jaunty) Users add the following two lines

deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu jaunty main

deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu jaunty main

c) For ubuntu 8.10 (Intrepid) Users add the following two lines

deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu intrepid main

deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu intrepid main

3) Save and exit the file

4) Now add the GPG key using the following command

manohar@manohar-desktop:~$ sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 0xfbef0d696de1c72ba5a835fe5a9bf3bb4e5e17b5

5) Update the source list using the following command

manohar@manohar-desktop:~$ sudo apt-get update

6) Install chromium using the following command

manohar@manohar-desktop:~$ sudo apt-get install chromium-browser

This blog written with the help from different sites. Thank you all.

Regards,

Manohar Bhattarai


Follow

Get every new post delivered to your Inbox.

Join 342 other followers

%d bloggers like this: