how to keep the USB Interface open always untill the user exits or disconnects

In the below program I'm just trying to open the device using product id and vendor id. After claiming the handle the device will get opened...the problem is i can only write and read through USB only once after that USB interface will going to be end.....i just want the USB interface open until i give exit command from the program.

GUI class with write button

import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JButton;
import org.usb4java.DeviceHandle;
import org.usb4java.LibUsb;
import org.usb4java.LibUsbException;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class interfacegui {
    private JFrame frame;
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() { try {interfacegui window = new interfacegui();
                    window.frame.setVisible(true);
                } catch (Exception e) {e.printStackTrace();
                }}});
    }
    public interfacegui() { initialize();}
    private void initialize() {
        frame = new JFrame();
        frame.setBounds(100, 100, 450, 300);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().setLayout(null);
        JButton btnRead = new JButton("write");
        btnRead.addActionListener(new ActionListener() {
            ///when write button is pressed it will writ data into device  
            public void actionPerformed(ActionEvent arg0)
            {
                usbinterfacereadwrite a=new usbinterfacereadwrite();
                int result=LibUsb.init(null);
                if(result !=LibUsb.SUCCESS)
                {
                    throw new LibUsbException("Unable to initialize libusb", result);
                }
                else
                {                                                                                                                                                      
                    System.out.println("libusb initialised");
                }
                // Open test device 
                DeviceHandle handle = LibUsb.openDeviceWithVidPid(null, a.VENDOR_ID, a.PRODUCT_ID);
                if(handle==null)
                {
                    System.out.println("test device not found....");
                    System.exit(1);
                }
                else
                {
                    System.out.println("device found");
                }
                result =LibUsb.detachKernelDriver(handle, a.interfaceNum);
                if(result !=LibUsb.SUCCESS)
                {
                    throw new LibUsbException("Unable to claim interface", result);
                }
                a.write(handle,a.byteArr);
            }
        });
        btnRead.setBounds(43, 115, 117, 25);
        frame.getContentPane().add(btnRead);
    }
}



code with write function

import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import org.usb4java.BufferUtils;
import org.usb4java.DeviceHandle;
import org.usb4java.LibUsb;
import org.usb4java.LibUsbException;

public class usbinterfacereadwrite 
{
    static int[] d4={1,2,3,4,5,6,8,7,9,10};
    static final short VENDOR_ID = 0x03eb;
    static final short PRODUCT_ID = 0x6119;
    static final byte interfaceNum = 1;
    static final byte IN_ENDPOINT1 = (byte) 0x82;
    static final byte OUT_ENDPOINT1 = 0x01;
    static final int TIMEOUT = 5000;
    static String str = "PANKAJ";
    static byte[] byteArr = str.getBytes();
    static byte[] byteArr1 = d4.toString().getBytes();

    static void write(DeviceHandle handle, byte[] data1) 
    {
        System.out.println("datasize->"+byteArr.length);
        ByteBuffer b3=BufferUtils.allocateByteBuffer(data1.length);
        b3.put(data1);
        IntBuffer transferred = BufferUtils.allocateIntBuffer();
        int result = LibUsb.bulkTransfer(handle, OUT_ENDPOINT1, b3, transferred, TIMEOUT);
        if(result!=LibUsb.SUCCESS)
        {
            throw new LibUsbException("Unable to send data", result);
        }
        else
        {
            System.out.println(transferred.get() + "-->str bytes sent to device");
        }
    }
}