I can't get the scroll bar appears

I have two questions: 1. the JPanel locked in the get does not resize when the dialog box is made smaller or larger.
2. the scroll bar does not appear.

Here is my code:
import java.awt.*;
import java.util.*;
import javax.swing.*;

public class AJPanelScrollTest extends JDialog
{
     public static void main(String[] args)
     {
          JDialog outerDialog = new JDialog();
          JPanel thePanel = new JPanel();
          JScrollPane theScroll = new JScrollPane(thePanel);
          theScroll.setPreferredSize(new Dimension(400, 400));
          
          outerDialog.setLayout(new BorderLayout());
          outerDialog.add(theScroll, BorderLayout.NORTH);
          outerDialog.setVisible(true);
          outerDialog.pack();
          outerDialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
                                outerDialog.setTitle("Some Title");

     }
}
Published by: 799076 on December 5, 2010 16:25

Which should be good, or you could just do:

//outerDialog.add(theScroll, BorderLayout.NORTH);
outerDialog.add(theScroll);

You must understand what the constraints of a LayoutManager OQ before using. By default, a component is added to the CENTER, which gets all the space available.

Tags: Java

Similar Questions

  • How can I get the scroll bar of firefox on the right side of my screen to stay?

    The scroll bar appears, but he goes with this version. I would stay permanently.

    On MAC OS X

    SYSTEM Goto PREFERENCES > GENERAL > display the scroll bar > choose "always."

  • How can I get the scroll bar to go to the top or the bottom of the page with a right click command?

    When I right click on the scroll bar nothing happens. I have to repeatedly turn the mouse wheel to get to the top or the bottom of the page. I just changed from the Explorer. I'm used to be able to do this. It's a lot less frustrating and time-consuming. I hope someone can help. Thank you.

    Unless an extension (to my insue) provides this functionality, there is no context for that Menu item. Press the keys Home and end the keyboard for up to the top and down.

  • How can I get the scroll bar on the left side of VBox

    Has anyone already done this?

    I tried extending VBox and substitution of updateDisplayList() and the verticalScrollBar.x = 0, but it did not work.

    Please let me know.

    You would probably replace validateDisplayList().

    TS

  • How can I get the menu bar with preview in browser and Code, split Code, design to appear? (DW CC) Accidentally deleted and cannot locate.

    I have accidentally disabled Standard or Document to the menu bar, now I can't locate the Code, code split, preview in browser and others.

    How can I get the menu bar with preview in browser and Code, split Code, design to appear? (DW CC)

    Found.  View > toolbars > Document.

  • A centered page moves when the scroll bar appears DW Cs5?

    Hi everyone, I've noticed that when you have centered web pages, the pages annoyingly move when a scroll bar appears. Sometimes a page is longer than the browser window, and therefore a scroll bar appears on the right that allows the Viewer to scroll down.

    But of course this looks like garbage, what happens is it so the page in the center of the space remaining after the scroll bar appears so jilts next page to another depending on whether the page has a scroll bar of the centres.

    Y at - it Center a code that can make the browser page in the same place, so that the scroll bar feeds into space on the right side rather than shoot the entire page on the left. ?

    Thanks a lot for any help

    Gareth

    This page IS the EXAMPLE.

    You don't need to do anything except increase the size of the text (Ctrl +++) or resize the browser window to force a scroll bar.

    (I guess you don't read description).

    View source in your browser to see the code.

    I threw this link to prove my previous point.  You cannot change the behavior of the browser without resorting to ugly things that don't work well in nature.

    Good hike!

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    http://ALT-Web.com/
    http://Twitter.com/ALTWEB

  • How can I get the command bar, for e-mail, etc..

    How can I get the command bar in Mozilla? For the icon to email etc.

    If you want to learn the basics try this interactive and video tour

  • I download the latest version of Firefox, but when I go to sign up for google + it tells me that my browser is no longer supported. I tried uninstalling and everything, but can not get the new version appears. Any Suggestions?

    I download the latest version of Firefox, but when I go to sign up for google + it tells me that my browser is no longer supported. I tried uninstalling and everything, but can not get the new version appears. Any Suggestions?

    Please see that.

  • When the page opens, the scroll bar appears only if I move to bottom of page with the mouse

    It started last week with Firefox 5 and continues with the upgrade to Firefox 6. Each new page that opens in Firefox does not display a scroll bar. By entering the lower right of the page with the mouse and move the mouse to the right, the scroll bar appears and is usable. This "correction" is required on each new page.

    This condition looks similar to the condition met when Firefox 5 was introduced. The fix was to open appearances in tools then choose the default setting. This patch doesn't work anymore.

    Troubleshooting extensions and themes

    Check and tell if its working.

  • My screen has become unbalanced and I can't access the scroll bar

    In the last days, the screen on my laptop model Toshiba P100 drifted farther and farther to the right. I can not access the scroll bar. I tried for the quarterback by using the arrows but am having no luck. I've tried several things, including them turn off the computer. I did not install new programs, adding only a few pictures of my photos yesterday

    Given that this problem started a few days ago, do a system restore.

    Choose a date where you did not have this problem as your restore point.

    http://www.howtogeek.com/HOWTO/Windows-Vista/using-Windows-Vista-system-restore/

    Also, if you haven't tried that already, reset your screen resolution:

    http://www.Vistax64.com/tutorials/84291-screen-resolution.html

  • How can I get the speaker to appear in the notification area

    How can I get the speaker to appear in the notification area

    http://www.Vistax64.com/tutorials/106787-notification-area-system-icons.html

    How to enable or disable the Notification area system icons in Vista

    Read the tutorial above.

    http://www.ehow.com/how_5019440_restore-tray-icons-Vista.html

    See you soon.

    Mick Murphy - Microsoft partner

  • How can I get the status bar on my web page

    I want to get the status bar at the bottom of the web page so that I can slide from left to right, if an article is too large for my monitor. I got it this morning 05/01/15. After Thunderbird as an option for my email, the bar disappeared after uninstalling Thunderbird. I know hovering on the web pages I have on my menu bar, but I'd rather have the bar all at the bottom of the page.

    The gray bar appears in my email only. I would like to have it on all my sites.

    Thank you.

    I guess what you mean in the bar of horizontal scrolling if you want to be able to scroll horizontally.
    Firefox will normally only show the bar if content extends outside the browser window.

    You can have zoomed pages by accident.
    Reset the zoom of page on pages that are causing problems.

    • View > Zoom > reset (Ctrl / command + 0 (zero))
  • How can I get the address bar does not redirect me?

    Since the recent update for Firefox 36.0.1, a URL typed on the address bar is now taking me to a website where I can buy this unused domain name (buydomains.com). This is not where I want to go. I have no intention to buy a domain name; I don't particularly appreciate receive advertising in response to my fault for typing. What I would like is a good, not old Error 404 to tell me that I looked for something that didn't exist. How can I prevent the address bar to send me off, in the arms of the advertiser, but get just a 404 instead of this message?

    Hello

    I have to fully understand and appreciate the magnificence of a 404 error. He immediately told you what you wanted to know - that the site is not found!

    What you see is where the registration and ownership of the site was passed to the registry which is owner of the domain. The site is located, it is just acting as an announcement of the person who is the owner of the URL so that they can sell or resell.

    The address bar works as it should - it displays the URL as requested - it's just not the preferred outcome. One way you can get around this is use a parental control addon and include the name of the registry in the watchlist (or edit list so that it is the only entrance). She stops at the page to display. (Link) is an example of the kind of addon, that you could use.

  • Cannot get the scroll bars to view on popupscreen listField

    Hello world.

    I'm developing a popup for the 9530 screen application that has only a listField on the pop-up screen. However, I do not

    the scroll bars on my listField. Here is a snippet of my code:

    SerializableAttribute public class PasswordPopupScreen extends PopupScreen {}
    public PasswordPopupScreen() {}
    Super (new VerticalFieldManager (VERTICAL_SCROLLBAR), DEFAULT_MENU |) DEFAULT_CLOSE);
    HFM HorizontalFieldManager = new HorizontalFieldManager(Manager.VERTICAL_SCROLL |)                                            Manager.NO_HORIZONTAL_SCROLLBAR);

    MyListField myList = new MyListField(0,ListField.FIELD_VCENTER);
    ...

    ...

    HFM. Add (myList);
    Add (HFM);

    }

    ...

    ...
    So do / can a listField even display a vertical scroll bar on a popupscreen? I don't know that I need a manager of vertical and horizontal. All that my screen will have on it is a listField and perhaps a title.

    If anyone can point me in the right direction for what is missing which is originally a vertical scroll bar does not show?

    Thank you.

    Ok. I got it work. My Simulator crashed then I reinstalled it and it worked only. Strange. Well...

    Thank you.

  • Help! I can't find the scroll bars in Word, Office 2010!

    Shortly after that I installed Office 2010, I was desperately trying to repair one imagine that I had added to my document, but somehow instead, I turned off scrollbars for windows! I tried to retrace my steps, but have no idea of what I did. The scroll bars are always present in all my other programs, but when I opened a Word document, new or old, there is no scroll bar. I have to use my arrows or previous page and page down to move through my documents. It's very embarrassing. Of course, I could use some help!

    Thank you!

    In the view tab of the dialog box Options (menu Tools - Options)
     
    --
    ..
    --
    "Ellen Ziff" wrote in message news: 4c7755b9-21f2-4687-845 c-889c4ab29079...
    > Shortly after I installed Office 2010 I desperately wanted to fix a
    > imagine that I had added to my document, but anyway instead
    > I turned off scrollbars for windows! I tried to retrace my steps
    > but have no idea of what I did. The scroll bars are always present in all my
    > other programs, but when I opened a Word document, new or old, it has no
    > scroll bars. I have to use my arrows or the page upward and down to move the page
    > around through my documents. It's very embarrassing. Of course, I could use
    > help!
    >
    > Thank you!
    >
     
     

Maybe you are looking for

  • 5105 S701 battery recalibration...

    Hi, I recently installed the SP2 for Windows XP and since my battery was going dead twice faster. Did some reading and followed these instructions for battery calibration.1. let the battery run down completely2 - Remove the battery for 5 minutes3 - I

  • Screen remains black after start-up M30X 124

    Hey there... I hope someone can help, or at least has the same problem. I read trough this forum but can't find anything similar. Description of the problem:After pressing the button 'Start', the laptop is a short sound (HDD - load I guess), and then

  • Screen don't time-out on charger

    Hey my mom has a mini and the screen does not expire when the charger. Does anyone else have this problem? It works fine on charger charger but once you use the screen you have to hit the button to turn it off. I tried to start in safe mode is not a

  • I received a call from the scam.

    Original title: http://www DOT mywindowsupport DOT com. Today, I received a phone call from someone who claimed that the "guaranteed on my software had expired" and I needed to make a payment.  It sounded completely false... Beware.  This is the site

  • IE8 with SAP Business Warehouse

    After installing IE8 update I can't use SAP Business Warehouse queries, which return the error messages.  I uninstalled IE8 and the update of security for Microsoft Office Excel 2007 KB969682, which restored the BW feature on our professional XP lapt