Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Can't show scrollpane (Read 1947 times)
Tima
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 25
Joined: Nov 10th, 2010
Can't show scrollpane
Nov 11th, 2010 at 5:41am
Print Post  
scrPane = new JScrollPane(diagView);
       scrPane.setAutoscrolls(true);
      System.out.println("milestone second");
      panelSc=new JPanel();
      add(panelSc,BorderLayout.CENTER);
      panelSc.add(scrPane,BorderLayout.CENTER);

Its cant show scroll pane..
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Can't show scrollpane
Reply #1 - Nov 11th, 2010 at 8:11am
Print Post  
If the child element is added with BorderLayout.CENTER parameter, you should also pass a BorderLayout instance to the JPanel constructor (the default is FlowLayout):

panelSc=new JPanel(new BorderLayout());

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Tima
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 25
Joined: Nov 10th, 2010
Can't show scrollpane
Reply #2 - Nov 11th, 2010 at 9:33am
Print Post  
Thnx its Working..
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint