1
Answer

How to paste text to other window's active textbox

Sami Jildeh

Sami Jildeh

8y
212
1
Hi all,
I am doing a clipboard manager and i need to add a function to direct paste text to other window's active textbox.
By this: I make the form on top and when i double click on the listview item (i show the items in a listview) i need it to paste the text in it to the selected textbox in the other window.
 
Can anyone help me please.
 
Thanks 
Answers (1)
0
Vulpes
NA 98.3k 1.5m 12y
Try this:

import java.io.*;
import java.util.*;

public class Catalin
{
   public static void main(String[] args)
   {
       ArrayList<Integer> sumsList = new ArrayList<Integer>();

       try
       {
          BufferedReader br = new BufferedReader(new FileReader("catalin.txt"));
          String line;

          while ((line = br.readLine()) != null) 
          {
             String[] items = line.split(";");
             int number = Integer.parseInt(items[1]);
             int number2 = Integer.parseInt(items[2]);
             sumsList.add(number + number2);
          }

          br.close();
       }
       catch(IOException e)
       {
          System.out.println("I/O Error : " + e);
       }
       
       // convert ArrayList<Integer> to int[]
       int[] sumsArray = new int[sumsList.size()];
       for(int i = 0; i < sumsArray.length; i++) sumsArray[i] = sumsList.get(i);

       System.out.println("Line Sum");
       System.out.println("---- ---");

       for(int i = 0; i < sumsArray.length; i++)
       { 
          System.out.println((i + 1) + "     " + sumsArray[i]);
       }
   }
}