in Education by
I have a JTextField and need to have 3 lines in it, such as these: HI MY name is mehdi How can I set the text in a JTextField? I tried \n, but it didn't work. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
1 : JTextField does not support multiline. what you want is a JTextArea 2 : Newlines aren't the same on all systems, you might have to use "\r\n" if you are running Windows. Since Java 7, there is System.LineSeparator to solve this issue. (see the Oracle documentation)

Related questions

0 votes
    How do I detect the combination key Shift+Tab in a JTextField? JavaScript questions and answers, JavaScript ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I have a very long query. I would like to split it in several lines in Python. A way to do it in JavaScript ... '\ 'def_id=' + def_id Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Sometimes I break long conditions in ifs onto several lines. The most obvious way to do this is: if (cond1 ... an alternative way? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    What is a multi-member constituency? Please answer the above question....
asked Aug 3, 2022 in Education by JackTerrance
0 votes
    State whether the following statement are true or false with reasons. Post-1991 can be called ‘the Era of Multi polarity’. Select the correct answer from above options...
asked Aug 3, 2022 in Education by JackTerrance
0 votes
    Complete the concept map. Organizations reflecting multi polarity Select the correct answer from above options...
asked Aug 3, 2022 in Education by JackTerrance
0 votes
    I'm using VB code created by L42 on 4/27/14 that creates a checkbox list in a single cell. ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 11, 2022 in Education by JackTerrance
0 votes
    i have this problem that i want to upload image on a server through multi-part form but its keep ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    I want making multi-bluetooth from Android studio. I found multi-bluetooth java code libraries. but I am ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    i have this problem that i want to upload image on a server through multi-part form but its keep ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 19, 2022 in Education by JackTerrance
0 votes
    Is it possible to create a complete SD image in linux without having root privileges (that is, no loopback ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    Description: I have a solution in Visual Studio which has multiple projects as application layers. Business Logic ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    Description: I have a solution in Visual Studio which has multiple projects as application layers. Business Logic ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 14, 2022 in Education by JackTerrance
0 votes
    I'm currently working on a project converting some training materials from one e-learning system to another, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    Having two thread, one product data, another one process data. The data is not just an int or float but a complex object. In ... = buffer; //mutex.unlock(); if(!tmp.data) std::cout...
asked Apr 9, 2022 in Education by JackTerrance
...