Java JFrame change Icon

I have learn about GUI programming using java this week. I have created a simple window (using JFrame) and get the default icon in titlebar is a default java icon. But, I dont like this default icon image and want to change with another image.

This is a complete code how to change JFrame icon image

This is the Program Window result after JFrame change the icon

jframechangeiconDownload the complete source code how JFrame change the icon below.

Source code :

Manifest merger failed Attribute application icon

I have created code in android without problem. But, when I added new external library, I get error message like this :

This error related with my external library have icon setting and conflict with my icon program. We can solve this problem with editing AndroidManifest.xml file. My original contents of this file like this :

after modified :

This method solve my problem related with Manifest merger failed Attribute application icon.

Button Android text automatic forced to All Caps

I have created a simple button in Android and set a Text to this button. But, I get result all text in my Button become All Capitals.

Solve this problem (Button Android text automatic forced to All Caps) is very simple. We can set “setTransformationMethod” to ignore automatic convert our text in Android Button become all Capitals. Add this code below your button :

Hope this tips can help to prevent our text in Android Button become All Capitals.

Source :

Android show alert window with button

I am learn about android programming in my free time. I am planned to create a simple alert window with a button. We can use AlertDialog class to create android alert window in Android. The sample output using this class as like picture below.

Android_alert_windowI have created a simple function how to create Android alert window using AlertDialog class. Please check this subroutine :

We can give parameter to this Android alert window subroutine to give same result like picture above using command :

I hope this simple subroutine can give you more explaining about how to create alert window in Android.