Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Java
//this method gets Telephone number from a sipserver
public void telephoneNumbs(String numbers) {
        String replace = numbers.replace("sip:", "").trim().replace(".", ""); // Incoming Call Numbers from Sip UA
        if (!replace.isEmpty()) {
           List<TelephoneObj> telephons; 
            telTextField.setText(null); //init it with null
             costumDao = new CostumersDao(); // costumers DB 
             telephons = costumDao.getOrCompareTelfone(numbers);
               for (TelephoneObj tmp : telephons) {
                   System.out.println("Test: " + tmp.getTelephoneNums); // am getting exactle what i need here from my Database
                   //or 
                   JOptionPane.showMessageDialog(null,"incoming:"+ tmp.getTelephoneNums); // it show it during incoming calls
                   
                   //here is the problem. it wouldnt show the Value on the Textfield
                    telTextField.setText(tmp.getTelephoneNums); //try to push that Value(Telephone number) to show in JFXTextfield/it cold be any other Textfields
                    
               }
             
            
        }







What I have tried:

Hi, i am at the moment developing a Softphone with javafx. and i kind of a have problem capturing incoming call to a textfield. an example of my code is here.
an incoming call is with Joptionpane successful bt i had like to have the value appear in call textfield just like telephone.
Thank you.
Posted
Updated 24-Jun-18 0:28am
v2

1 solution

Sooo much happy today it went well with after 2days of thinking how to solve this miserable life of not taking time to think.
I finally got the answer by using Task to solve the problem.

Java
<pre>Task<Void> task = new Task<Void>() {
            {
                updateMessage("");
            }

            @Override
            public Void call() throws Exception {

                while (true) {
                    updateMessage(callee);
                    try {
                        Thread.sleep(100);
                    } catch (InterruptedException ex) {
                        break;
                    }
                }
                return null;
            }

        };

        //neuLabel.textProperty().bind(task.messageProperty());
        kdAddrTel.textProperty().bind(task.messageProperty());
        Thread th = new Thread(task);
        th.setDaemon(true);

        th.start();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900