Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Scroll pane problem

 
Peter Phung
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rajendar Goud
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Try this..
textArea = new JTextArea(5, 30);
JScrollPane scrollPane = new JScrollPane(textArea);
contentPane.setPreferredSize(new Dimension(400, 100));
contentPane.add(scrollPane, BorderLayout.CENTER);

Raj
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic