How do I set the vertical scroll bar to be displayed all the time?

This is a part of program I coded:
TreeNode root = makeNBATree();
DefaultTreeModel model = new DefaultTreeModel(root);
tree = new JTree(model);
JPanel p = new JPanel();
p.setLayout(new GridLayout(1, 0));
JScrollPane sp = new JScrollPane(tree,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER,
     ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
sp.setPreferredSize(new Dimension(500, 500));
p.add(sp);
contentPane.add(p, "Center");
when I compiled and ran the program, it said
Exception in thread"main" java.lang.IllegalArgumentException: invalid verticalScrollBarPolicy
at javax.swing.JScrollPane.setVerticalScrollBarPolicy(Unknown Source)
at javax.swing.JScrollPane.<init>(Unknown Sourc)
at NBATreeFrame.<init>(NBATree.java:59)
at NBATree.main(NBATree.java:239)
I would like to know is there any part I coded wrong?

Take a look at the API again:
JScrollPane(Component view, int verticalPolicy, int horizontalPolicy)
You have:
JScrollPane(Component view, int Horizontal, int Vertical)

Similar Messages

  • In FF 4.0 why does the down arrow no longer function in the vertical scroll bar?

    Prior to FF 4.0 when I positioned my cursor over the down arrow of the vertical scroll bar in Hotmail and depressed the left mouse button, the scroll bar moved downward toward the bottom of it's column limit. Now in 4.0 it turns into an adjustment cursor forcing me to readjust the size of the Hotmail window rather than moving the scroll bar down the column. This only seems to happen in Hotmail.

    Check: http://kb.mozillazine.org/Website_colors_are_wrong
    See:
    * http://kb.mozillazine.org/Images_or_animations_do_not_load
    * You can see the permissions for the domain in the current tab in Tools > Page Info > Permissions
    * You can see all exceptions in Tools > Options > Content: Load Images > Exceptions
    * You can check the Tools > Page Info > Media tab for blocked images (scroll through all the images)
    There are also extensions (Tools > Add-ons > Extensions) that can block images.

  • How can I widen the vertical scroll bar width in Firefox and Thunderbird?

    How can I widen the vertical scroll bar width in Firefox and Thunderbird?

    Hello,
    Try disabling graphics hardware acceleration. Since this feature was added to Firefox, it has gradually improved, but there still are a few glitches.
    You might need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    Then perform these steps:
    *Click the orange Firefox button at the top left, then select the "Options" button, or, if there is no Firefox button at the top, go to Tools > Options.
    *In the Firefox options window click the ''Advanced'' tab, then select "General".
    *In the settings list, you should find the ''Use hardware acceleration when available'' checkbox. Uncheck this checkbox.
    *Now, restart Firefox and see if the problems persist.
    Additionally, please check for updates for your graphics driver by following the steps mentioned in the following Knowledge base articles:
    * [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]
    * [[Upgrade your graphics drivers to use hardware acceleration and WebGL]]
    Did this fix your problems? Please report back to us!
    Thank you.

  • The Vertical scroll bar in itunes is missing

    I have a Windows 8 computer with iTunes 11.0 
    I was using iTunes yesterday when suddenly the vertical scroll bar disappeared.
    I don't know how it went away or how to get it back.
    Can someone please tell me how to get it back?
    HELP

    I found it, there's a system preference that allows showing them always!

  • At times when dragging the vertical scroll bar my computer screen oscillates up and down for some time before going blank or not responding to any clicks requiring a forced system restart. What is wrong?

    Hi,
    Suddenly while working with Firefox if I happen to drag the vertical scroll bar, a very abnormal behavior occurs. My screen dances up and down for a short time before either going black or getting restored but with no clicks working. The only way to resume is to force a restart of the system.
    Any help would be deeply appreciated.
    Thanks and Regards
    Deepak

    That didn't work. On trying to install a new driver I got the error the graphics driver could not find compatible graphics hardware. Is there anything else that can be done to at least prevent the hanging of the computer even if it means less features from Firefox being available?

  • Adobe Reader move the vertical scroll bar from left to right

    Hi,
    is it possible to move the vertical scroll bar from left to right in Adobe Reader 9?
    If not, are you planning to implement this functionality?

    I meant from right to left, sorry
    You see, I'm left handed and when I use the scroll bar that is on the right side with the left hand I don't actually see the content of the page, because my left hand is covering the screen (I'm browsing the internet in tablet mode and I use the pen to navigate between pages).
    My system is a Tablet PC with Windows XP Tablet Edition 2005 and Adobe Reader 9.3.2.
    P.S. can you edit my post so the google indexes it right? (
    from right to left
    instead of "from left to right")

  • Removing the Vertical scroll bar from the content area.

    Hello,
    Is there a way to remove the vertical scroll bar from the content area?
    I am trying to create a new light portal frame work.
    Everything works fine except that I see two vertical scroll bars, one from the content area and another from the page(frame).
    Thanks in advance.
    -Sudheer

    Hi
    There are a couple of ways in which to achieve this
    1) Try and make the content flat. What I mean by this is that the content area (when using the standard light framework) doesn't contain an iframe, meaning that the iview defined on the page has "EMBEDDED" isolation mode. This should mean that you only have one scrollbar (if the content extends past the size of the browser)
    2) If you need to make the iview URL isolation, then try and get the domain of the content to be of a similar domain to your portal server, i.e. your portal is portal.company.com and the content is content.company.com. In this way you can make the pages expand.
    NOTE: One thing to note is that when using URL isolation iviews doesn't allow the automatic expanding of the iframe content. This is because the standard javascript doesn't allow this. Therefore you may have to write your own javascript function (or content area page) to do this
    I hope this helps
    Darrell

  • When I open gmail, I cannot use the vertical scroll bar.

    When I use the gmail website on firefox, the vertical scroll bar. As there is no horizontal scroll bar on the website, the vertical scroll bar layers over the top of the page resizer and makes the arrow button for the scroll unusable.
    Please advise.

    you may be connected to the wireless network but the question is the internet working properly on the wireless network...
    what i mean is that i can make a wireless network without the internet so i can save and share files and have other devices connected to the same network access them... but you have to make sure that your internet it running properly... may have to reconfigure the router is your using PPPOE or if it was working prior to your post then try to restart your modem... that usually resolves most issues.

  • Electronic noise is emitted from my computer when manually dragging the vertical scroll bar with hardware accleration enabled, but no noise is emitted when scrolling any other way (ie hyperscroll via mouse wheel).

    [Firefox 4.0]
    When I use my mouse button to hold and drag the vertical scrolling bar, my computer emits a soft grainy sound. However, when I hyper scroll with my mouse wheel, there is no noise.
    I do not get the quiet noise with Internet Explorer. I did not get this with previous versions of Firefox.
    Turning hardware acceleration off resolved this.
    I'm running Windows 7 with a dedicated graphics card (GTX 285).

    Quote
    amd 64=12a @12V
    ati 9800=7.5~10.5a @12V (assuming 90~125 watts) a max load,
    a 9600 ir nvida 5200 used far less power
    so your already at 18a with no fan,s no hd, no cd,no dvd ,no mobo chipset , no mem, no sound..etc
    If you exclude the motherboard, memory, etc like you did there, the amd 64 draws 7.2A @ 12V.
    90~125W for an ATI 9800?! [irony]Are you working for a PSU manufacturer or what?[/irony] That's just absurd.  
    Go read this post to get a feel for the actual power consumption: https://forum-en.msi.com/index.php?postid=297061&sid=#post297061

  • On every website, my right vertical scroll bar is missing and all of my Toolbar bookmarks unless I minimize the window, click "view" and "full page." How do i get it back to NORMAL?

    When I hit "full page" the right vertical scroll bar re-appears, but my bookmark toolbars, my bing bar, and pretty much the entire top 2 inches of my screen disappears. When all of these things are showing, the right vertical scroll bar disappears, and the entire webpage shifts to the right, so I can't see most of the right side of the page. How do I fix this?

    Welcome to Safari 6 with:
        .   .  t  .   .  a  .   .  b  .   .  s  .   . 
    That are the size of tractor-trailer trucks!
    There is no known way to get them smaller except when you get a lot they will "shrink-to-fit".

  • How can I get the vertical scroll bar in firefox for mac to operate more smoothly?

    This scroll bar issue has been a real pain for awhile, though it seemed to be better for a period of time and now has grown much worse again. I'm using Firefox 22.0. I try to grasp the blue scroll bar (right side placement) to move it up or down for pages that require scrolling to view, and it is very hard to hold and move the bar, plus it often bogs down as the colored wheel shows up as if the software is trying to process the action. It's very frustrating. I'm set to "smooth scrolling" in the Firefox settings, but that doesn't help. Is there a way to fix this and make the scroll bar move quickly and smoothly in Firefox for Mac?

    Hello,
    Try disabling graphics hardware acceleration. Since this feature was added to Firefox, it has gradually improved, but there still are a few glitches.
    You might need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    Then perform these steps:
    *Click the orange Firefox button at the top left, then select the "Options" button, or, if there is no Firefox button at the top, go to Tools > Options.
    *In the Firefox options window click the ''Advanced'' tab, then select "General".
    *In the settings list, you should find the ''Use hardware acceleration when available'' checkbox. Uncheck this checkbox.
    *Now, restart Firefox and see if the problems persist.
    Additionally, please check for updates for your graphics driver by following the steps mentioned in the following Knowledge base articles:
    * [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]
    * [[Upgrade your graphics drivers to use hardware acceleration and WebGL]]
    Did this fix your problems? Please report back to us!
    Thank you.

  • How to get rid of vertical scroll bar in ABAP webdynpro table

    Hello,
    I have created a dynamic WD table using cl_wd_dynamic_tool=>create_table_from_node and then I restricted the number of lines to 1 by setting the 'Set_Row_Count' and 'Set_Visible_Row_Count' = 1. But still when I run the application I see a vertical scroll bar which looks very awkward for only 1 line. How do I get rid of this vertical scroll bar ?
    Thanks and Regards,
    Sandhya

    Hi,
    Is your table under any transparent container. have you set any scroll mode for this.
    One more thing, have you used SER SCROLLABLE COL COUNT property.Also is this property set firstVisibleScrollableCol.
    Regards,
    Lekha.
    Edited by: Lekha on Oct 28, 2009 11:18 AM

  • JScrollPane: Can the Vertical Scroll Bar go on the left?

    Hope you can help,
    Im using a JScrollPane within another one, i.e, I have a component inside a JScrollPane, and one of its components is a JScrollPane. This is fine and dandy, but the internal scrolled component gets pretty tall and wide, so people end up using the OUTER horizontal scroll bar to scroll to the INNER vertical scrollbar to scroll DOWN the inner component.
    What would be really nice would be to have the INNER scrolled component to have its scroll bar on the LEFT to save the above hassle.
    Is this possible with JScrolledPane?

    In JScrollPane (jdk1.3)
    public void setComponentOrientation(ComponentOrientation co)
    Sets the orientation for the vertical and horizontal scrollbars as determined by the ComponentOrientation argument.
    Parameters:
    co - one of the following values:
    java.awt.ComponentOrientation.LEFT_TO_RIGHT
    java.awt.ComponentOrientation.RIGHT_TO_LEFT
    java.awt.ComponentOrientation.UNKNOWN

  • Vertical scroll bar disappears when I minimize the screen

    I have Firefox 10.0.2. I do have a vertical scroll bar with both the up and down button; however, they all disappear when I minimize the screen. When I am in Ancestry, for example, when I minimize I get a horizontal scroll bar but there is no vertical scroll bar. I have no clue what to do. I minimize screens a lot when I am in Ancestry and it gets very frustrating. Can anyone help?

    Hi,
    Please check if this happens in [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode].
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [http://support.mozilla.com/en-US/kb/Uninstalling+add-ons Uninstalling Add-ons]
    [http://kb.mozillazine.org/Uninstalling_toolbars Uninstalling Toolbars]
    Safe mode disables the installed '''Extensions''', and themes ('''Appearance''') in '''Tools''' ('''Alt''' + '''T''') > '''Add-ons'''. Hardware acceleration is also temporarily disabled - the manual setting is '''Tools''' > '''Options''' > '''Advanced''' > '''General''' > '''Use hardware acceleration when available'''. [https://support.mozilla.org/en-US/kb/Options%20window%20-%20Advanced%20panel?as=u Options > Advanced]. All these settings/add-ons can also be individually or collectively disabled/enabled/changed in Firefox normal mode to check if an extension, theme or hardware acceleration is causing issues.
    If the problem persists, you can also try disabling the '''Plugins''' in Tools > Add-ons temporarily to check.

  • Some new pages open without a vertical scroll bar...even tho the page is very long.

    It only happens with one particular vendors website. They can't explain it. Most of their web pages work fine.
    I selected an imbedded link from one page and a new browswer window opens and populates but there is no left margin vertical scroll bar. And there is lots of data below to view. CAnt get there from here.
    Damon

    Can you share the link to the page?
    Does it make any difference if you change the zoom level, such as by holding down Ctrl and tapping the + key or the - key a couple of times?
    New windows opened by a script can be customized by leaving out some elements. Presumably if they were doing that, they would know. However, just in case, you could prevent sites from removing the scrollbars from popup windows.
    (1) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the search box that appears above the list, type or paste '''window_o''' and pause while the list is filtered
    (3) Double-click the '''dom.disable_window_open_feature.scrollbars''' preference to switch it from false to true.
    (The name of this preference is difficult to understand, but it means that Firefox will block the site from turning off scrollbars on a new window if set to true.)

Maybe you are looking for

  • How to create a "next" button out of image

    Hi all. I'm new to Dreamweaver and have no idea what I'm doing!  I'm a designer and not familiar with code. I've managed to get this far: I've created a teamplate and am using it successfully on subsequent pages.  My snag is that I want to create a "

  • Sort order in list wrong: in CAML and in view

    Hello, When I order my list with document sets by ID, the order is wrong. It is wrong in the list and with caml. This is my view (I just set the sort on the ID column): The first 4 objects are created by the Client Object Model; the last 4 are create

  • Penalizing long term customers for keeping their unlimited data plan is unwise an business

    Dear Verizon President and Employees, I have spoken to three Verizon employees via the phone today who have failed to be able to tell me why I should stay with Verizon. You see I have a very small portion of my plan that is unlimited data, I have it

  • ORA-01000: maximum open cursors exceeded in R12

    Hi, In which Middle Tier log we see "ORA-01000: maximum open cursors exceeded" error, we have EBS R12 version.

  • Proper use of undefined

    Proper use of undefined Leslie:  I bet you have an answer for this one... I am on version 6.0.7.1 (1961) My goal is to check and see if a dictionary is not present because its permission was accidently set to NONE. When I use this ISF nothing happens