JScrollPane bars problem Help!!!

There is some problem with my JScrollPane
I have added components to the JScrollPane but when components exceeds thee size of the JScrollPane the bars of the JScrollPane are not appearing. Please somebody help me... Just drag the JFrame and increase and decrease its size you will understand my problem. i cant see the remaining components because of no scroll bar.
Here is a working code...
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;
import javax.swing.*;
public class test2 extends JFrame implements ActionListener
     JPanel mypanes = new JPanel();     
     //Main Heading 1
     JPanel p1 = new JPanel();     
     JLabel l1 = new JLabel("MEDICINE INFORMATION");
     //Medicine General Information
     JPanel genpane = new JPanel();
     JLabel genl1 = new JLabel("General Information ");     
               //MGI (1)
               JPanel genpane1 = new JPanel();
               JLabel nam = new JLabel("Name:");
               JTextField gentf1 = new JTextField(14);               
               JLabel genname = new JLabel("Name:");
               JTextField gen1tf1 = new JTextField(14);
               //MGI (2)
               JPanel genpane2 = new JPanel();
               JLabel genname1 = new JLabel("Generic Name:");
               JTextField gen2tf2 = new JTextField(14);
               //MGI (3)
               JPanel genpane3 = new JPanel();
               JLabel genname2 = new JLabel("Manufacturers Name:");
               JTextField gen3tf3 = new JTextField(14);
               //MGI (4)
               JPanel genpane4 = new JPanel();
               JLabel genname3 = new JLabel("Classification:");
               JTextField gen4tf4 = new JTextField(14);
               //MGI (6)
               JPanel genpane5 = new JPanel();
               JLabel genname4 = new JLabel("Prescription Required:");
               JComboBox gen5tf5 = new JComboBox();
               //Medicine Detailed Information
               JPanel detpane = new JPanel();
               JPanel detp2 = new JPanel();
               JLabel detl1 = new JLabel("Detailed Information");
               //MDI (1)
               JPanel detpane1 = new JPanel();
               //MDI (2)
               JPanel detpane2 = new JPanel();
               JLabel detl3 = new JLabel("Common Uses:");
               //MDI (3)
               JPanel detpane3 = new JPanel();
               JTextArea dettf2 = new JTextArea(8,68);
     public test2(String title)
          super(title);
          //Main Heading Panel
          p1.setLayout(new GridLayout(3,3));
          p1.setBackground(Color.white);
          p1.add(new JLabel(""));                    
          p1.add(new JLabel(""));                    
          p1.add(new JLabel(""));                              
          p1.add(new JLabel(""));                    
          l1.setFont(new Font("avant garde bk bt",Font.BOLD,20));
          p1.add(l1);          
          p1.add(new JLabel(""));
          p1.add(new JLabel(""));                    
          p1.add(new JLabel(""));                    
          p1.add(new JLabel(""));     
               //General Information
          genpane.setLayout(new GridLayout(10,1));
          genl1.setFont(new Font("TimesNewRoman",Font.PLAIN,20));
          genpane.add(genl1);
               //MGI (1)
               genpane1.setBackground(Color.white);
               genpane1.setLayout(new GridLayout(1,5));
               genpane1.add(new JLabel(""));
               genpane1.add(new JLabel(""));
               genpane1.add(new JLabel(""));               
               genpane1.add(new JLabel(""));     
               genpane1.add(new JLabel(""));     
               //MGI (2)
               genpane2.setBackground(Color.white);
               genpane2.setLayout(new GridLayout(1,5));
               genpane2.add(nam);
               genpane2.add(gentf1);
               genpane2.add(new JLabel(""));
               genpane2.add(new JLabel(""));
               genpane2.add(new JLabel(""));
               //MGI (3)     
               genpane3.setBackground(Color.white);
               genpane3.setLayout(new GridLayout(1,5));
               genpane3.add(genname1);
               genpane3.add(gen2tf2);
               genpane3.add(new JLabel(""));
               genpane3.add(new JLabel(""));
               genpane3.add(new JLabel(""));
               //MGI (4)     
               genpane4.setBackground(Color.white);
               genpane4.setLayout(new GridLayout(1,5));
               genpane4.add(genname2);
               genpane4.add(gen3tf3);
               genpane4.add(new JLabel(""));
               genpane4.add(new JLabel(""));
               genpane4.add(new JLabel(""));
               //MGI (5)
               genpane5.setBackground(Color.white);
               genpane5.setLayout(new GridLayout(1,5));
               genpane5.add(genname4);
               genpane5.add(gen5tf5);
               genpane5.add(new JLabel(""));
               genpane5.add(new JLabel(""));
               genpane5.add(new JLabel(""));               
               //Medicine Detailed Information               
               detpane.setLayout(new GridLayout(1,1));
               detl1.setFont(new Font("TimesNewRoman",Font.PLAIN,20));
               detpane.add(detl1);                         
               //MDI(1)
               detpane1.setBackground(Color.white);
               detpane1.setLayout(new GridLayout(1,5));
               detpane1.add(new JLabel(""));
               detpane1.add(new JLabel(""));
               detpane1.add(new JLabel(""));
               detpane1.add(new JLabel(""));
               detpane1.add(new JLabel(""));
               //MDI(2)
               detpane2.setBackground(Color.white);
               detpane2.setLayout(new GridLayout(1,1));               
               detpane2.add(detl3);
               //MDI(3)
               detpane3.setLayout(new GridLayout(1,1));
               detpane3.add(dettf2);
               //Adding Heading 2
               detp2.setBackground(Color.white);
               detp2.setLayout(new GridLayout(1,1));     
               detp2.add(new JLabel(""));               
               //Adding Panels to the Main JPanel i-e genpane
               genpane.add(genpane1);
               genpane.add(genpane2);
               genpane.add(genpane3);
               genpane.add(genpane4);
               genpane.add(genpane5);
               genpane.add(detp2);
               genpane.add(detpane);
               genpane.add(detpane1);                                        
               genpane.add(detpane2);
               gen5tf5.addItem("Yes");
               gen5tf5.addItem("No");                    
               JScrollPane spp = new JScrollPane(genpane);
               spp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
               spp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
     mypanes.setBackground(Color.white);
     mypanes.add(p1);
     mypanes.add(spp);
     setContentPane(mypanes);
     public void actionPerformed(ActionEvent ae)
     public static void main(String args[])
          test2 t = new test2("Title");
          t.setSize(800,300);
          t.setVisible(true);

When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read.

Similar Messages

  • Menu Bar Problem HELP ME!!!

    hi i had lion on my Macbook Pro 13 2010 Mid
    i installed Super Bundle :
    Flux,Little Snapper,iStat Menus 3,iStopmotion ,SyncMate Expert,Fantashow,Video Converter for Mac,CuteClips 3,Chroniclei Parrarels
    and then i had to update my computer so i did.
    after restart i notice my menu bar was blinking, the problem was SystemUiServer Crash i didnt know what to do so i Formated my computer with Clean Install
    Snow Leopard then Lion and again i installed the programs from super bundle and again i had to update so i did it again.
    after restart the same problem so i unistalled the programs but the problem didnt sloved.
    i dont know what to do .

    Go to ~/Library/Preferences
    Move the com.apple.systemuiserver.plist file from the Preferences folder to the Trash.
    FYI, with Lion installed there's no need to do a clean install with Snow Leopard. You should use Lion Recovery instead.
    Restart your Mac after you move that .plist file to the Trash. That should stop the blinking in the status menu bar.
    And if I may say so, only install one third party software at a time then see how your Mac runs before installing more.
    ~ (Tilde) character represents the Home folder.
    For Lion:   To find the Home folder in OS X Lion, open the Finder, hold the Option key, and choose Go > Library

  • IPhone 5 has network carries name but no bar plus help solution in this matter please cell c

    Solution on iPhone 5 network name show and 3G sign but no net work bar any help pliz

    Make sure that your carrier is set to automatic. If it is and the problem persists the try removing the sim card from the phone for a minute and the reinserting it.

  • On an iMac I can't enter any text in safari or Firefox header bar. In all my program's I just have the arrow cursor and can't change to any tools in the tool bars - please help!

    I cant type any text in safari or and in all programs i have the arrow cursor and can't change to any tools in the tool bars - please help!

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, or by a peripheral device. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including Wi-Fi on certain iMacs. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Something is going on with my Itunes...[the rainbow wheel problem]Help me?

    Something is going on with my Itunes...I open up my itunes and the loading icon [the rainbow wheel] starts up. Everything freezes except the mouse i cant restart it, close it, nothin. im forced to press the power button to restart it. ive tryed it with nothing but the itunes only processing and it dosent seem to help. ive been with this problem for the last two weeks, and ive seen that everything on my macbook works fine as long as i dont open up my itunes but i really want it to work again. i dont know if its crashing or if its in a hang, but im hopin someone can help me on this, or wondering if i should take it to the nearst Apple store to get it checked at the genius bar. Help me?

    Hello errow,
    Your display problem looks very familiar to mine. You can see some pictures here on this topic: http://discussions.apple.com/thread.jspa?threadID=2741232&tstart=15
    Best regards,
    Frans.

  • PT880 - Boot problems; Help!

    I am building/have built a computer from scratch and the computer refuses to boot.  Usually the computer will spin up but the screen won't turn on,  or if I reser the cmos it will sucessfully boot to its bios, but then crash just the same on save/restart.  Other times it will just show a blank screen with the flashing input bar.  Help?
    p4 3.2 w/HT
    DDR 512mb 3200 (Kingston Hyper X series)
    80gb Maxtor HDD
    CD-RW/DVD-ROM Drive
    Radeon 9800 pro 128
    PT880 Neo
    Help?

    Quote
    Originally posted by Del UK
    Phishingtime,
    What errors did bios 1.9 fix for you??????? You keep saying 1.9 fixed??????
    Did 1.9 fix the dual v quad channel mem problem????DualStream64™ - Dual Channel DDR400/333/266 w/ECC
    Del
    What's your problem? You don't think a BIOS update can fix memory errors, or BSOD/reboot? It does not matter to me because I know what I know........
    If you look at a few of my other posts you will see. I do not feel the need to repeat myself and do not want to relive it. I only have about 20 posts ya know.
    And by the way, the one that actually fixed my problems was BIOS 1.6, and then MSI released 1.9 a couple of days later. I am just trying to help others so they do not have to go through what I went through.
    BIOS 1.7 which shipped with my new board was very unstable to say the least. 1.9 is the latest and works well, (wish I had a previousely tested BIOS) so I was just updating that 1.9 should hopefully work for other similar setups and errors.
    p.s. Jeeeez, I can't believe you just made me explain all of that!!!!!!!!!!

  • I dont have TV SHOWS on my itunes store tool bar - any help ?

    I dont have TV SHOWS on my itunes store tool bar - any help ?

    What country are you in ? TV programmes aren't currently available in all countries for buying
    What can be bought where : http://support.apple.com/kb/TS3599

  • My daughter has just bought me an iPad 2 from Dubai and set it all up for me but unfortunately the iMessage function doesn't seem to work. We keep getting messages,when trying to activate it, that there is a network connection problem - help!

    My daughter has just bought me an iPad 2 from Dubai and set it all up for me but unfortunately the iMessage function doesn't seem to work. We keep getting messages,when trying to activate it, that there is a network connection problem - help!

    Thank you both for your responses but my daughter was reassured by the salesman in the iStyle store (official Apple store in the UAE) that iMessages would work but conceded that FaceTime wouldn't. My iTunes account is registered in the uk and my daughter's iPhone has iMessages even though she bought it (and uses it) in Dubai. Can anyone else throw any light on this?

  • I couldn't log into my apple account on my iPad, then i couldn't unlock it resulting in it being disabled, however it's the same as my iPhones password, I then called apple, i was hung up on twice and they said it will cost £70 to fix THEIR problem, help?

    I couldn't log into my apple account on my iPad, then i couldn't unlock it resulting in it being disabled, however it's the same as my iPhones password, I then called apple, i was hung up on twice and they said it will cost £70 to fix THEIR problem, help?

    If you cannot remember the passcode, you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and resync the data from the device (or restore from a backup).
    If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present.
    You may have to force iPad/iPod into Recovery Mode
    http://support.apple.com/kb/ht4097

  • IPad syncing problem - HELP!

    iPad sync problem - HELP!  I keep getting this message "...cannot be synced because there is not enough free space to hold all of the items in the iTunes library (additional ...space needed)"  and yet I seem to have plenty of space on the iPad.  This just started today.  I even tried deleting some things to make even more room, but it didn't help.  Any ideas??? 
    I was thinking of restoring, but I've never done it...  should I? 
    thank you!

    Hello florafromnv,
    Welcome to Apple Support Communities.
    The following article addresses how to resolve the issues related to this message:
    iOS: "Not enough free space" alert when trying to sync
    http://support.apple.com/kb/TS1503
    Regards,
    Jeff D.

  • In the middle of my last update it stopped updating in the because of an unknown source, and now my screen on my iphone is frozen with the apple logo and a loading bar. Help??

    in the middle of my last update it stopped updating in the because of an unknown source, and now my screen on my iphone is frozen with the apple logo and a loading bar. Help??

    Unknown "source"?  Do you mean unknown "error" followed by a number?
    http://support.apple.com/kb/TS3221
    Follow the instructions in the article.  When you connect your phone again, you may have to press both the home and sleep/wake buttons until the Apple logo reappears, then continue pressing the home button until iTunes detects the phone in recovery mode.

  • MOVED: KT333 Ultra; fuzzy logic, 1.6xp overclocking problem help !!!!!

    This topic has been moved to Overclockers & Modding Corner.
    KT333 Ultra; fuzzy logic, 1.6xp overclocking problem help !!!!!

    Not that I am an expert o/c but here are some thoughts on the matter.
    My comments are based on my experiences of the KT3 Ultra2 which is basically the same as the Ultra version.
    This mobo does not have the ability to lock the PCI/AGP bus freely from the FSB. However, it does have dividers. At 133 a 1/4 divider kicks in. Above 152FSB the 1/5 divider works, so that at 166 the PCI & AGP buses will be back in sync. If you are o/c your cpu, don't go from 133 to 145, etc since you will be running the PCI/AGP buses further out of whack. Just go to either the mid 150's or to 166 in one jump. The other problem / issue relates to your cpu. From what you say you have one of the old Palominos which are not great o/c's. I would personally o/c your cpu from the BIOS rather than 'Fluffy Logic' which I would tend to stay away from. 
    With a 166FSB cpu a very stable o/c would be 175-177 beyond 180 gets decidedly tricky.
    Hope this helps

  • Itunes keeps closing as soon as i open it and states 'windows has detected a problem' HELP!!!!

    Help!! Itunes keeps closing straight away and message states 'windows has detected a problem' HELP ASAP PLEASE!!!!

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    If you've already tried a complete uninstall and reinstall try opening iTunes in safe mode (hold down CTRL+SHIFT as you start iTunes) then going to Edit > Preferences > Store and turning off Show iTunes in the Cloud purchases. You may find iTunes will now start normally.
    tt2

  • I have installed photoshop elements 12. when I try use the editing features it said that i must login to Adobe to register the product. but each time i try to it said there is a problem. help the problem stated that the internet is not connected, but that

    i have installed photoshop elements 12.
    when I try use the editing features it said that i must login to Adobe to register the product.
    but each time i try to it said there is a problem.
    help
    the problem stated that the internet is not connected, but that is not the case.

    I had the same issue and I'm running Windows 7.  Tried working with technical support for several hours but they were no help.  They just had me doing the same things over and over, offering no real answers.  I finally got fed up and have decided to return my product for a full refund.

Maybe you are looking for

  • Need HELP - Need to send MIME attachements, not UU-encoded.

    Some important recipients are unable to view attachments I send them b/c Mail, by default, sends UU-encoded attachements instead of MIME attachements. Is there any way to configure Mail to send MIME attachements? FYI to any other people having proble

  • ITunes 7.3.2: ArtWork does not match Images on Cover Flow View and iPod

    Hello everyone, this is my first post, thanks in advance for any and all help. I have loaded most of my music collection onto iTunes, and authorized it to get album artwork. It has only found about 60% of my cover art (I have a lot of international d

  • Imovie 9.0.4 update...impossible

    I've just update my Mac OS from Snowleopard to Mavericks. Then I have installed iMovie 10.0 (before I had 9.0.4) that didn't convince to me. So I want to update version 9.0.4 to 9.0.9 (after uninstalling 10.0 of course) but the updating package says

  • How to display related links iview in content area?

    Hi, I have created Related links, but they are opening in a separate windows even though I have set the attribute of the iviews to "open in portal content area". Please let me know how I can display the iviews of the Related links in the content area

  • Where can I find a place to repair my iPod 5G LCD?

    Will Apple store be able to repair or replace my scratched LCD screen?