Im a Total new Person to java plz help...

I was wondering if somone could help me with this code ive been working on...
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MadLibGUI
private int WIDTH = 700;
private int HEIGHT = 600;
private JFrame frame;
private JPanel panel;
private JLabel sticker,spray;
private JTextField joe,pizza;
private JTextArea finish;
private JButton done;
// Sets up the GUI.
public MadLibGUI()
frame = new JFrame ("Mad Lib Graphical User Interface");
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
sticker = new JLabel ("Enter your first Name:"); //      These will be altered as you add new questions
joe = new JTextField (15);
spray = new JLabel ("What's your favorite Food?");
pizza = new JTextField (20);
     ((((label3 = new JLabel ("Awnser y/n");))))))))
((((((((((((((label4 = new JTextField (25);)))))
done = new JButton("Click when done.");
     done.addActionListener (new DoneListener());
     finish = new JTextArea(10,60);
finish.setLineWrap(true);
panel = new JPanel();
panel.setPreferredSize (new Dimension(WIDTH, HEIGHT));
panel.setBackground (Color.white);
panel.add (sticker);                         //      These have to be altered as you add new questions
panel.add (joe);
panel.add (spray);
panel.add (pizza);
panel.add (finish);
((((((((((((((((( panel.add (label4);))))))))))))))))))))
     frame.getContentPane().add (BorderLayout.SOUTH,done);
frame.getContentPane().add (panel);
// Displays the primary application frame.
public void display()
frame.pack();
frame.show();
// Represents an action listener for the done button.
class DoneListener implements ActionListener
// Performs the conversion when the enter key is pressed in
// the text field and displays the result.
public void actionPerformed (ActionEvent event)
     String text1 = joe.getText();               //          These will be altered to get the actual input and
     String text2 = pizza.getText();
finish.append("Sup "+text1+". I hate That why do you like "+text2+" anyway...HMMM>???!!!!"); // to give the actual output.
(i keep getting this error)
\\w2knas2\data$\Secondary\Users\H\HURLECHR000\QB\MadLibGUI.java:35: cannot resolve symbol
symbol : variable label3
location: class MadLibGUI
     label3 = new JLabel ("Awnser y/n");
^
\\w2knas2\data$\Secondary\Users\H\HURLECHR000\QB\MadLibGUI.java:36: cannot resolve symbol
symbol : variable label4
location: class MadLibGUI
label4 = new JTextField (25);
^
\\w2knas2\data$\Secondary\Users\H\HURLECHR000\QB\MadLibGUI.java:52: cannot resolve symbol
symbol : variable label3
location: class MadLibGUI
     panel.add (label3);
^
3 errors
Tool completed with exit code 1
(i know its probly a simple change but im stumped...If this is the wrong Section PLZ redirect me to the appropriate place...Thanks ^_^

Ohh man I cant believe i did forgot this...Sorry to
Bother you all
private JLabel sticker,spray,
private JTextField joe,pizza,
man i forgot to declare...You are all right im sorry
to bother...but thanks for forcing me to review my
code...No problem.
However, in the future, when you post code, please use [code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read.

Similar Messages

  • HT4623 i have apple iphone 4 32gb orange,currently i m india,and unable to use indian sim,and i have updated it to new ios6,can u plz help me out

    i have apple iphone 4 32gb orange,currently i m india,and unable to use indian sim,and i have updated it to new ios6,can u plz help me out

    Select the country in which the iPhone was originally sold:
    http://support.apple.com/kb/HT1937
    You'll find a link to the carrier on whose pages you can probably find contact information.
    As RG said, only the carrier to which the iPhone is locked can authorize unlocking. That is the only "way out". To have an iPhone that was "factory unlocked", you would have had to purchase it that way.
    Regards.

  • How to use padding scheme FIPS81 in java plz help?

    Plz refer the below code using this code I m trying to decrypt XLS file using pass phrase.
    I m using the same pass phrase which was used @ the time of encryption.
    But the problem I m facing is that the file was encrypted in DOT NET_ using padding scheme FIPS81 and there impelmentation of FIPS81 is not available in JAVA so that it gives exception at the time of decryption which is given below
    Exception : javax.crypto.BadPaddingException: Given final block not properly padded
    I urgently need the solution of this problem so somebody plz help me to find the solution of this problem.....Ur reply would be appriciated.....!!
    The File is Encrypted using below mechanism
    ALGORITHM : AES
    MODE : ECB
    PADDING SCHEME : FIPS81
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.UnsupportedEncodingException;
    import java.security.MessageDigest;
    import java.security.NoSuchAlgorithmException;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    public class DecryptTest {
         public static void main(String[] s){
              String passPhrase = "passphrase";
              String encFileName = "encsample.xls";
              String decFileName = "decsample.xls";
              FileInputStream encFileIn = null;
              FileOutputStream decFileOut = null;
              File f = null;
              byte[] message;
              try {
                   f = new File(encFileName);
                   encFileIn = new FileInputStream(f);
                   decFileOut = new FileOutputStream(decFileName);
                   message = new byte[encFileIn.available()]; //Read the encrypted file in from disk
                   encFileIn.read(message);
                   SecretKeySpec spec = new SecretKeySpec(passwordToKey (passPhrase), "AES");
                   //decrypt it
                   Cipher c = Cipher.getInstance("AES/ECB/NoPadding");
                   c.init(Cipher.DECRYPT_MODE, spec);
                   System.out.println("Block Size is >-->" + c.getBlockSize());
                   String decryptedString = new String(c.doFinal(message));
                   System.out.println("Decrypted message: " + decryptedString);
                   //To write into another files
                   decFileOut.write(decryptedString.getBytes());
              }catch (Exception e) {
                   System.out.println(e);
              }finally {
                   try {
                        encFileIn.close();
                        decFileOut.close();     
                   } catch (IOException ioe) {
         }Is there any mechanism is available for FIPS81 or Is there any third party Provider available for it plz reply........????????

    I suggest you look in google http://www.google.co.uk/search?q=SWF+java

  • I have use three free apple Id and now when I am creating a fourth time it's saying that it is the maximum. What must I do to create a new apple id. Plz help

    I have use three free apple Id and now when I am creating a fourth time it's saying that it is the maximum. What must I do to create a new apple id. Plz help

    Sorry, no way around this limitation on an iOS device. To use a new iCloud account, you need to create such on a computer first, then setup the account on your iOS device.

  • New to java, plz help

    Well I'm not that new. I've been working with java for two years using jcreator in school. Its been great, we make lots of programs and run em and stuff. But the one thing we didn't learn is how to distribute the programs to other people. For instance, if I make a program to help with math homework......and I wanna give that to my friend........i'd hafta send em the source files and they'd hafta open it up in jcreator and run it........that seems kinda not good........how do u make it into an actual thing that I can click on and it runs like any normal program (exe?)

    yea, heres a lot of code that calculates the Flesch readability of a piece of writing.
    import java.io.*;
    public class Flesch
         private int mySentences, myWords, mySyllables, temp, flag, tempSyl;
         private char check,hold,back;
         private String myFile,myLevel;
         private double myScore;
         public Flesch()
              mySentences=0;
              myWords=0;
              tempSyl=0;
              mySyllables=0;
              myLevel="";
              myScore=0.0;
              temp=0;
              flag=0;
         public Flesch(String file) throws IOException
              myFile=file+".txt";
         public String getFilename()
              return myFile;
         public double getLegibilityIndex()
              myScore=Math.round(206.835 - (84.6*(((double)(mySyllables+1)/(double)myWords))) - (1.015*((double)myWords/(double)mySentences)));
              return myScore;     
         public String getEducationalLevel()
              if(myScore>=91)
                   myLevel="5th Grade";
              else if(myScore>=81)
                   myLevel="6th Grade";
              else if(myScore>=71)
                   myLevel="7th Grade";
              else if(myScore>=61)
                   myLevel="8th and 9th Grade";
              else if(myScore>=51)
                   myLevel="10th to 12th Grade";
              else if(myScore>=31)
                   myLevel="College Student";
              else myLevel="College Graduate";
              return myLevel;
         public int getNumSentences()throws IOException
              FileReader sent=new FileReader(myFile);
              temp=sent.read();
              while(temp!=-1)
                   check=(char)temp;
                   if(check=='?'||check=='!'||check=='.')
                        mySentences++;
                   temp=sent.read();
              sent.close();
              return mySentences;
         public int getNumWords()throws IOException
              FileReader word=new FileReader(myFile);
              hold='@';
              temp=word.read();
              while(temp!=-1)
                   check=(char)temp;
                   if((check==' '||check=='\n'))
                        myWords++;
                   hold=check;
                   temp=word.read();
                   if(temp==-1)
                        myWords++;
              word.close();
              return myWords;
         public boolean isVowel(char c)
              if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='y'||c=='A'||c=='E'||c=='I'||c=='O'||c=='U'||c=='Y')
                   return true;
              return false;
         public boolean isPunc(char c)
              if(c=='.'||c=='!'||c=='?'||c==','||c==':'||c=='-'||c==';')
                   return true;
              return false;
         public int getNumSyllables() throws IOException
              FileReader syl=new FileReader(myFile);
              tempSyl=mySyllables;
              hold='@';
              back='@';
              temp=syl.read();
              while(temp!=-1)
                   check=(char)temp;
                   System.out.print(check);
                   if(isVowel(check)&&!isVowel(hold))
                        mySyllables++;
                   if(hold=='e'&&(check==' '||isPunc(check)||check=='\n'||check=='\r'||check=='\f'))
                             mySyllables--;
                   if(tempSyl==mySyllables&&(check==' '||check=='\n')&&hold!=' ')
                             mySyllables++;
                   if(check==' '||check=='\n')
                        tempSyl=mySyllables;
                   if(flag>=1)
                        back=hold;
                   hold=check;
                   temp=syl.read();
                   flag++;
              syl.close();
              System.out.println("");
              return mySyllables;

  • Total newbie for jsp..plz help

    frendz...me a total newbie to jsp.havin some problem in it.i have already installed jdk,jwsdp2.0 wif its tomcat container.Already set the path for both ..such as JAVA_HOME=E:\Program Files\Java\jdk1.5.0_06
    TOMCAT_HOME=E:\tomcat50-jwsdp
    and could execute the sample jsp's perfectly.But having problem wif my jsp tutorials. such as when i wrote this counter codes in notepad..
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <html>
    <head>
    <tittle>Jsp Declaration</tittle>
    </head>
    <body>
    <h1>Declarations</h1>
    <%! int j=0;%>
    <h2>Counter</h2>
    <p>This page has been hit <span> <% ++j %> </span> times since it was first loaded.</p>
    </body>
    </html>
    and i paste it in webapps in tomcat folder.
    What should i do to view the jsp file?isaved as counter.jsp.if i right click and view it in IE/firefox it only shows the source code.is there any mistake in the codes?or i did i do anything wrong?how shall i compile these files?help me aout wif my basics please.thanks bro's..

    "I pasted it in webapps in tomcat folder".
    Webapplications need to go in their own subdirectory inside the webapps directory. Say you want a webapp 'test', then you would store your JSP as
    TOMCAT_DIR\webapps\test\counter.jsp
    Now you can open this JSP in your browser. Assuming Tomcat is running on the localhost and the default port 8080, the url would be:
    http://localhost:8080/test/counter.jsp
    If that doesn't work something is horribly misconfigured.

  • News server not found!! news:comp.lang.java.programmer HELP

    I trying to join newsgroup comp.lang.java.programmer
    but keep getting news server not found.
    Please help.

    No it's the name of the news group. You may add news1.sinica.edu.tw as the news server and select the group from those listed.

  • New macbook pro problem, plz help

    hey everyone.i just bought the new macbook pro last week, 15" i7core 2ghz. i am a very serious musician, and im going going to university next year to study music, the whole reason i bought this computer is for recording, all the musicians i know who are serious/professionals use macs. when i first turn on my computer everything is fine, but once i plug my guitar in through my zoom g2.1u pedal, garageband freezes and i have to force quit it, this just started happening within the past 2 days.for the first week i recorded with it fine.  it was also happening yesterday without even plugging in my guitar at all. when this happens the internet also shuts down. when i open safari it doesnt say you are not conncted to the internet, it just has a blank white page. when this happens everything else isnt working right either, everything is slow and laggy. i paid alot of friggin money for this thing and i wanted to keep it clean the only things ive done to it were, i took some mp3, pdf and guitar pro files from my old windows xp onto my mac through a usb stick, downloaded a mp3 from online and set a cool backround as my desktop. I thought macs were supposed to be resilient? or do i just have a defective one. these problems are quite specific but if i cant use garageband/record with my mac theres not a rly a point of me having one.
    i hope someone can help me out here.

    Try here:
    https://discussions.apple.com/community/ilife/garageband

  • SUDOKU in JAVA  Plz Help

    Hi
    I want to develop a Java program to solve Sudoku puzzles
    My program must be able to:
    �Read in a puzzle (from the predefined file format � see below)
    �Display the unsolved puzzle
    �Solve the puzzle
    �Display the solved puzzle
    File Format
    The file consists of a number of integers.
    The first integer signifies the size of the puzzle e.g. a 2 indicates a 4x4 puzzle, a 3 indicates a 9x9 puzzle, a 4 indicates a 16x16 puzzle and so on.
    The remaining numbers are one integer for each square of the puzzle (e.g. 81 integers for a 9x9 puzzle) and should be read left to right and top row to bottom row. A zero means that the square is empty. A non-zero indicates the number in that square.

    > Hi
    I want to develop a Java program to solve Sudoku
    puzzles
    My program must be able to:
    non-zero indicates the number in that square.
    And your question is?

  • Itunes/Quicktime new update authorization problems plz help

    Ive used Itunes and Quicktime for years with no problems. So a week ago I download the newest Itunes version, and from then on I couldnt open it, I attempted the quicktime update but this message would always appear. "The installer has insufficient privileges to access directory C:/ProgramFiles/Quicktime/PictureViewer.Resources/da.lproj. Installation cannot continue. Log on as admin."
    I have checked other posts out and I have tried completely reinstalling itunes and quicktime, then reinstalling together and seperatly, everytime the exact same message pops up. I have tried right clicking on the install links as "run as admin" Ive tried all I know of, I know im admin and the only account on computer.. Ive tried opening the actual files and changing them as the they are stuck as "read only" files, but again you cannot change them. Only thing ive thought of that havent tried is deleting all those quicktime folders in program files, which I dont understand why they are even there still since at the moment quicktime is not even installed?
    Would greatly appreciate any help or pointing me in the right direction! Cant listen to music and I even just got a new 16g ipod that I cant even use yet either :X thanks for your time

    "The installer has insufficient privileges to access directory C:/ProgramFiles/Quicktime/PictureViewer.Resources/da.lproj. Installation cannot continue. Log on as admin."
    That one is consistent with disk/file damage, Boarder.
    Try running a disk check over your C Drive as per the following document. (Select both Automatically fix file system errors and Scan for and attempt recovery of bad sectors.)
    [Check your hard disk for errors|http://windows.microsoft.com/en-us/windows-vista/Check-your-hard-disk-fo r-errors]
    Does the disk check find/repair any errors? If so, try another QuickTime install. Does it go through properly this time? If it does go through properly, does your iTunes start to launch again?

  • Smooth render/new to after effects plz help

    Hey everyone,
    Hope you guys can help me out. Im so fed up with my situation.
    I have older 720 x 576 video avi clips that I wanna use.
    I use the same source fps to render it, same size(best settings) and after it's rendered, the video doesn't look that smooth. It looks like its slower almost. If I watch original movie it's do much smoother and faster looking in a way.
    Can somebody tell me the exact settings I must have to render it as smooth as possible.
    720 x 576 25fps avi
    Thanx guys:)
    Werner

    Hi,
    thanx so much for answering my question. appreciate it.
    i saw that only certain render formats have option where you can choose codecs. is that what you mean by codecs? the only thing i have is copy the source 25fps, 720 x 576 and rendered it as avi.
    i want to import the footage that i render in after effects to premiere sometimes. dont know what format is the best.
    thanx again for all the help
    werner.

  • New Mac Slowing Down- PLZ HELP

    Hey guys-
    After having a bad experience with windoze, I decided to move to Mac- 3 weeks ago i bought a 13in 128gb hdd macbook air. It contains 8gb ram, but somehow, my laptop is slowing down to the speed of my 2007 Dell laptop! It has a core 2 duo and i have an i7- keep in mind that the thing has no tweaks installed, just apps downloaded from the 'net and appstore stuff. my downloaded apps were stuff like steam, apps to convert dmg's to iso images, etc. Anyway, i'm really hoping I can get the most out of the laptop, and not have it feel like i'm using an old laptop! Thanks in advance...

    Memorykeeper is sold by the same company that sells some of the worst trash known to plague Macs. It is capable of doing absolutely nothing beneficial.
    Flux by The Escapers Consultancy is Web design software, but if you mean f.lux or similar system hacks it could certainly be a factor.
    Onyx can do nothing that cannot be accomplished more safely and easily by using OS X's built-in resources.
    I don't know what intellihide is.
    ... should i remove all tweaks or should i reinstall os?
    Generally speaking if you want your Mac to run at peak efficiency you should avoid all such junk. It is not possible to make a Mac or its operating system perform any faster than they were engineered to perform. It is only possible to slow it down and make it unmanageable or useless by installing third party tools that claim the ability to speed it up or keep it "clean".
    Since you recently moved to Macs after having become inured to a Windows PC's constant need for care and feeding, you must endeavor to purge your mind of those preconceptions. Macs are a different world. They are designed to be used; to be beaten on and driven hard every day, not pampered and constantly fussed over. That's what I have been doing with mine for decades. Isn't that why you bought yours?
    Ignore the plaintive cries of former Windows developers desperately trying to convince you their tweaks and hacks are still relevant. Keep your Mac updated with software updates from Apple. That's all you need to do.

  • My new ipod doesnt work plz help!

    I try to play songs and i hear the sound but the screen is blank so i cant tell what song is playnig.....the weird part is movies play great
    ipod video   Windows XP  

    Try resetting your iPod. It might work that way.

  • RECORDING WITH F-32 ......ITS URGENT SO PLZ HELP

    HI 
    WISH EVERYTHING IS GOING ON WELL FOR YOU PELOPE
    I GOT AN ASSIGNMENT IN FI AND I AM VERY MUCH NEW TO FI SO PLZ HELP TO SOLVE THIS PROBLEM
    REQUIREMENT IS SOMETHING LIKE THIS
    I HAVE TO TAKE THE START DATE AND THE END DATE AS INPUT.
    I HAVE TO DO THE RECORDING IN F-32 WHICH IS FOR CLEAR CUSTOMER.
    SO AS PRE THE DATE VALUE I HAVE TO SELECT ALL THE REQUIRED VALUE FROM THE DATA BASE TABLE AND I HAVE TO CLEAR THEM .
    I HAVE DONE THE WORK TILL SELECTION SCREEN AND THE SELECT STAMENT,BUT I AM NOT ABLE TO DO THE RECORDING AS I AM NOT GETTING SOME APPROPRIATE DATA.
    SO IF ANYBODY HAVE GONE THROUGH SUCH KIND OF PROBLEM THAN PLZ HELP ME OUT WITH CODE ,ITS RGENT FOR ME.
    THANKS A LOT TO ALL
    MRUTYUN

    Hi
    Trx F-32 is the trx to clear documents of customers, there's a general trx to do this: FB05.
    This one is supported by b.i. std RFBIBL00.
    Max

  • PLz Help New To Java

    Hey im brand new to java and i just downloaded and installed jdk-1_5_0_01-windows-i586-p now im tryin to set up the PATH permanently but i have no clue how to i went to the install notes and typed in C:\Program Files\Java\jdk1.5.0_<windows>\bin in the command.com but everytime i do it says access is denied. i have no clue how to set up the path permanently beside what i tried plz help!!!

    You didn't which OS you are running, but it's fairly similar for all windows.
    Start->settings->control panel->system->advanced->environment variables
    Go to System variables, click on path, click edit button and add a semicolon and the path at the end. DO NOT REPLACE EVERYTHING THAT'S THERE NOW.
    I don't have 1.5 installed on this computer, but I'm willing to bet the real path doesn't have '<windows>' in it. Use Windows Explorer to find out where java.exe actually exists on the hard disk and use that path

Maybe you are looking for