File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes scrollpane problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "scrollpane problem " Watch "scrollpane problem " New topic
Author

scrollpane problem

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 688

i m making an editor, which has one panel , which inturn has labels which contains the line number and the editor is with frame
the problem is when i reachs end of the line surely editor goes up (similar when you type at the end and scrollpane allows you to view the text at the bottom of your editor)
my problem is line numbers label doesnt go in upward (though it is in scrollpane)
for eg
line number max goes to 35 then the screen finishes after that when i press enter editor scrolls down but this number panel doesnt scrolls down
i guess this will give you a better idea...what is going wrong


The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1076
    
  10

You have set a very small preferred size for the lineNumber panel. Usually, when the size available for the component is larger than the preferred size, the scrollpane doesn't show the scrollbars. So, either change the height of the linenumberpanel or set the preferred size for the scrollpane itself instead of the panel.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 688

Ranganathan Kaliyur Mannar wrote:You have set a very small preferred size for the lineNumber panel. Usually, when the size available for the component is larger than the preferred size, the scrollpane doesn't show the scrollbars. So, either change the height of the linenumberpanel or set the preferred size for the scrollpane itself instead of the panel.

resolved
 
Consider Paul's rocket mass heater.
 
subject: scrollpane problem
 
Similar Threads
Spreading out JLabels in a panel
how to add scrollpane for a jpanel with null layout manager.
JFrame won't repaint...
Need some basic swing help....
NullPointerException