JScrollPane  - scroll bar not visible

I'm writing a graphical chat application where the user presses buttons to insert images into their message. The buttons reside in a JPanel with a GridLayout. As i have more buttons than can be physically seen on the screen I'm trying to use a JScrollPane encapsulated in the JPanel so that the user can scroll down the button list to select appropriate symbols. The problem i'm having is that the scroll bars do not appear so the user can only use symbols which are visible. Here is the code for what i'm trying to acheive.
buttonPanel.setLayout(new GridLayout(9,3));
buttonPanel.add(Button1);
buttonPanel.add(Button2);
buttonPanel.add(Button3);
buttonPanel.add(Button4);
.....etc to around Button100
buttonHolder.add(new JScrollPane());
buttonHolder.setPreferredSize(new Dimension(400,400));
buttonHolder.setMaximumSize(new Dimension(400,400));I think I'm missing something from the add JScrollPane bit but I'm not sure what exactly!
PLEASE HELP - this is for my third year dissertation and is the last bit I need to do before it is finished.

First, you need to add your panel to the JScrollPane object. Then you add the JScrollPane object to the frame, not the panel itself.
As for setting the scrollbars of the JScrollPane, you could try setVerticalScrollbarPolicy() and setHorzontalScrollbarPolicy().

Similar Messages

  • Scroll Bar Not Visible

    New look utilizes a dark gray scroll bar on a black background. Older monitors (non HD) do not show it at all and tablet PC can't be viewed in sunlight. Really Spotify you didnlt think about making it a more contrasting color.

    tutimm - NOW WE NEED JESUS CHRIST involved to get a scroll bar we can see?!!!! lol....this is terrible customer service. they should beta test this stuff omggggggggggosh. SOMEBODY gave SOMEBODY all artsy and crap WAY TOO MUCH power in this decision. And it's taken OVER A YEAR TO FIX because it costs too much or not enough people complaining.  It functionally works and they don't realize HOW MANY TIMES I GIVE UP and just kill the SPOTIFY session out of frustration... I can't see to add a song to a certain playlist because HEAVEN HELP ME I have to find the scroll.  so.....options?   Clearly complaining here is NOT helping.  So, seems we can always  UNINSTALL   and gripe on the way out.  That's my next plan if this continues.  Software without customer service won't survive.  And there's plenty of other software NOT tied to facebook-google-yahoo-government tracking software ...  They read these blogs looking for pitfalls they can avoid and can use Spotify's faults to springboard off of for a marketing campaign.  Not hard to figure where this is heading.

  • Dynamic scroll bar not visible

    I created my text in a text file (saved as testtext.txt),
    then in Flash I added a dynamic text box (instance name: testtext)
    and dragged a scrollbar component (instance name: ttscroll) onto
    it. I then added this action script to the first frame:
    ttscroll._visible = (testtext.maxscroll >1);
    loadVariables("testtext.txt", this);
    The text shows up fine, and scrolls if I put my mouse in the
    text box and drag down. However, the scroll bar doesn't show up.
    How do I get this to work?
    Thanks.
    PS Due to company policies I'm not allowed to download and
    install anything, so I have to stick with what comes with Flash, so
    please don't recommend I download someone else's scrollbar.

    My first guess is that you are testing for maxScroll before
    the text is
    actually loaded, so the test result is false.
    You could use a listener for the loading function and let the
    listener's
    onLoadInit() event set the scrollbar.
    Another option is to use a textArea component. It has an
    automatic
    scrollbar.
    Rob
    Rob Dillon
    Adobe Community Expert
    http://www.ddg-designs.com
    412.243.9119

  • The Horizontal & vertical scroll is not visible or not working when i run the form in Forms 6i.

    Hi all,
    The Horizontal & vertical scroll is not visible or not working when i run the form.
    In this form , there are 5 canvas namely
    CANVAS2 - Stacked Canvas
    PASS - Content Canvas
    MAT_RATES - Content Canvas
    DATE - Content Canvas
    PREVIOUS - Content Canvas
    I have set "Show Horizontal Scroll Bar" to "Yes" and  "Show Vertical Scroll Bar" to "Yes" in the WINDOW Property.
    I have  set "Show Horizontal Scroll Bar" to "Yes" and  "Show Vertical Scroll Bar" to "Yes" in the STACKED CANVAS Property .
    But still the Horizontal and Vertical Scroll Bar is not working when i run the Form.
    Help me with this please. How do i make it visible??
    Oracle Forms 6i..
    Thank You.

    Vijetha wrote:
    Hi all,
    The Horizontal & vertical scroll is not visible or not working when i run the form.
    I have set "Show Horizontal Scroll Bar" to "Yes" and  "Show Vertical Scroll Bar" to "Yes" in the WINDOW Property.
    I have  set "Show Horizontal Scroll Bar" to "Yes" and  "Show Vertical Scroll Bar" to "Yes" in the STACKED CANVAS Property .
    But still the Horizontal and Vertical Scroll Bar is not working when i run the Form.
    Help me with this please. How do i make it visible??
    Oracle Forms 6i..
    Thank You.
    hello vijetha,
    window and canvas show scroll bar when it need.
    You should show block property
    and set block scroll bar
    hope this helps..
    Hamid

  • Horizontal scroll Bars not coming in JTable

    Hi,
    If a user streches any column of the jtable to the right such that its values are not visible properly. Then should the horizontal scroll bar come in the scrollpane in which table is there.??
    If Yes then how can I do it?
    I have seen when no of rows becomes more than the display area of the table then vertical scrollbar are coming automatically. but not Horizontal scroll bars.
    Please help

    sorry for my previous mistype, here is the right solutions to your problem.
    As default the JTable will auto resize your column width, if you want horizon scrollbar
    you must do following below steps:
    JTable tableview = new JTable (model) ;
    tableview.setAutoResizeMode (JTable.AUTO_RESIZE_OFF) ;
    JScrollPane scrollpane = new JScrollPane (tableview,
    ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
    ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED) ;
    JPanel p ;
    p.add (scrollpane) ;
    This can works for you !

  • Horizontal scroll bar not appeating in af:treeTable

    We have an af:treeTable component in a popup with two af:column.
    Issue:
    1. af:treeTable is not showing horizontal scroll bar. When i set the width to a fixed value say 1000 on af:column c171, it shows scroll bar but the size is fixed.
    This is not the solution, because if the length of #{node.TerrDimMemberHierarchy} exceeds this size again some portion of it becomes invisible.
    Question:
    1. How can i make horizontal scroll bar appear in tree table. And also it should grow or shrink depending upon the length of #{node.TerrDimMemberHierarchy}
    data.
    <af:treeTable rowBandingInterval="0" id="tt2"
    fetchSize="25"
    inlineStyle="width:38em; height:28em; border-width:1px; border-style:groove;"
    partialTriggers="::dimensionDropDown ::searchButton ::cb5"
    rowSelection="multiple"
    value="#{backingBeanScope.ManageTerritoriesBean.dimensionMemberSearchTreeTableTreeModel}"
    var="node"
    visible="#{pageFlowScope.searchString != null ? (pageFlowScope.viewInHierarchyBtnLbl == null ? true : false) : false}"
    columnStretching="column:c171"
    binding="#{backingBeanScope.ManageTerritoriesBean.dimensionMemberSearchTreeTable}"
    summary="#{salesterrmgmtterritoriesuiGenBundle['OLabel.AvailableDimensionMembers']}"
    immediate="true"
    selectionListener="#{backingBeanScope.ManageTerritoriesBean.dimensionMemberSearchTreeListener}"
    styleClass="AFStretchWidth">
    <f:facet name="nodeStamp">
    <af:column sortable="false" id="c14"
    rowHeader="unstyled"
    headerText="#{salesterrmgmtterritoriesuiAttrBundle['ColAttr.Name.DimensionName.MOTTERRDIMENSIONSVL.NAME']}">
    <af:outputText value="#{node.Name}" id="ot15"/>
    </af:column>
    </f:facet>
    <af:column sortable="false" id="c171"
    headerText="#{dlBndl.PATH}"
    styleClass="AFStretchWidth">
    <af:outputText value="#{node.TerrDimMemberHierarchy}"
    id="ot16"/>
    </af:column>
    </af:treeTable>
    Edited by: sekare on Aug 29, 2011 4:01 AM

    can u remove the styleClass="AFStretchWidth" for af:column
    AFStretchWidth is for table or treetable to stretch.. not for columns
    <af:column sortable="false" id="c171"
    headerText="#{dlBndl.PATH}"
    styleClass="AFStretchWidth">

  • Scroll bar not showing relative size correctly

    I'm not sure of the correct terminology so please bear with me. In CS4 when I zoomed in on an image, the bar at the bottom would show the size of the image now on screen relative to the full size. i.e. if I go from 50% to 100% the bar would be half the size indicating that I am only seeing half the image. At least I think that was the case in CS4.
    Here's and example from CS6.
    Open an image, choose "Command-0" to make it fill the window, and the percentage is 48.16%. The bar at the bottom is not there, but if it was I assume it would fill the width of the window.
    I select "Command-+" to zoom in, and the percentage goes to 50%. The bar now fills about 30% of the window width indicating that I have zoomed in a whole lot, but I haven't. There is only a little bit of image on either side not visible, the rest is a huge grey area extending left right, and up and down.
    How do I make the bar indicate the true amount of zoom, and how do I get rid of that grey area?

    Yes, it's working as designed.
    There's a feature called "overscrolling" which allows you to scroll past the edge of the document, and it's only available when the document is larger than the displayable area.  You'll see it work if you zoom an image to be *just* larger than your space and use the (what seems like too-short) scroll bar.
    This inconsistency, between when the document will all fit in the displayable area, and when it exceeds the space, is the real root of the problem.
    People have complained about this for a long time, and Adobe doesn't listen.  Thing is, some folks would like to be able to scoll or pan to offset an image that DOES all fit so as to be able to comfortably sketch on the edge - or for whatever reason.  That would make it more consistent. 
    Here's a reproduction of the problem, and scroll of the image that's slightly bigger than the window to illustrate:
    Here the image all fits - no scroll bars:
    Here the image has been zoomed in a little more - the scroll bars have appeared and are about 1/3 the size of the image:
    Here the image has been scrolled almost to the limit of the horizontal scroll bar:
    It's working as designed. That doesn't mean the design is right,
    -Noel

  • Swing (JScrollPane - scroll bar) help

    Hello all..
    I am new user in Swing. Currently I am developing a program using JSCrollPane. I have to draw a kind of chart in it. Therefore as a drawing media, I used the JPanel, in which I put it inside my JScrollPane. Then.. since my graphic is long.. then I set the
    setHorizontalScrollBarPolicy value to ALWAYS. Then I put my JPanel using the following commands :
    this.jScrollPane1.setViewportView(this.jPanel2);
    this.jScrollPane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    Fyi, my JPanel size is set to be wider than the jScrollPane3 size. Nevertheless.. during the run time the horizontal scroll bar is not shown. I am completely loss on how to solve this. Does anyone has any clue or solution for this problem. Thank you very much in advance.
    Kariyage.

    Fyi, my JPanel size is set to be wider than the jScrollPane3 sizeYou should use panel.setPreferredSize(...) not panel.setSize(...);

  • Document message bar not visible when participating in Shared Review

    Hi,
    I have initiated a Shared Review using Acrobat Pro 8
    Immediately after I finished sending out the notification to other reviewers, the _Review.pdf version of the document is opened for me and the Document Message bar is visible. Therefore I have the option to check for new comments, publish comments.
    My colleagues however, when they open the pdf file attachment from their email notification they get the message: "This document has been sent by a user of Acrobat 8.0 Professional for your review. To participate in this review Acrobat 8.0 standard or professional, or later, is required" Pressing OK on that message box opens up the PDF file to be reviewed however the Document Message bar is not visible (there is no Document Message bar icon on the left pane either.). Therefore my colleagues cannot publish their comments.
    I also encountered the same issue. After I close my PDF and re-open it, I cannot see the Document Message bar, eventhough I can still see my Review Tracker and the document still listed there.
    So, what did I do wrong? I started the shared review by following the prompts:
    1. Comments > Send for Shared Review
    2. Enable reviewers with Reader to participate
    3. Select a network drive to store the shared comments
    4. Select the document to be reviewed
    5. I've experiment with all the different send notifications options
    6. I specified the email address of the reviewers and sent the invite
    Thanks a lot for the help..

    Does this happen with one particular document or with all your reviews?

  • Horizontal Scroll Bar not displaying

    Hi,
    We have a page with many recursive tables for alignment.
    We have a lot of graphs displayed horizontally, so that we need to scroll the page horizontally.
    We happened to change the layout and suddenly we are missing the horizontal scroll bar !!
    We could not scroll to see the hidden page details.
    This happens only in IE6, IE7. Firefox, Mozilla displays it with horizontal bars
    Does anybody knows as what the problem could be ??
    - Mohan

    Horizontal Scrollbar in base window... has nothing to do with Framework, its a browser feature and should appear automatically. I m still wondering what must have caused in ur cause.Can u upload the page screenshot on any pic website, would like to have a look !
    There is CSS work around for this but it would be difficult to inject it in a OAF page!Anyways upload the screenshot.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Scroll bar not working..help me.

    i have a form with vertical scroll bar on it..in browsing to some other records using the mouse it does not sroll up or down, yet if I use the down key or up-key (keyboard) it works. What is the possible way to make the vertical scroll bar works. your immediate response will be highly appreciated.

    In Forms 6.0 using Frames the toolbar properties is in the frame properties.
    In Forms 4.5 or 6.0 without frames the toolbar's properties is in the data blocks properties.
    The scroll bar canvas must be in the same canvas that the data block.
    Martin Medina

  • JScrollPane scroll bar trouble on rebuild

    I've been working on this for hours (about 4 hours now) without finding the right solution, so maybe someone can help. I searched through a few pages of the forum but didn't see this exact issue. And the tutorial online doesn't help much.
    I have a JPanel in a JScrollPane in a JFrame. The JFrame has it's height reduced if its over a particular size (in the test case, it gets reduced). When it first loads, it's fine. However, if I rebuild the whole JFrame (some event causes the JPanel content to change, and refresh() is called again), the window remains the same size but the vertical scroll bar extends off the bottom of the frame. If I manually resize the frame with the mouse (even by 1 pixel), the scroll bar updates and looks correct again. What is the correct way to do this? Calling revalidate() on the JScrollPane after doing the setSize() doesn't do anything. And why does it work the first time when the JFrame is first built through the Constructor?
    example code:
    public class MyFrame extends JFrame {
        public MyFrame() {
            super();
            refresh();
        private void refresh() {
            JPanel jp = new JPanel();
            jp.setLayout(new SpringLayout());
            // add some stuff to jp
            JScrollPane scrollPane = new JScrollPane(
                JScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
                JScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED
            scrollPane.getViewport().add(jp);
            setContentPane(scrollPane);
            pack();
            if (getHeight() > MAX_HEIGHT) {
                setSize(getWidth(),MAX_HEIGHT);
    }

    When you have changed the content, call getRootPane().validate(); instead of pack(), as in this slightly modified version of your sample program:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MyFrame extends JFrame implements ActionListener {
        private static final int MAX_HEIGHT = 100;
        public MyFrame() {
            super();
            refresh(true);
        public static void main(String[] args) {
            MyFrame myFrame = new MyFrame();
            myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            myFrame.setVisible(true);
        private void refresh(boolean pack) {
            JPanel jp = new JPanel();
            jp.setLayout(new BoxLayout(jp,BoxLayout.Y_AXIS));
            JButton refreshButton = new JButton("Refresh");
            refreshButton.setActionCommand("refresh");
            refreshButton.addActionListener(this);
            jp.add(refreshButton);
            jp.add(new JLabel("Hello"));
            jp.add(new JLabel("There"));
            jp.add(new JLabel("Why"));
            jp.add(new JLabel("Doesn't"));
            jp.add(new JLabel("Refresh"));
            jp.add(new JLabel("Work"));
            JScrollPane scrollPane = new JScrollPane(
                ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED
            scrollPane.getViewport().add(jp);
            setContentPane(scrollPane);
            if (pack) {
                pack();
            else {
                getRootPane().validate();
            if (getHeight() > MAX_HEIGHT) {
                setSize(getWidth(),MAX_HEIGHT);
        public void actionPerformed(ActionEvent ae) {
            refresh(false);
    }

  • Navigation bar not visible in edit mode

    Hi,
    is there somebody who can help me out of this: in edit mode my navigation bar is not visible, however once the site is uploaded the bar is visible. During edit mode i can only see a big dot which positioned in the navigation bar text box.
    I am using the latest version of iweb and OS 10.6.8
    looking forward to any good sugestions. Thanks.

    That is so unusual.  Usually it's the other way around: looks OK in iWeb but not after publication.
    Log into another user account on your Mac, launch iWeb, create an new test site and see if the navbar is visible.  If it isn't then the application seems to be the culprit and a reinstall of iWeb seems warranted. To do so you'll have to delete the current application and all files with "iWeb" in the file name with either a .PKG or .BOM extension that reside in the HD/Library/Receipts folder and from the /var/db/receipts/  folder,
    Click to view full size
    Then install iWeb from the disk it came on originally and apply all necesary updaters.

  • Scroll in safari, Scroll bar not working in Safari

    Scroll bar does not show up in Safari. Worked fine until last update. Works fine in Firefox. www.scottlerman.com

    For an iOS device ?  >>   https://itunes.apple.com/us/app/ip-cam/id333208495?mt=8
    If so, check out the app developer's site for support >  http://www.senstic.com/iphone/ipcam/ipcam.aspx

  • TOC slide bar/scroll bar not showing on iPad

    Captivate 8
    HTML5/SWF output with scalable HTML content
    iPad Safari
    Desktop Safari and FireFox
    Hello.
    We've noticed that the TOC slide bar/scroll bar is not displaying via iPad.  It does show Desktop via Safari and FireFox.  Is there a setting we have missed perhaps?
    Many thanks

    Depending on your issue, making an appoint will be offered as an option by choosing "Take in for Service" (see http://www.macrumors.com/2014/11/07/apple-genius-bar-online/).  Of course, you could also just try calling your local Apple store.

Maybe you are looking for