Here is a piece of code:

super("Бухгалтерия"); setLayout(null); JTextArea.setBounds(450, 50, 300, 460); JTextArea.setFont(font); JTextArea.setEditable(false); add(JTextArea); 

Help me figure out how to scroll down. Tried to do so:

 JScrollPane jScrollPane = new JScrollPane(); getContentPane().add(jScrollPane, BorderLayout.CENTER); ScrollPane.setViewportView(JTextArea); 

After that, JTextArea disappears altogether.

    1 answer 1

    Something like this

    super ("Accounting"); txtArea = new JTextArea (); //txtArea.setFont(font); //txtArea.setEditable(false);

     JScrollPane jScrollPane = new JScrollPane(txtArea); jScrollPane.setPreferredSize(new Dimension(400, 300)); jScrollPane.setViewportView(txtArea); jScrollPane.setBounds(450, 50, 300, 460); jScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); JPanel panel = new JPanel(); panel.add(jScrollPane); getContentPane().add(panel, BorderLayout.SOUTH); 
    • Unfortunately it did not work, the super ("Accounting") field is still not visible; setLayout (null); JTextArea.setBounds (280, 50, 470, 460); JTextArea.setFont (font); JTextArea.setEditable (false); After that, I inserted your code, it did not work - Andrew