Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: John Cooper   on Jul 11 In Java Category.

  
Question Answered By: Brian Ross   on Jul 11

Your GPanelWithText class  should not extend from JScrollPane, rather it should
extend from JTextArea and should be inserted inside of a JScrollPane, like so:

GPanelWithText gPanel = new GPanelWithText();
frame.getContentPane().add(new JScrollPane(gPanel));

You can still configure the scroll pane if you want, i.e.:

GPanelWithText gPanel = new GPanelWithText();
JScrollPane scrollPane = new JScrollPane(gPanel);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
frame.getContentPane().add(scrollPane);

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Why cant I see my JTextArea? Or get search suggestion and latest updates.


Tagged: