473,320 Members | 1,952 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,320 software developers and data experts.

Jscrollpane; update scrollbars

I have a Jscrollpane, holding a Jpanel on which I draw. Now, I have made buttons to zoom in and out. They will simply change the value of variables that hold the size of my Jpanel and the drawing on my Jpanel, and then resize the panel and redraw.

When I zoom in, the scrollbars don't update itself, unless I grab a border of my Jframe, and resize the window. How do I get the scrollbars of the Jscrollpane to update?
Oct 25 '08 #1
2 7742
JosAH
11,448 Expert 8TB
a JScollPane has a JViewPort component which has your JPanel as its (single)
member component. When you change your component you have to tell your
JViewPort about that event. (JViewPort.setView(Component c)). The change will
propagate all the way up to the JScrollPane and the scroll bars will be updated.

kind regards,

Jos
Oct 25 '08 #2
Thanks! Exactly what I needed.
Oct 25 '08 #3

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

Similar topics

0
by: hiwa | last post by:
When we put a lengthy line-wrapped String in a not-so-large JTextArea which is enclosed in a JScrollPane, it automatically scrolls down to the end of the string. That is, the string is displayed...
0
by: ManConfusedByMouse | last post by:
Hi all, I AM HAVING PROBLEMS UNDERSTANDING THE UPDATING BEHAVIOR/TIMING OF A WINDOWS.FORMS.SCROLLBAR COMPONENT... quick apology for my sorry posterior if posting in wrong place -- haven't much...
1
by: 123456prakash | last post by:
Does anyone know if it is possible to set programmatically the position of a JScrollPane vertical scrollbar slider? I load a some components like textfield editorpane labels etc into a panel...
0
by: madumm | last post by:
Hi all; How can i set a Background Image to this JScrollPane? JLabel imageLabel; JScrollPane jsp = new JScrollPane(imageLabel); Pls need your sugessions... Thanking in advance Madumm
2
by: blackraven1425 | last post by:
It displays the information off the left of the screen instead of in a line. Any ideas? I'll post the code here too. I know it returns nothing at the moment, it's a work in progress. public...
3
by: blackraven1425 | last post by:
I've been having trouble implementing a JScrollPane. Nothing shows up inside the JScrollPane but the other component (an exit button) shows up below it like it should. Can anyone help me resolve this...
1
TheMan1
by: TheMan1 | last post by:
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...
4
by: chanshaw | last post by:
I'm trying to add a verticle scroll bar to my scrollPane so it can go up and down the list as needed what sort of lines do I need to add to get this to work. private void refreshScrollPane(int...
6
BSCode266
by: BSCode266 | last post by:
Hey everyone, I'll cut right to the case. I have a JPanel and i call setLayout(null) on it. Simply because I would like to position everything myself and haven't seen a handy manager yet. Now i...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.