Home » Author Archives: Harsh Raval

Author Archives: Harsh Raval

Create new message notification pop up in Java

java-duke-logo

First create JFrame to work as pop up. Add some JLabels in it to contain information and assign them at proper location to look like a notification message. A sample code is given below: String message = 'You got a new notification message. Isn't it awesome to have such a notification message.'; String header = 'This is header of notification ...

Read More »

Useful Ant build tags

apache-ant-logo

Questions: How to do following tasks in ant file? Make zip file. Run command. Copy files to remote machine. Run commands on Remote Linux machine. Open an input box and respond to input value. Make an ant call. Answers: 1. Make zip file: Following is the xml for making zip file in ant: <zip destfile='${destination.folder}/zipName.zip'> <fileset dir= '${Source.folder}' /> </zip> ...

Read More »

Transparent JFrame using JNA

java-duke-logo

In Make JFrame transparent I had shown a way to making frame’s transparent using AWTUtilities class. But using that class results in access restriction compile time error, resolution in Eclipse is also shown in that post. Now here is the version using java natives. I have used Java Native Access (JNA) library to call native functions to get the things ...

Read More »

Make JFrame transparent

java-duke-logo

First create a frame that has a slider in it which will be used to set transparency amount. import javax.swing.JFrame; import javax.swing.JSlider; public class TransparentFrame extends JFrame { public TransparentFrame() { setTitle('Transparent Frame'); setSize(400,400); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JSlider slider = new JSlider(JSlider.HORIZONTAL); add(slider); setVisible(true); } public static void main(String[] args) { new TransparentFrame(); } } Output of this will be: Now add ...

Read More »

Gateway interaction in Smack API

jabber-logo

Gateway interaction is described by XEP-0100. The query xmlns (namespace) used for this is same as IN-Band registration, that is “jabber:iq:register”. Smack API provides an easy way handle gateway interaction with the server. It has predefined classes for the required namespace and operations which one can easily use and do the thing. In this article I will explain how one ...

Read More »

Simple REST client in Java

java-interview-questions-answers

Today most of the mobile applications that used to communicate to some server use REST services. These services are also common practice to use with JavaScript or jQuery. Right now I know 2 ways to create client for REST service in java and in this article I will try to demonstrate both the ways I know hoping that it will ...

Read More »

Android: File transfer with asmack and Openfire

ignite-realtime-openfire-logo

I have seen many peoples struggling from file transfer in asmack – Android build environment and patches for smack. I tried same library with Openfire server after some debugging got success in it. So I will like to share my problem and solution for it. I found that the problem is in Byte Stream host, it tries to connect to ...

Read More »

Chat bubble in Java Swing

java-duke-logo

This article will explain you “how to draw chat bubble in java swing application?” Chat bubble is same as call-out or thought bubble. Today most of the chat application is showing conversion in this format, so this article will help you to do the same in desktop application made in java swing. Following class is used to draw first chat ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close