This week's book giveaways are in the Refactoring and Agile forums. We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line! See this thread and this one for details.
How do i make a scroll pane a specified size? i've created a JTextArea and have placed it in a scrollpane. However, when the textarea and scrollpane is displayed it appears smaller than i want it? Here's the code i have :
I'd appreciate any help that anyone can offer.
Pete<br />"Reality is an illusion <br />brought on by a lack of <br />drink, drugs and smut"
posted 14 years ago
Hi, Try this.. textArea = new JTextArea(5, 30); JScrollPane scrollPane = new JScrollPane(textArea); contentPane.setPreferredSize(new Dimension(400, 100)); contentPane.add(scrollPane, BorderLayout.CENTER);