I am adding a scroll pane of textArea to a JPanel. And this JPanel is added to another Panel where I can have a tablepanel(a component)
Its like a panel consisting of tablepanel and JPanel .
Can you help me with this?
I am not able to resize the panel / scroll pane (by dragging the edge of scroll pane, so that I can see the whole decription(when its abundant) of property without using scroll bars.)
Code :
private JPanel createPanel() { final JTextArea textArea = getNewTextArea(); //gets text area of properties description. Dynamically changes // when upon selection of particular property textArea.setBackground(Color.GREY); textArea.setRows(4); textArea.setText("Description of property set here."); final JScrollPane scrollPane = new JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setPreferredSize(new Dimension(600, 60)); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.add(scrollPane, BorderLayout.CENTER); panel.setPreferredSize(new Dimension(50, 40)); panel.setVisible(true);
Wonderful! Its working fine. I can use certain layout managers as per my application requirement. Thank you very much. [ October 02, 2006: Message edited by: Raja Sekhara ]
Seriously Rick? Seriously? You might as well just read this tiny ad:
Gift giving made easy with the permaculture playing cards