Adding scroll bars to a frame

Hi, I have a frame that pops out from my applet, and I want to add scroll bars to this frame. Using JScrollPane does not work. The scrollbars do not show up even when the image that is displayed on the frame does not fit in the current frame size. Is there a good way to do this? Thanks.

Container c=getContentPane();
c.setLayout(new FlowLayout());
JScrollPane pane=new JScrollPane(your Component or frame);
c.add(pane)

Similar Messages

  • Adding Scroll Bar to a Frame

    Hi guys,
    Can anyone help me to add a scroll bar to a frame which contains a panel. The panel contains some Labels and one buttton.
    Please suggest it using java.awt package(not swings).

    But can you please tell me how to implement that.
    I am helpless. I can't find away out.Oh come on, look at the API docs. Put your Panel with the correct size into the ScrollPane, put the ScrollPane into the Frame, done.

  • Adding scroll bar to a text box

    Is there a way to add a scroll bar to a text box? I am designing a website using ID (in the web view) which I am then giving to a web person to implement. I have one page that is longer than the others, where I would like to be able to scroll the text. I would really appreciate a step by step instruction on how to add a scroll bar to this text box.
    Thank you so much.

    The point is that exporting to Flash makes creating the webpage in ID seamless.  I am not familiar with a
    way to import an ID file into a Dreamweaver HTML.  ID relies on pages that get converted to
    frames on the Flash timeline which makes switching between pages, if you know enough ActionScript, a breeze.
    However I did find this link which outlines some compatibility between ID and DW:
    http://livedocs.adobe.com/en_US/InDesign/5.0/help.html?content=WS82C401A9-E844-40d5-B9B4-5 40CA374B0C6.html
    Message was edited by: markerline

  • How can I put a scroll bar on a frame?

    Hello,
    I have a class that extends JFrame, and I need the Frame have a scroll bar. How can I do so?

    JFrame frame = new JFrame() ;
    JScrollPane scrollpane = new JScrollPane() ;
    JPanel panel=new JPanel();
    JLabel label=new JLabel("Hello!");
    label.setPreferredSize(new Dimension(2000,2000));
    panel.add(label);
    scrollpane.add(panel);
    frame.setContentPane(scrollpane);
    Does that work for you?
    PS:scroll bar as needed is the default setting, so you don't actually need them. And yeah, your panel must be big enough to let the scroll bars show themselves.

  • Adding Scroll Bar in Jlist

    Hello
    Could anybody suggest me how can I add scroll bar in Jlist. I tried this one, but it did not work
    JList list = new JList(subject);
    JScrollPane scrollPane = new JScrollPane(list);
    Thanks
    Prashanth

    Posting another question without replying to the responses on your previous thread, are you? Good luck getting help with this one.
    db

  • Adding scroll bars to jlabel

    hi i'm new so be easy on me please... i am trying to figure out how to add vertical and horizontal scroll bars to my jlabel. I am using sun one studio 5 on this project which allows me to manually place vertical and horizontal toolbars but when i do that they don't work w/ the image that i'm trying to scroll...i know that i have to code so that the scroll bars know to function w/ the jlabel but thats all i know. please advise~ thanks

    well, I don't know about doing things with Sun One Studio, but....
    Generally, if you want to scroll something, you would create a JScrollPane instance and add a component to it's viewport. That component could be a JLabel, so you wouldn't be scrolling the label so much as scrolling the pane. The effect would probably be same thing you are trying to see.
    You can use scrollbars in your own component, but the main reason not to do that is that managing the scrollbar states and dealing with paging and whatever is just a pain.

  • Adding scroll bars to text

    I have a limited amount of space with a lot of text.  How do I limit the space by adding scroll bars

    Without using iFrames, you can do this pretty easily using CSS. Add the following to the css for your text container...
    .yourcontainer {
         height:300px;
         width:500px;
         overflow-y:auto;
         overflow-x:none;
    then in the html, add the class to your container...
    <div class="yourcontainer">All of your text here</div>
    In the above example, the container div will be 500 pixels wide and 300 tall with a scrollbar if the text cotent gets longer than the height of 300 pixels.

  • Adding Scroll bar InPanel Array

    I want to add scroll bar in panel array .Kindly help me to sort this problem immdiatedly

    Kindly help me to sort this problem immdiatedly Based on the information provided, I doubt we will be able to.
    The general advice is add your panel to the scrollPane and add the scrollPane to the GUI. Its that simple.
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

  • Hiding scroll bars IE7 with frames

    This works great in IE7 with no frames:
    function hideScrollBar(){
    document.body.style.overflow='hidden'
    function showScrollBar(){
    document.body.style.overflow='';0
    }As long as I do not want to use frames. As soon as I use frames though I get spacing for the scroll in IE7 (not netscape or mozilla). Any thoughts on how to get rid of that vertical scrollbar space?
    Thanks,
    John Glynn

    I guess you need to specify the frame before the document.body... like
    window.<Your_Frame_Name>.document.body.style.overflow='hidden' or window.frames['Your_Frame_Name'].document.body.style.overflow='hidden'

  • Frame need's Scroll Bars

    I need some help. I have created a JFrame using a GridBoxLayout, but they problem I have encountered is that when the frame is too small for the content it overlaps. This is not a problem for the width since I am setting the size of the screen unResizable. But when the content grows to long for the height of the frame all the JLabels, JTextFields and etc. overlap. What I would like is when there is too much content for the screen that a Scroll Bar appears on the right side of the screen and the content of the screen remains the same, and to see the content below all I have to do is scroll down. Much like a text area or I guess the same a web page. The only way I know how to add a scroll bar is to a text area. I would like to be able to add a scroll bar to a frame, container or panel.
    Derek

    1) What is a GridBoxLayout?!
    2) The solution to your problems - set the content pane to a JScrollPane, set the viewport to a JPanel with your layout (whatever it is) and add your components to the panel.
    3) If you want to add scroll bars to anything, use a JScrollPane. See the API documentation for details.
    Stephen

  • How can I hide horizontal scroll bar?

    Some websites use CSS code (overflow-x: hidden or overflow-y:hidden), that shows the horizontal scroll bar while the frame on the website is centered and only 800 pixels wide, but I really don't need my horizontal scroll bar to show up. So how can I hide it?
    Thanks!

    If you use <b>overflow: hidden</b> then you shouldn't see a scroll bar (overflow:scroll does that).<br />
    If that doesn't work then try to add the !important; or use the code in Stylish or to userContent.css in the chrome folder.
    *http://kb.mozillazine.org/userContent.css
    *https://developer.mozilla.org/en/CSS/@-moz-document

  • Where is the Scroll bar of the page?

    Hello,
    When I start doing my website on Flex 4 using flash builder eclipse plugin, and when I test my pages how they looks I can't see the scroll bar to to see the buttom of the page!! well I thought can be a bug or something but until now I still unable to see the buttom of the pages !
    I read this http://stackoverflow.com/questions/4627659/flex-4-scroller-skin, but I didn't understand what should I do exactely !
    should I create my scroll bar manually to be able to make a scroll ?
    Please I need a solution
    Anyone !

    see an example in action:
    http://trumpboston.com/helpothers/example03521/scroll.html
    it came from this example source code:
    http://blog.flexexamples.com/2010/11/03/adding-scroll-bars-to-an-spark-application-contain er-in-flex-4/
    the first module make it be your application mxml
    the second one, under your src directory, create a "skins" folder and save in there the file:
    skins/CustomScrollingApplicationSkin.mxml
    notice the slider on the top that will increase the height of your content to show the scrollbar jumping around in its height.

  • Changing scroll bars to buttons

    Hello all, I use Macromedia Dreamweaver Mac for my wepage
    editing, I was wondering if anyone knows any helpful tutorials or
    instructions on how to replace the ugly grey scroll bars in your
    frames with arrow buttons or the like. Thanks much !!

    You can control the colours of the scroll bar elements using
    CSS which means you can effectively 'hide' the scroller etc. You
    can find more info here:
    http://websitetips.com/articles/css/scrollbars/
    You can do it .... but should you? I'd agree with Micha,
    avoid it if possible and perhaps revisit your design, i dislike
    having many scrollables within a page especially when the
    containers are not dimensioned relative to thier content (don't
    make me scroll when I shouldn't have to).
    Karen

  • Drag JTabbedPane out of the main Frame and set scroll bars for the tabs

    hi ,
    Iam working on a Swing application . In it i have Six Tabs added to a single JTabbedPane. all the tabs are different class files . is it possible to drag any of the tabs out of the frame.
    how to add scroll bars for the tabs individually. i have tried adding JScrollPane to the main frame and add the JTabbedPane to the Scrollpane . the scroll bar was not visible and i have tried adding
    all the six tabs to the individual JScrollPanes and add the six scrollpanes to the TabbedPane .
    only the scroll arrows are visible , when i minimised or resized the application the scrollbars were not appearing .
    could any one help me to solve the above two problems.

    just trying.....
    public void mouseDragged(MouseMotionEvent e){
    // this event should be activated only when the Drag goes out of scope of the parent JFrame which i dont know how
    Component c=JTab.getComponentAt(JTab.getSelectedIndex());
    JFrameobj.getContentPane().add(c,"Center");
    }

  • I'd like an alphabet scroll-bar for my folders in Mail. Will this be added anytime soon?

    I've been using Mail for years and find it convenient for use across all devices, off-and online. I really like that I can place a rule so that each email will automatically be delivered into individual folders. This makes it easy to organize my emails for search purposes, and to keep a clean and relevant Inbox. Sometimes, depending on my internet connection....it can sometimes cease at home and my desktop will be in sleep mode, and my emails won't be automatically ruled into their appropriate folders. This is ok, because I just manually file them. However, I have many folders. It would be an added bonus if there is an alphabet scroll-bar in the folders source list to the left of the Mail app. screen.
    It appears that so much time and energy has gone into renovating the Mail application throughout the years, and the clean design and ease of use is noticeable and appreciated. I feel they would be complemented by the scroll-bar.
    I'm just wondering if Apple has this in mind for any new updates to Mail?
    Thanks!

    Apple doesn’t routinely monitor the discussions.
    Send Apple feedback. They won't answer, but at least will know there is a problem. If enough people send feedback, it may get the problem solved sooner.
    Feedback

Maybe you are looking for

  • How to change & manage different ports in a mixed web environment (BSP/WAD)

    Hi everybody, our scenario is the following: We constructed a mixed environment web application, consisting out of a BSP application and WAD web templates. Unfortunately the url of web templates and the bsp-application differs - meaning the server is

  • Sharing iTunes music AND library files between multiple users in Windows XP

    My wife and I share the main computer and both use iTunes, each of us with our own iPod. While Apple covers how to share your music directory itself (which I did when iTunes was first installed by making the music directory C:\music), it doesn't allo

  • What to look for a trainer?

      Some questions for you guys here.  I been working in IT for almost 10 years now.  The current role require me to be technically competent to handle migration projects (Windows 2008/Active Directory).    The good thing is i am encouraged to take up

  • Storing and deleting time capsule files

    After reviewing a number of posts it seems partitioning the time capsule is very difficult at best. If I am using it to back up my computer and wanting to save other files to it, what happens when the disk reaches capacity? Can you delete backup file

  • Signature tab not working in preferences

    Hi all, I just went to make myself a signature, however the signature tab in mail > preferences isnt working. When i click on each section eg:general, accounts etc they all come up with their usual option but when clicking on the signature tab nothin