This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help.. please  RSS feed

 
Sajee Joseph
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Im developing a chat applet.
In this i have a 'Reciever TextPane', a 'Sender TextArea' and a send button. Obviously 'Reciever TextPane' will be bigger(taller) than 'Reciever TextPane' .Now i have put a JSplitPane between the 'Reciever TextPane' and 'Sender TextArea'.Since i have added the split pane to the content pane as
splitPane.setLeftComponent( receiveScrollPane );
splitPane.setRightComponent( sendScrollPane );
savepanel.add(splitPane,BorderLayout.CENTER);
now by default my 'Reciever TextPane' is smaller than 'Sender TextArea'. But i want the Reciever pane top be bigger.I tried setDividerLocation(int), but it was of no help. My code is given below. Please try out the code given below and help me out

ps:
While posting such long source code, please use the [ code ] opening and closing tages (without the spaces). I truly will appreciate your cooperation. It make code readable with proper indentation.
- satya


[This message has been edited by Madhav Lakkapragada (edited July 30, 2001).]
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sajee,
Can't run your code but make sure you are giving your JTextPane a preferredSize. The JSplitPane will give it a preferredSize if one is not specified. Since you probably are specifying a size (rows vs columns) for your JTextArea it gets the preferential treatment. By giving your JTextPane some preferredSize you should be able to make it work better.
Regards,
Manfred.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!