JScrollPane wont work why?

I need a scroll bar HELP Nothing Works.
This is What I got
import javax.swing.*;
public class Exercise526
     public static void main(String args[] )
     JTextArea outputTextArea = new JTextArea( 18,30 );
JScrollPane scroller = new JScrollPane(outputTextArea);
outputTextArea.append("\tThe Tweleve Days of Christmas\n");
     //declare variables
     String outputDay = "",
     outputVerse = "";
     for (int day=0; day <= 12; day++ ) //set variable
     switch ( day )
     case 0:
     outputDay = ("1st");
     break;
     case 1:
outputDay = ("2nd");
     break;
     case 2:
     outputDay = ("3rd");
     break;
     case 3:
     outputDay = ("4th");
     break;
case 4:
outputDay = ("5th");
     break;
     case 5:
     outputDay = ("6th");
     break;
     case 6:
     outputDay = ("7th");
     break;
     case 7:
     outputDay = ("8th");
     break;
     case 8:
     outputDay = ("9th");
     break;
     case 9:
     outputDay = ("10th");
     break;
     case 10:
     outputDay = ("11th");
     break;
case 11:
     outputDay = ("12th");
break;
     switch ( day )
     case 11:
     outputVerse += ("Tweleve lords a-leaping\n");
break;
     case 10:
     outputVerse = ("Eleven ladies dancing\n") + outputVerse;
break;
     case 9:
     outputVerse = ("Ten pipers piping\n" ) + outputVerse;
break;
     case 8:
     outputVerse = ("Nine drummers drumming\n") + outputVerse;
break;
     case 7:
     outputVerse = ("Eight maids a-milking\n") + outputVerse;
break;
     case 6:
     outputVerse = ("Seven swans swimming\n") + outputVerse ;
break;
case 5:
     outputVerse = ("Six geese a-laying\n") + outputVerse;
break;
case 4:
     outputVerse = ("Five golden rings\n")+ outputVerse;
break;
     case 3:
     outputVerse = ("Four colly birds\n") + outputVerse;
break;
     case 2:
outputVerse = ("Three french hens\n") + outputVerse;
break;
     case 1:
     outputVerse = ("Two turtle doves and\n") + outputVerse;
break;
     case 0:
     outputVerse = ("A partridge in a pear tree\n") + outputVerse;
break;
     outputTextArea.append("\nOn the "+outputDay+" day of Christmas \nMy "+
          "true love gave to me\n"+ outputVerse);
     outputTextArea.append("\n\tProgramed by: Carly Murphey");
     JOptionPane.showMessageDialog( null, outputTextArea,
                    "The Tweleve Days of Christmas",
                    JOptionPane.PLAIN_MESSAGE );
     System.exit(0);
This is due by midnoght tonight YIKES!!!

JOptionPane.showMessageDialog( null, outputTextArea, "The Tweleve Days of Christmas", JOptionPane.PLAIN_MESSAGE );
you should put the JScrollPane variable instead of the JTextArea variable.
so it would look like this:
JOptionPane.showMessageDialog( null, scroller, "The Tweleve Days of Christmas", JOptionPane.PLAIN_MESSAGE );
just that!

Similar Messages

  • Half my screen wont work, why?

    half my screen wont work, why?

    Warranty covers only manufacturing defects. Warranty does not cover accidental damage.
    Make an appointment at a Genius Bar in the nearest physical Apple store to have your iPhone
    evaluated.
    Make a Genius Bar Reservation
    http://www.apple.com/retail/geniusbar/

  • Ios 7 control center wont work. why not?

    I just installed IOS 7 and everything went smoothly. but I cant get control center to function at all. it is on in settings and when I swipe up on screen... nothing happens. anyone have any ideas why?

    discovered problem. the cover of my "defender" case is the issue. I tried removeing it and it works fine. sadly the cover is incorporated into the case.

  • Itunes v5 and greater wont work. why? error and crash

    Itunes v5 and the newest update, both create and error during install, during launch and when uninstalling.
    iTunes has encountered a problem and needs to close. We are sorry for the inconvenience.
    this is the error signiture:
    AppName: itunes.exe      AppVer: 5.0.1.4     
    ModName: unknown
    ModVer: 0.0.0.0      Offset: 10001040
    no other info is given, except for the techical report which is saved in a temp file, and doesnt help me out. no error codes.
    I have unistalled and cleaned my registry free of all itunes and quicktime files and still nothing works. Which is not good because I have many days of AAC files. previous version of itunes have always worked fine.
    Any ideas or am I stuck waiting for the next itunes release with tones of AAC files that cant be played?
    thanks for all ideas and post!!!

    well done, Jason!
    I do wonder though, why did it work with the SA version of QT, when the itunes download comes with QT?
    i'm speaking as a "technical journalist" rather than a "software installation engineer". (i have been the former, i've never been the latter.)
    as i understand it, the odds of running into an installation error (of any software package) increase when you've got two separate installs "chained together". that's what we've got going on with the itunes-5.0x/QT-7.0.2 installer bundle.
    in additon, more things seem to interfere with QT 7.0.2 installs than QT 6.5.2 installs. (QT 6.5.2 came in the itunes 4.9 installer bundle.)
    those two factors taken together raise the chances of the QT part of the 5.0.x/7.0.2 install going wrong by comparison with the 4.9/6.5.2 install.
    basically, i'm just doing what we did on itunes 4.9 installs when things got sticky in certain ways. i try to run the itunes and QT installs separately. i just have to advise people to do that more frequently than i did with 4.9.
    (people with a more in-depth technical understanding of these matters please feel free to leap in and say "b is a
    b fool
    as well as a scoundrel," and give poor Jason a more in-depth and correct explanation.)
    love, b

  • I have the iphone 4 i downloaded the new ios5 package but my i message wont work. why?

    i have the iphone 4 i down loaded the ios 5 package and i cant get my i message to work.

    Have you opened the iTunes app on your iPhone and tried to download the tones directly onto the phone from your Purchased list?

  • I'm trying to update my iPod touch 4g to iOS 6 but it wont work, why won't it work? help please

    I've been trying to update my iPod touch 4g to iOS 6 for the past week and it isn't working I have tried everything it won't even restore. I only got it in June what it happening? Someone please help!

    Mac Medic ([email protected]) wrote:
    Try a manual install, as outlined in the link below.
    Basic troubleshooting steps  
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101
     In Memory of Steve Jobs 
    It didn't work!!

  • Exporting AVI to DV - wont work - why?

    Hi there,
    Im having problems exporting about 40mins of AVI footage to DV PAL format.
    Im doing it using Premiere Pro CS3 on a PC with more than sufficient spec.
    The error message i keep getting is as follows:
    "Error compiling video. Cannot create or open output file"
    Has anyone else had this problem, and if so, could you advise me on how to fix it?
    Any help on this would be very very much appreciated! Thanks in advance.
    Matt

    Export a sequence of footage, in Adobe Premiere Pro CS3, that is currently in AVI format, export it as a high quality DV PAL format (using the quicktime compressor)..
    The PC is on a network, I am logged on as Administrator, although I only want to save the exported file on the local hard drive of that PC.

  • HELP!! convert selection to AAC wont work

    I NEED 2 KNOW HOW 2 DO THIS IT WONT WORK IT SAYS THAT THERE IS AN ERROR WHAT DO I NEED 2 DO?? I DOWNLOADED A VIDEO AND ITS ON I-TUNES BUT IT WONT PUT IT ON MY I-POD CAN ANY ONE HELP???!!??

    HELP!! convert selection to AAC wont work
    Why do you want to convert it to AAC?
    Why not convert it for iPod?
    IT SAYS THAT THERE IS AN ERROR
    What exactly is the error?
    I DOWNLOADED A VIDE
    From iTunes Music Store?
    What format is it now?

  • I bought a new ipad3 packed but after opening its box there are no headsets in it and iphone headsets wont work with iphone so is it normal I mean why there are no heas sets with ipad3 ?

    I bought a new ipad3 packed but after opening its box there are no headsets in it and iphone headsets wont work with iphone so is it normal I mean why there are no heas sets with ipad3 ?

    Headsets don't come with the iPad. All you get is the iPad, USB cable and wall charger.
    Since you're new to iPad ...
    You can download a complete iPad User Guide here: http://manuals.info.apple.com/en/ipad_user_guide.pdf
    Also, Good Instructions http://www.tcgeeks.com/how-to-use-ipad-2/
    Apple - iPad - Guided Tours
    http://www.apple.com/ipad/videos/
    Watch the videos see all the amazing iPad apps in action. Learn how to use FaceTime, Mail, Safari, Videos, Maps, iBooks, App Store, and more.
    How to - Articles & User Guides & Tutorials
    http://www.iphone-mac.com/index.php/Index/howto/id/4/type/select
    iPad How-Tos  http://ipod.about.com/lr/ipad_how-tos/903396/1/
    You can download this guide to your iPad.
    iPad User Guide for iOS 5
    http://itunes.apple.com/us/book/ipad-user-guide-for-ios-5/id470308101?mt=11
     Cheers, Tom

  • Why my numeric key pad on my wired keyboard wont work with snow leopard?

    Why my numeric key pad on my wired apple keyboard wont work with snow leopard?
    Thanks - Farshad

    What do you know, I figured out.
    Go to System Preference > Universal Acces> Mouse > check the "Press the option key five times to turn mouse keys on or off.
    Thanks

  • Why my map dosent show the addresses completly? it just shows the name of the city or in the best way the name of expressway (no matter how much i zoom in)and it wont work in reminder or any other place. this happend after i update my iphone 4 to ios 5.

    why my map dosent show the addresses completly? it just shows the name of city or in the best way the name of exxpressway and it wont work in reminder or any other place. this happend after i update my iphone 4 to ios 5.

    I am having a really wierd issue as well that is probally related. I dont see 95% of the album artwork associated with my music. Also, it seems as if this has gotten worse since I started using that match feature

  • HT1277 i have added my company e-mail add into my Macbook i receive mails but i cant send e-mails , anyone knows why ? i have tried all options in outgoing mail settings but it wont work !!

    i have added my company e-mail add into my MacBook , i recive e-mails but i cant send e-mails , anyone knows why ? i have tried all options in outgoing mail settings but it wont work !!

    Hello,
    The receiving email ports are:
    IMAP is port 143
    IMAP-SSL is port 993
    POP is port 110
    POP-SSL is port 995
    Outgoing ports are...
    SMTP and SMTP-SSL is on ports 25, 587 and 465. Port 587 has to be SSL, and port 465 is enforced TLS-wrapped and is generally used by Outlook users.

  • Why won't time capsule wont work with Lion?

    My Time capsule stopped working I installed Lion
    I get one of two error messages:
    The backup disk image “/Volumes/Brian Dunk's AirPort wirel/Brian Dunk’s iMac (2).sparsebundle” could not be accessed (error -1).
    Or
    Cannot complete backup error 6584
    Any ideas welcomed
    Brian

    The serial included with the TORRENT floating around the web for Logic 9 wont work on anything after 9.0.2
    $100 says this is why said user is freaking on a simple update... just sayin

  • Why apple charger wont work with some ipods?

    why apple charger wont work with some ipods?

    I can charge my 5th generation Nano either with the Apple USB cable connected to my Mac or when it is plugged to the wall outlet.  Not suprisingly, it recahrges much faster when plugged into the electric outlet.
    Which Nano do you have?

  • Why wont the new version of aperture work with Nik complete software. I uninstalled and re installed Nik and it still wont work.

    Why wont the new version of aperture work with Nik complete software. I uninstalled and re installed Nik and it still wont work.

    I believe that Nik is having trouble adhering to Apple's "identified developer" requirements.
    there is a FAQ on Nik site regarding problems with their installers.
    a guess.
    vince

Maybe you are looking for