N
N
nano_e_t_42016-11-30 23:44:19
Java
nano_e_t_4, 2016-11-30 23:44:19

How to limit a text field?

Hello everyone
, there is a text field JTextArea("bla", 5,5);
but the problem is that when placed on the panel, this field takes up all the free space. That is, for example, I expose the elements on the panel along the y axis. First a button, so a label, then a 5*5 size field. Duck here the field as a result turns out much more than ordered. I am using borderLayout.
hosting code is:

bla = new JTextArea("bla",5, 5);
        bla.setLineWrap(true);
        bla.setWrapStyleWord(true);
        JScrollPane blaPane = new JScrollPane(myMessages);
        JPanel pan = new JPanel();
       pan.add(bla);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question