473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Simple: Changing scroller size on JScrollPane?

TheMan1
19
Hi guys. I have a mouse event on my frame that enlarges the size of a JPanel that in on a JScrollPane. When the JPanel's size changes, the JScrollPane's scrollbars don't "refresh" ie. their max values don't get bigger, so you can't scroll to see rest of the entire bigger JPanel anymore.

Any ideas? I'm not asking to change the physical size of the scrollbars, I want to change the max values (at least that's what I think you'd call it) of the scrollbars, so you can scroll more.

Thanks.

I've tried using JScrollPane.getHorizontalScrollbar().setMaximum(), and setting it to the new width value of the JPanel after is has been enlarged, but that doesn't work... Am I missing a refresh call or something?
Oct 4 '08 #1
1 4513
JosAH
11,448 Expert 8TB
A JScrollPane just manages a JViewport and that view port doesn't psychically
know that its view has changed, you have to tell it that. The setView() method
tells it to change its view and your JScrollPane gives you access to its view
port. Do the simple math and update your components when you've resized
your JPanel.

kind regards,

Jos
Oct 4 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: syed_saqib_ali | last post by:
Please take a look at and run the code snippet shown below. It creates a canvas with vertical & Horizontal scroll-bars. If you shrink the window to smaller than the area of the canvas, the...
1
by: Marios Varnava | last post by:
Hello people, I have some tables in my database that are taking much space with little data in them, so i need to change their size. ex. TableA -> Size 5MB, Data Size 100KB TableB -> Size 5MB,...
4
by: Kenny | last post by:
I have been trying to write a script that will increase the size of and image when you mouse over it, and decrease it to original size, when you mouse out. After a couple of attempts, this is what...
2
by: pablo | last post by:
Dear NGers, I want to keep some images just left of some DIVs. But a change in text size leaves my images at the original position. Which event is generated by changing the text size from the...
2
by: Anurag | last post by:
This simple one beats me all ends up(sincerely). I have been doing DB2 UDB for some time now, reading a lot of good discussions in this forum, writing some answers, asking a lot more but this...
2
by: Dave | last post by:
Is there a way to enlarge the text cursor? We need to make it a bit wider to improve visibility and we cannot find any information about this. Many, MANY thanks in advance!
8
by: Boni | last post by:
Dear all, imagine this is scroll bar. Min|-------------|scroller|---------|Max The position of scroller is set with Value. How do I change the width of scroller? Thank you in advance, Boni
1
by: Kasey | last post by:
How do you change the row height in a data grid - I do not want to increase the height by changing my font size. My product is a touch screen so I have to make the row height large enought for a...
1
by: jobs | last post by:
I have a simple login page with roughly a 300px x 300px image behind the asp.net login control. I need the login control to land in the middle of the image. I want both the image and the login...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.