JScrollPane - can you set scroll position?

I have a JList loaded into a JScrollPane, and I call a method that highlights a row of the JList, but I can't figure out how to get the JScrollPane to scroll down.
Is there a method where I can manually set the scroll position? I looked at the documentation online and didn't see anything like that.
Thanks.
-Mark

You need to get a reference to the JScrollPane's JViewport
myPane.getViewport();
Then on the viewport you can call one of these.
scrollRectToVisible(Rectangle contentRect)
setViewPosition(Point p)
Cheers,
Rachel

Similar Messages

  • Can you set the Duration of a Transition to instant? Or Remove a previous?

    Can you set the duration of a Transition to instant? (Rotate and Translate).
    Or if not, remove a previous transition done? (Reset the transitioned object back to its original). Ihave tried setting Duration.millus(.000001), but I can still see it translate/rotate. if I set it to zero, it doesn't do anything at all.
    Goal:
    I have a Connect4 type grid that Flips. It rotates upside down 180degrees, the pieces 'fall' down. Then I ACTUALLY flip the game board (not just effects) using a matrix calculation. But since my grid is upside down, my pieces appear upside down.
    So here is the method I was thinking:
    -Flip the board upside down
    -Translate the pieces down (gravity)
    -Actually flip the game board's internals and positions.
    -Undo the previous rotate/translate so the user thinks the 'animation' actually flipped the board.

    You cannot create an instant Transition. An Animation with a duration of 0ms is considered invalid and does not do anything when play() is called.
    Why do you have to use Transitions to set the values? They just modify Node properties over time, if you want to change the properties instantly, you can just access them directly. TranslateTransition modifies translateX, translateY, and translateZ, RotateTransition modifies rotate and rotationAxis.

  • Can you set up multiple user accounts on one laptop?

    can you set up multiple user accounts on one laptop?

    Of course.
    And instructions can depend on which OS X is installed.
    For v10.7 Lion > OS X Lion: Create a new user account
    For v10.8 Mountain Lion > OS X Mountain Lion: Create a new user account
    When you post for help, please state which OS X is installed.
    If you aren't sure, click About this Mac from your Apple menu 

  • Can you set up apple tv using 2 different itunes accounts from 2 different macs in same household?

    can you set up apple tv using 2 different itunes accounts from 2 different macs in same household?

    No, you can only connect to one Home Sharing account at a time. If you want to see the content of the other Mac's library you will have to turn off Home Sharing on the Apple TV and log back in with the other iTunes account.

  • How can you set up more than one device on iTunes. I have an iPad, iPod, itouch and iPhone. I don't want the same on all devices.

    How can you set up more than one device on iTunes? I have an iPad, iPod, itouch and iPhone. I don't want the same on all devices. I have all my music/videos on iTunes on my mac book pro. Can you set up separate folders for each device and drop in what ever music/videos from the main iTunes library?

    In itunes it is called syncing and you can choose exactly what content to sync to all devices and it can be different for all of them
    How to sync

  • Can you set up multiple Facebook users on 1 IPad 4?

    Can you set up multiple Facebook users(2) on one IPad 4?

    I think maybe on different users on one computer - but not on the same one.

  • Can you set up 2 iTunes accounts on one computer?

    Can you set up 2 iTunes accounts on one computer?

    I had two accounts on one computer until recently. You need to use two user accounts on the computer. Note, I say I did it until recently, therefore I'm not able to confirm this still works, but assume it does.

  • Can you set a second "Open with:" application for a file?

    Hi all,
    I was wondering if something like this exists for OS X Lion or greater: you can set a default application to open a type of file, say Safari for all .html files, but can you set a second default application for a file?
    I usually open files using command + o or command + down arrow from the Finder and I've often thought how good it would be to hit an alternate keyboard shortcut to open the selected file in a secondary default application.
    For example, if I'm making a web page and have the .html selected in the finder I can hit command + o (or command + down arrow) to open it in Safari and if the file isn't open in my editor and is selected in the Finder I can hit, say command + option + o (or command + option + down arrow) to open the .html file in my editor.
    Does anyone know if this can be achieved in OS X Lion or greater?
    Any advice is greatly appreciated.
    Thanks.

    Hi all,
    If anyone's interested in a partial solution, I've rigged up the following.
    I ended up using an Automator action coupled with Spark to capture a keyboard key combination. Spark: http://www.shadowlab.org/Software/spark
    I've used Spark before with good results, and although it's from 2008 it still works on Lion.
    I created an Automator action that does two things:
    gets the selected Finder items
    opens finder items in the text editor I'm using.
    I then saved the workflow as an application so that Spark could run it.
    I've set up a keyboard shortcut that Spark picks up and calls my Automator workflow. It all seems to work nicely.
    So, I've created a specific "open selected file with <text editor>" keyboard shortcut that should do for the time being.

  • Can you set a web page as a 'home page' on the i phone safari as you would?

    Can you set a home page or will the safari button always take you to the last web site you were on?

    You cannot set a Home Page in Safari but if you save your favorite bookmark to the home screen, you can use that to open the browser on iPhone.
    To do this:
    Open Safari and open the page you want for the "Home Page".
    Tap the "+" at the bottom of the screen and select "Save to Home Screen"
    You can then name it whatever you wish and tap Save.
    This will create an icon on the home screen that you can tap on to always open Safari to that page.

  • Can you set different colours for invitees in calendar?

    In calendar on the iphone/ipad can you set any events that you accept from invitees to a different colour so that you can instantly distinguish them from your own events?
    Cheers

    You could choose None in Preferences > General > New Mail Sound and set up a rule for each account in Preferences > Rules as follows:
    If [any/all] of the following conditions are met:
    [Account] [AccountName]
    Perform the following actions:
    [Play Sound] [Sound]
    Problem is, that would cause the sound to be played for junk mail as well — probably not what you want.

  • HT1677 Where can you set default in Safari to view as web page instead of Mobile Version?

    Where can you set the default setting in Safari to open page as web page instead of Mobile Version on iPad running iOS6.01?

    And, to make it even more fun, sometimes a website changes how it deals with Safari Mobile. A website that treated it like a desktop browser suddenly starts treating it like a cell phone. Just to mess with you. Or push an app.
    Best of luck.

  • In Initial View, can you set defaults for Navigation tab, Page layout, and Magnification?

    Adobe Acrobat 9 Pro V9.4.0
    Win7 Pro x64
    Problem: In Initial View, can you set defaults for Navigation tab, Page layout, and Magnification?
    Every time Acrobat scans a document, I have to go to Initial View to set Navigation tab, Page layout, and Magnification. It does not remember the settings I last used.
    Thanks in advance.

    See my response to this post

  • Can you set a project wide time limit?

    I know that you can set a time limit for each question, can you set a time limit for the entire project?

    That variable has really no sense. First of all, you have to create it and it will just be toggled when time is over. I think it is just taken over from the former Timer widget (Timer widget... to stress your learners - Captivate blog) where it had sense, because it didn't have the same functionality of jumping to a slide when time was over. Beware: the timing is not very accurate, it will start with a delay of about 1 second if you put it on the first slide (display for rest of project), and when time is over the message (you cannot escape from it) will display for 2 seconds. Had planned to blog about Timing/Hourglass interactions, but have too many plans that I didn't realize.

  • Can you set a song on repeat on iPhone 4s

    Can you set a song on repeat on iPhone 4s

    From the now playing screen, bring up the scrubber bar(tap the screen):
    A small icon that looks like two circular arrows is on the left side below the scrubbing bar. Tap this icon once to repeat the album. The icon will turn blue when repeat is activated. Tap the icon again to repeat the current song. The icon will change to show the number 1 inside a blue circle. Touch the icon a third time to cancel any repeat. The icon will turn white when it's deactivated.

  • How can you set the max row for a 'open cursor' in a stored proc?

    I would like to know how can you set the maximum amount of row returned in a resultset coming from a stored proc?
    You can do it via JDBC with cStatement.setMaxRows(10); but it works only for select that you do via JDBC...
    I would like the same functionality using open cursor inside a stored proc...
    Thanks...

    is "where ROWNUM <= 10" the equivalent of "cStatement.setMaxRows(10);" because the ROWNUM as problem with the ORDER BY clause and the setMaxRows() as no problem...

Maybe you are looking for

  • Printing from Quicken 2003 delux

    I just got the HP Officejet 6500 wireless. When I try to print checks from Quicken 2003 delux program, they are often in colors other than black or don't print at all with the error message about paper size anyone have any ideas what I am missing? Pr

  • Changing LOV's  table-field size

    Hi, I'm using Jdeveloper 11g. Knowing that the tag below is used in LOV, Now I need to know how to change the LOV's table-field sizes? (I'm using the model-based LOV, and it's reading the attributes from the view object) <af:inputListOfValues model="

  • Quit crippling this wonderful app.....thought it was slower, but it is actually faster.

    Each CS release has continously decreased the speed and perfomance of Photoshop. I've got 16 Cores and 32GB RAM and a scratch disk with R/W of 500+ MB/s CS6 is the slowest and most un-responsive version of PS I have ever used. And I believe I have be

  • Docu for 7.5 ::: installation and upgrade

    Hi, where can I find documentation for an upgrade from 7.0 to 7.5? ... and also for a new installation. Regards. Thx.

  • Problems with Nforce4 install - audio/ethernet/raid

    Just installed my Neo4 Platinum Nforce4 with XP Home SP2. I have a problem with the drivers. I went to the Nvidia site and download both the Unified Drivers and the standalone Kit for XP. The unified driver set didn't seem to do anything at all, it s