Scrollbar doesn't show up on the panel while dynamically adding JTextFields

I have a dynamic user iterface, where the JTextFields are added dynamically to a JPanel within the JFrame upon the click of a JButton. How do I use the JScrollPane so that the Vertical Scroll bar shows up for the JPanel as soon added TextFields go out of range? The Panel has a null layout coz I want the textfields at specific positions on the panel. The problem lies in showing the Vertical scroll bar once the text fields in the JPanel exceeds the Panel's size. The scrolls don't seem to show up. Please help!
public Scenario() // Constructor
textPanel = new JPanel();
textPanel.setLayout(null);
textPanel.setSize(508, 520);
textPanel.setLocation(10,10);
//..........lines of code
public void addComponent(String text)
j = j + 30;
i = i+1;
String lineno = Integer.toString(i) + ".";
field = new JLabel(lineno);
field.setBounds(90,j,20,24);
textPanel.add(field);
if (addline){
content = new JTextField(text);
content.setBounds(108,j,400,24);
content.setBackground(new Color(255,255,255));
textPanel.add(content);
addline = false;
invscenario = false;
else if(invscenario) {
content = new JTextField(text);
content.setBounds(108,j,50,24);
content.setEditable(false);
textPanel.add(content);
try{
if (content.getText().length()!= 0)
Statement statement1 = conn.createStatement();
String query1 = "SELECT * FROM scenario " + "WHERE scenario_num LIKE '" + text + "'";
rs = statement1.executeQuery(query1);
rs.next();
int recordNumber = rs.getInt(1);
if(recordNumber != 0)
labelcontent = new JLabel(rs.getString(3));
labelcontent.setBounds(165,j,100,24);
textPanel.add(labelcontent);
}// end try
catch(SQLException e)
System.out.println(e);
invscenario = false;
addline = false;
scrollPane = new JScrollPane(textPanel);
scrollPane.add(textPanel);
contentPane.add(scrollPane);
contentPane.repaint();
show();

I guess since you don't have a layoutmanager you have to set the viewport dimensions of your JScrollPane manually.
Try something like
scrollPane.getViewport().reshape(....);
zk

Similar Messages

  • Report generation toolkit 1.1.2 doesn't show up on the panel

    I installed Report Generation Toolkit 1.1.2 together with the Labview 8.5. But when I looked into the function panel, it didn't show up. No Labview has been ever installed on this machine. However when I went to control panel "Programs and Features"-> National Instrument, it did show the "Report Generation Toolkit for Microsoft Office 1.1.2" there. So I guess it did install it, but how can I add them into the function panel. Btw, my system is Vista.

    Hi lshi,
    Glad to hear that reinstalling the Report Generation Toolkit resolved
    the problem.  To answer your question, the installer prompts for an
    installation directory to allow users with multiple versions of LabVIEW
    to select a version other than the latest.
    Peter K.
    National Instruments

  • MSI GT 70 ONC: Stereoscopic 3D option doesn't show up in the NVidiaControl panel

    Hi,
    I have MSI GT 70 ONC Laptop with NVidia 670M (2GB) graphics card. I also have Sony Bravia 3D TV.
    I can play 3d movies on laptop and can watch them on my 3d TV using HDMI cable fine although my laptop doesn't have 3d display.
    I am trying to use my laptop which doesn't have 3D display but has Graphics card which supports 3D to play 3d games and see them on my 3D TV.
    I checked online and found out that I need to change "Stereoscopic 3D" settings in NVidia control panel but Stereoscopic 3D option doesn't show up in the control panel. Very few options are there. I have updated drivers to the latest level but still can't see "Stereoscopic 3D" option in NVidia control panel. So will you be able to help me out what I can do to see the option? Thanks in advance.

    I have got an gs70. Exactly the same problem. Unfortunately this hdmi outputs are connected for the intel graphics cards. And intel does not support 3d.
    I was actually very angry with MSI. Because they do not mention in the description. They promot just the gtx card. And forgot to mention about the hdmi connection.
     Forget the 3d tv. Or you can buy an external mini pci-e graphics card adaptor.
    search in google for : EXP GDC Beast Laptop External Independent Video Card Dock

  • When you scroll to the bottom of the list of files in Finder, the left to right scrollbar doesn't let you click the last file and it covers the file for a while until it disappears. Is this a bug? How do I not make that happen?

    When you scroll to the bottom of the list of files in Finder, the left to right scrollbar doesn't let you click the last file and it covers the file for a while until it disappears. Is this a bug? How do I not make that happen?

    An odd workaround: click "Always" in System Preferences/General/Show scroll bars. The scroll bars will always show, but they won't cover your last file.
    See this other post: https://discussions.apple.com/message/20572471#20572471

  • Can't deinstall as iTunes doesn't show up in Control Panel

    Please help! I need to deinstall iTunes from the company laptop as I now run it on my home PC. Using the regular process (Control Panel > Add/Remove Programs > ...) doesn't work, as iTunes doesn't show up on the list.
    Does anyone know what to do to get rid of all iTunes-related material on this computer?
    Thanks für your help
    IBM Thinkpad T42   Windows XP  

    Try this
    Windows Installer CleanUp Utility
    http://support.microsoft.com/default.aspx?scid=kb;en-us;290301

  • I just purchased a new computer and downloaded I tunes but when I go to sync my iphone and ipad touch my library from my old computer doesn't show up on the new one. Only the purchased itumr dongs come up. How do I get my original itunes library?

    I just purchased a new computer and downloaded I tunes but when I go to sync my iphone and ipad touch my library from my old computer doesn't show up on the new one. Only the purchased itune songs come up. How do I get my original itunes library?

    Have you copied your content over from your old computer and onto the new on ? If not, and you still have your old computer, then there a number of methods described on this page which you can use to copy your library over : http://support.apple.com/kb/HT4527 . If you no longer have your old computer then have you got a backup of your content that you can copy onto the new computer and add into iTunes ?

  • TS4057 I did this and now my videos are not working. They show the pictures aren't there on some and on others it shows they are there, but doesn't show them in the player. When I try to Share anything it just says Waiting for Processing for hours. What d

    I did this and now my videos are not working. They show the pictures aren't there on some and on others it shows they are there, but doesn't show them in the player. When I try to Share anything it just says Waiting for Processing for hours. What do I do?
    I also got Motion and can't figure out how to use it with Final Cut Pro X. Any help woud be great. Thanks

    I have no idea what may have caused your MacBook to stop working, but from your description it kind of sounds like it may have started before you ran Software Update and installed the new Apps. Just the general slow feeling and bugginess is what tips me off. You said that you weren't sure if you had closed all open windows, that doesn't matter if the computer restarts itself. It automatically closes all other open applications when restarting.
    As to your data being retrievable, if when you take it in they do a fresh install of the OS, then no, it will not be unless you want to pay several thousand dollars to a software retrieval company.
    I am glad to hear that you have taken into the Apple Store to get it fixed, and that you have all of your purchased music backed up to your iPod. You should be able to just transfer it all back to iTunes once you get your computer back should it be necessary.
    As a side note, the proper place for this topic would probably in the MacBook forums, not iTunes since there is no evidence that iTunes started the issue.

  • Preview doesn't show up in the capture window

    When trying to capture, the video preview doesn't show up in the capture window, only the color bars. I am able to run my transport with the buttons and the key commands, so I know the Canon ZR500 is really communicating (easy setup: DV-NTSC), via firewire. My scratch disk is a G-Raid hooked up through the firwire 800 input. The crazy thing is, it worked only one time. I've wasted one whole day and this morning, restarting, rebooting, unplugging, different tapes, etc. Next step is takew my entire setup to the so-called Genius Bart and see if Apple's Geniuses know anything about Apple software. Frustrating as ****. I will never buy Apple again.

    Careful about editorializing. There are lots & lots of Mac users who are successfully capturing from Canon camcorders. I am one of them, and have never had a problem. So there is something in your setup that needs to be uncovered, it's not FCE or Canon per se.
    One observation, you have a small hard drive (100GB) and even though you appear to have 59GB free, that's actually not a lot of space. One hour of DV consumes about 13GB and during capture the Mac temporarily needs nearly 2x that space, which means your system is using the 'inner' cylinders of the hard drive, where performance slows down; this could explain your dropped frames problem. Can you move some stuff off your system HD onto your G-RAID (say, your iPhoto and iTunes libraries if you are using those apps, they often take a lot of disk space)?

  • Mobile me gallery doesn't show up in the widget

    I posted some albums to mobile me through iPhoto.  When I tried to put them on the website through iWeb, there were no galleries in the widget menu.  Why?  Is it because my site is an independent ".com" site versus being a "me.com" site??  Help!

    klcwebdesign wrote:
    ...it still doesn't show up in the widget menu
    I dunno what more to suggest, except to say that MobileMe live chat support is now 24/7 — see this announcement:
    http://www.apple.com/mobileme/news/2009/04/live-chat-support-247.html
    And to answer your previous question, you can simply change the settings and republish. See this iPhoto Help page:

  • IBook doesn't show up in the Textbook section

    Hi Folks,
         I recently had my iTextbook approved through the iBookStore (Physics: Fundamentals and Problem Solving), but noticed that it doesn't show up under the Textbook --> Science and Nature section, even when I choose "See All."  Does anyone know how to get this moved to the correct section?  Thanks much!
    Dan

    So I've been waiting 10 days now for my iBooks Author textbook to appear. The upload went fine, but as of today, nothing appears on title search.
    I've noticed some folks mentioning they were approved through the iBookstore. Does that approval come in an emai? I see no status indicators in iTunes Connect to check on progress of releasing the title.
    Can anyone shove me in the right direction?

  • Trying to install airport 5.6 to configure old UFO airport but doesn't show up in the app utility folder. How do you configure older Airports in OS X 10.7.5??

    trying to install airport 5.6 to configure old UFO airport but doesn't show up in the app utility folder. How do you configure older Airports in OS X 10.7.5??

    David Why? wrote:
    ... How do you configure older Airports in OS X 10.7.5??
    Use the technique described in this thread: I can't install airport utility 5.6
    Though it discusses Mountain Lion, you need to follow the exact same steps for OS X 10.7.5.
    I no longer have any original AEBSs to test. You may need an even earlier version of AirPort Utility. If AirPort Utility 5.6 cannot configure yours, let me know and I will attempt to find the correct version for you. You will need to use the same "extraction" technique described above.
    Edit: If 5.6 does not work try this one: AirPort Utility 5.5.3
    Important: If you elect to drag that version to your Utilities folder, be sure to give it a unique name. I suggest "AirPort Utility 5.5.3" This is not necessary for AirPort Utility 5.6, which will retain that name on its own.

  • When i copy songs with home sharing it shows it copying but doesn't show up in the library

    When I copy songs with home sharing it shows it copying but doesn't show up in the library. What should I do ?

    Hi adtsalmon,
    You can only watch the movie on the device you rented it on. Here's a snippet from the Apple Support site (italics mine):
    If you download a rented movie on your computer: You can transfer it to a device such as your Apple TV (1st generation), iPhone, iPad, or iPod if it’s a standard-definition film (movies in HD can only be watched on your computer, iPad, iPhone 4 or later, iPod touch (4th generation or later), or Apple TV). Once you move the movie from your computer to a device, the movie will disappear from your computer's iTunes library. You can move the movie between devices as many times as you wish during the rental period, but the movie can only exist on one device at a time.
    If you download a rented movie on your iPhone 4 or later, iPad, iPod touch (4th generation or later), or Apple TV: It is not transferable to any other device or computer.
    Here's the link to the Movie Rentals FAQs site FYI:
    http://support.apple.com/kb/HT1657
    Hope this helps!
    Cheers,
    GB

  • My Recordset is not showing up in the Panel

    What do I need for the recordset to show up in the
    Dreamweaver Bindings Panel? I have a recordset working but it does
    not show up in the panel and I want to use some DW
    behaviors.

    danilocelic AdobeCommunityExpert wrote:
    > redant34jessica wrote:
    >> What do I need for the recordset to show up in the
    Dreamweaver
    >> Bindings Panel? I have a recordset working but it
    does not show up in
    >> the panel and I want to use some DW behaviors.
    If you're using ASP JavaScript as the poster in this other
    thread, you might be able to use the same technique that I
    suggested as a potential workaround:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=12&catid=263&threadid =1429140&enterthread=y
    A similar technique may work for PHP and ColdFusion as well.
    Danilo Celic
    |
    http://blog.extensioneering.com/
    | WebAssist Extensioneer
    | Adobe Community Expert

  • I purchased a game name Einstein and I can't see it , it doesn't show up in the menu!?

    I purchased a game name Einstein and I can't see it , it doesn't show up in the menu!?

    This may be related to the "feature" that displays all Greatest Hits albums as one album, or it may be that the tracks are marked as compilations. Find one of the missing artists in iTunes and select the tracks from the album. Make sure the Compilations flag is set to No. Change the album title to something unique, e.g. if it's called *Greatest Hits*, rename it to *Greatest Hits, Artist*. Resync your iPod and see if it helps. If so, repeat the treatment.
    tt2

  • When i click on a photo to edit, the photo doesn't show up and the area where the photo should show up is black.  Why?

    When i click on a photo to edit, the photo doesn't show up and the area where the photo should show up is black.  Why?  I can edit some photos, whereas others I can not.

    There are several possible causes for the Black Screen issue
    1. Permissions in the Library: Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Include the option to check and repair permissions.
    2. Minor Database corruption: Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild.
    3. A Damaged Photo: Select one of the affected photos in the iPhoto Window and right click on it. From the resulting menu select 'Show File (or 'Show Original File' if that's available). (On iPhoto 11 this option is under the File -> Reveal in Finder.) Will the file open in Preview? If not then the file is damaged. Time to restore from your back up.
    4. A corrupted iPhoto Cache: Trash the com.apple.iPhoto folder from HD/Users/Your Name/Library/ Caches...
    5. A corrupted preference file: Trash the com.apple.iPhoto.plist file from the HD/Users/ Your Name / library / preferences folder. (Remember you'll need to reset your User options afterwards. These include minor settings like the window colour and so on. Note: If you've moved your library you'll need to point iPhoto at it again.)
    If none of these help:
    As a Test:
    Hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Create Library'
    Import a few pics into this new, blank library. Is the Problem repeated there?

Maybe you are looking for

  • Logical table source

    Hello! Can someone please explain difference between dragging and dropping a physical column from a table in Physical Layer to a Logical Table in BMM layer and ragging and dropping a physical column from a table in Physical Layer to a Logical Table S

  • HT1296 My ipod will not sync with my laptop i have followed every step on the wedsite and still nothing? i

    My ipod touch 5 will not sync with my laptop or even be recgonised even though it is charging when plugged in?

  • Manual Bank reconciliation statement error

    Hi I am try to save the Manual Bank reconciliation statemnt in T Code FF67 there I set the Procssing type 2 Batch Input session But the system not create batch input session why i dont no Plaese any one give me replay -- Process of Manual bank reconc

  • "Crisp" Video question

    Hi - I notice that my videos that I prepare for online viewing don't look as crisp as say the videos you see on cnn.com (advertisements) or other sites.  How sdo they achieve such crisp quality with no fuzziness? Thanks, Rob

  • Oracle materialize hint

    The Oracle materialize hint is used to ensure that the Oracle cost-based optimizer materializes the temporary tables that are created inside the "WITH" clause. What is the meaning of materialize in the above statement?