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;

Similar Messages

  • Hi, I have moved to India from france and I am trying to update my payment options to the Indian visa card but it seems that no matter what I do I cant do it. I dont want to create a new ID..Plz Help!!!Just want to change my location and my payment detail

    Hi, I have moved to India from france and I am trying to update my payment options to the Indian visa card but it seems that no matter what I do I cant do it. I dont want to create a new ID..Plz Help!!!Just want to change my location and my payment details!! thanks in advance!!

    These are two possible approaches that will normally work to move an existing library to a new computer.
    Method 1
    Backup the library with this User Tip.
    Deauthorize the old computer if you no longer want to access protected content on it.
    Restore the backup to your new computer using the same tool used to back it up.
    Keep your backup up-to-date in future.
    Method 2
    Connect the two computers to the same network. Share your <User's Music> folder from the old computer and copy the entire iTunes library folder into the <User's Music> folder on the new one. Again, deauthorize the old computer if no longer required.
    Both methods should give the new computer a working clone of the library that was on the old one. As far as iTunes is concerned this is still the "home" library for your devices so you shouldn't have any issues with iTunes wanting to erase and reload.
    I'd recommend method 1 since it establishes an ongoing backup for your library.
    Note if you have iOS devices and haven't moved your contacts and calendar items across then you should create one dummy entry of each in your new profile and iTunes should  merge the existing data from the device.
    If your media folder has been split out from the main iTunes folder you may need to do some preparatory work to make it easier to move. See make a split library portable.
    Should you be in the unfortunate position where you are no longer able to access your original library or a backup then then seeRecover your iTunes library from your iPod or iOS device for advice on how to set up your devices with a new library with the maximum preservation of data.
    tt2

  • New to java(need help on access specifier)

    hi! i am new to java.plzzzzz help me i have to make a project on access specifier's i know all theroy.but
    i am unable to understand how i can define all specifiers practicly.i mean in a program.
    thanks.plzzzzzzzz help me

    the most common project i can think of is a payroll system..
    you can have real implementation of all the access specifiers
    good luck

  • HT1491 Cannot remember the security answers. Bought a new phone. Plz help!

    Cannot remember the security answers. Bought a new phone. Plz help! iPhone 5. Want to buy apps and it keeps asking questions I do not remember. How do you reset this?

    On your computer or safari on your iOS device navigate to:
              For Canada - https://appleid.apple.com/ca.
              For United States - https://appleid.apple.com/us/.
    Click the "Manage your Apple ID" button, and sign in to your iCloud account.  Once in, on the left side select "Password and Security", and this will populate our options on the right side.  You should see an option to reset your security questions. 
    Also see this article about your "rescue email address" - http://support.apple.com/kb/HT5312. 
    If for any reason you can not reset these security questions, or get an error, then you may need to contact Apple directly - http://support.apple.com/kb/HE57.   Explain the issue, and they can get your to a "Account Security" agent, who will be able to verify your identity, and assist in resetting the security questions.

  • 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

  • New to java plz hep me

    hello all,
    i'm new to java. i need to know answers to these questions..
    1.     What is the purpose of CLASSPATH? How �classpath� is used by �java� and �javac�?
    2.     What is the purpose of finally block?
    3.     What is �Ant�?
    4.     Explain the difference between abstract class and interface. When to use an abstract class and when to use an interface?
    5.     What is the purpose of �Xms option of �java�?
    6.     What is the main difference between java.util.Date class and java.util.Calendar class?
    7.     What are the differences between wait and sleep methods?
    8.     What is the advantage of using ArrayList over Vector?
    9.     Explain the word �casting�
    could u plz help me.. i need them very much..

    1.     What is the purpose of CLASSPATH? How �classpath�
    is used by �java� and �javac�?Classpath is the paths along which javac or the jvm searches for classes to load.
    2.     What is the purpose of finally block?Cleanup if something went wrong
    >
    3.     What is �Ant�? Ant is a preprocessor, kinda like .bat files.
    >
    4.     Explain the difference between abstract class and
    interface. When to use an abstract class and when to
    use an interface?You should really google this. It's hard to answer this in 1 line
    >
    5.     What is the purpose of �Xms option of �java�?Increase the java heap size
    6.     What is the main difference between java.util.Date
    class and java.util.Calendar class?RTFM http://java.sun.com/j2se/1.5.0/docs/api/
    >
    7.     What are the differences between wait and sleep
    methods?sleep sleeps. Wait and Notify work together in multithreaded apps.
    >
    8.     What is the advantage of using ArrayList over
    Vector?It is faster
    >
    9.     Explain the word �casting�In the harry potter sense of the word?
    Object o = "hi";
    String s = (String) o;

  • Hi, i'm new to java. need help setting the path in win XP

    hi all,
    i'm new to java technology. i've just downloaded the JDK and ran my first java program (hello world). i love it. java's gr8. i need help. i run win XP and how can i setup the path sothat i can execute my programs from the root dir??? any help in this direction will be greatly appreciated. please email me @ [email protected]
    Best regards
    Mrinal

    Go to Start menu and select Control Panel. In the Control Panel, double click on System. In the System dialogue, choose the Advanced tab. Then click on Environmental Variables. Select Path and Edit. Put ;c:\j2sdk1.4.0\bin at the end of the Path (or c:\j2sdk1.4.0\bin;) at the start of the Path. That's it.

  • Very new to java please help

    i'm very new to java and i'm getting an error in my application. i took 4 applications that compiled and worked separatly and i tried to combine them into one application. i'm getting the error: unreported exception java.io.IOException; must be caught or declared to be thrown, in lines 73,78,83,88,120,146,149,152,155 in the and it points at the keyboard.readLine() but everything i've tried just gives me more errors. please help anything and everything will be greatly appreciated. here it is, sorry about format i dunno how to straighten it in here:
    // ^ ^
    //               (0)(0) A Happy Piggy Application
    // Problems: 2.6,2.8,2.9,2.12 (oo)
    // An application finds the total number of hours, minutes, & seconds, finds the distance
    // between two points, finds the volume and surface area of a sphere, and adds up the change
    // in a jar. First, the total hours, minutes, and seconds problem.
    import java.io.*;
    import java.text.DecimalFormat;
    import java.text.NumberFormat;
    public class twoptsix
         static BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));
         static PrintWriter screen = new PrintWriter(System.out, true);
         public static void main (String[] args) throws IOException
              double hoursa, minutesa, secondsa;
              String hours;
              System.out.print ("Please enter a number of hours: ");
    hours = keyboard.readLine();
    hoursa = Double.parseDouble(hours); //asks programmer friendly user to enter hours
    String minutes;
    System.out.print ("Please enter a number of minutes: ");
    minutes=keyboard.readLine();
    minutesa = Double.parseDouble(minutes); //asks programmer friendly user to enter minutes
    String seconds;
    System.out.print ("Pretty please enter a number of seconds: ");
    seconds = keyboard.readLine();
    secondsa = Double.parseDouble(seconds); //asks programmer friendly user to enter seconds
    double allseconds;
    allseconds = (hoursa * 3600) + (minutesa * 60) + secondsa; //adds up all the seconds of the time entered
    System.out.println ("You have: " + hours + " hours..."); //displays hours
    System.out.println ("" + minutes + " minutes..."); //displays minutes
    System.out.println ("and " + seconds + " seconds..."); //displays seconds
              System.out.println ("to get whatever you need to done!"); //witty attempt at humor
    System.out.println ("The total amount of seconds is: " + allseconds + " seconds."); //displays total seconds
    // An application that finds the distance between two points when the points
    // are given by the user.
              double x1, x2, y1, y2, total, distance;
              String xa;
              System.out.print ("Please enter the 'x' coordinate of first point: ");
              xa = keyboard.readLine();
              x1 = Double.parseDouble(xa); //asks programmer friendly user to enter first x value
              String ya;
              System.out.print ("...also need the 'y' coordinate of first point: ");
              ya = keyboard.readLine();
              y1= Double.parseDouble(ya); //asks programmer friendly user to enter first y value
              String xb;
              System.out.print ("...and the 'x' coordinate of the second point: ");
              xb = keyboard.readLine();
              x2 = Double.parseDouble(xb); //asks programmer friendly user to enter second x value
              String yb;
              System.out.print ("...don't forget the 'y' coordinate of the second point: ");
              yb = keyboard.readLine();
              y2 = Double.parseDouble(yb); //asks programmer friendly user to enter second y value
              total = Math.pow(x2 - x1, 2.0) + Math.pow(y2 - y1, 2.0); //squares the differences of values
              distance = Math.sqrt(total); //finds the square root of the sum of the differences of the values
              System.out.print ("E=mc^2...oh and,");
              System.out.print ("the distance between point (" + xa +"," + ya +") and point("+
              xb + "," + yb + ") is : " + distance);
    // An application that takes the radius of a sphere and finds and prints
    // the spheres volume and surface area.
              double radius,volume,area;
              String rad;
              System.out.print("Please enter the radius of a sphere: ");
              rad = keyboard.readLine();
              radius = Double.parseDouble(rad); //asks programmer friendly user to enter the radius of a sphere
    DecimalFormat fmt = new DecimalFormat ("0.####");
              volume = ((4 * Math.PI * Math.pow(radius,3.0)) / 3) ;
              System.out.println (" The sphere has a volume of:" + fmt.format(volume)); //finds and displays volume
              area = ( 4 * Math.PI * Math.pow(radius, 2.0)) ;
              System.out.print (" The Surface Area of the sphere is: " + fmt.format(area)); //finds and displays surface area
    // An application that finds the total, in dollars and cents, of a number of quarters,
    // nickels, dimes, and pennies in your piggy bank.
              int pennies, nickels, dimes, quarters;
              double money1;
              screen.println("Empty your piggy bank and count the change, how many quarters ya have?: ");
              int q = (new Integer(keyboard.readLine())).intValue();//asks programmer friendly user to enter a number of quarters
              screen.println("How many dimes?: ");
              int d = (new Integer(keyboard.readLine())).intValue();//asks programmer friendly user to enter a number of dimes
              screen.println("How many nickels?: ");
              int n = (new Integer(keyboard.readLine())).intValue();//asks programmer friendly user to enter a number of nickels
              screen.println("How many pennies?: ");
              int p = (new Integer(keyboard.readLine())).intValue();//asks programmer friendly user to enter a number of pennies
              NumberFormat money = NumberFormat.getCurrencyInstance();
              money1 = (.25 * q) + (.1 * d) + (.05 * n) + (.01 * p);
              screen.println("You're rich! Total, you've got: " + money.format(money1));//finds and displays total money

    Ok here is the working code as one long function:
    // ^ ^
    // (0)(0) A Happy Piggy Application
    // Problems: 2.6,2.8,2.9,2.12 (oo)
    // An application finds the total number of hours, minutes, & seconds, finds the distance
    // between two points, finds the volume and surface area of a sphere, and adds up the change
    // in a jar. First, the total hours, minutes, and seconds problem.
    import java.io.*;
    import java.text.DecimalFormat;
    import java.text.NumberFormat;
    public class twoptsix
        static BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));
        static PrintWriter screen = new PrintWriter(System.out, true);
        public static void main (String[] args) throws IOException
    double hoursa, minutesa, secondsa;
    String hours;
    System.out.print ("Please enter a number of hours: ");
    hours = keyboard.readLine();
    hoursa = Double.parseDouble(hours); //asks programmer friendly user to enter hours
    String minutes;
    System.out.print ("Please enter a number of minutes: ");
    minutes=keyboard.readLine();
    minutesa = Double.parseDouble(minutes); //asks programmer friendly user to enter minutes
    String seconds;
    System.out.print ("Pretty please enter a number of seconds: ");
    seconds = keyboard.readLine();
    secondsa = Double.parseDouble(seconds); //asks programmer friendly user to enter seconds
    double allseconds;
    allseconds = (hoursa * 3600) + (minutesa * 60) + secondsa; //adds up all the seconds of the time entered
    System.out.println ("You have: " + hours + " hours..."); //displays hours
    System.out.println ("" + minutes + " minutes..."); //displays minutes
    System.out.println ("and " + seconds + " seconds..."); //displays seconds
    System.out.println ("to get whatever you need to done!"); //witty attempt at humor
    System.out.println ("The total amount of seconds is: " + allseconds + " seconds."); //displays total seconds
    // }  <----- MAIN FUNCTION USED TO END HERE!!!
    //but we want to keep going so remove the bracket!
    // An application that finds the distance between two points when the points
    // are given by the user.
    // {  <-- other function used to start here, but now it continues
    double x1, x2, y1, y2, total, distance;
    String xa;
    System.out.print ("Please enter the 'x' coordinate of first point: ");
    xa = keyboard.readLine();
    x1 = Double.parseDouble(xa); //asks programmer friendly user to enter first x value
    String ya;
    System.out.print ("...also need the 'y' coordinate of first point: ");
    ya = keyboard.readLine();
    y1= Double.parseDouble(ya); //asks programmer friendly user to enter first y value
    String xb;
    System.out.print ("...and the 'x' coordinate of the second point: ");
    xb = keyboard.readLine();
    x2 = Double.parseDouble(xb); //asks programmer friendly user to enter second x value
    String yb;
    System.out.print ("...don't forget the 'y' coordinate of the second point: ");
    yb = keyboard.readLine();
    y2 = Double.parseDouble(yb); //asks programmer friendly user to enter second y value
    total = Math.pow(x2 - x1, 2.0) + Math.pow(y2 - y1, 2.0); //squares the differences of values
    distance = Math.sqrt(total); //finds the square root of the sum of the differences of the values
    System.out.print ("E=mc^2...oh and,");
    System.out.print ("the distance between point (" + xa +"," + ya +") and point("+
         xb + "," + yb + ") is : " + distance);
    //second function used to end here...
    //} <--- COMMENT OUT BRACKET SO WE CONTINUE
    // An application that takes the radius of a sphere and finds and prints
    // the spheres volume and surface area.
    //{ <--- ANOTHER ONE TO COMMENT OUT
    double radius,volume,area;
    String rad;
    System.out.print("Please enter the radius of a sphere: ");
    rad = keyboard.readLine();
    radius = Double.parseDouble(rad); //asks programmer friendly user to enter the radius of a sphere
    DecimalFormat fmt = new DecimalFormat ("0.####");
    volume = ((4 * Math.PI * Math.pow(radius,3.0)) / 3) ;
    System.out.println (" The sphere has a volume of:" + fmt.format(volume)); //finds and displays volume
    area = ( 4 * Math.PI * Math.pow(radius, 2.0)) ;
    System.out.print (" The Surface Area of the sphere is: " + fmt.format(area)); //finds and displays surface area
    // } <----- COMMENTED OUT FOR THE SAME REASON
    // An application that finds the total, in dollars and cents, of a number of quarters,
    // nickels, dimes, and pennies in your piggy bank.
    //{ <----AND ANOTHER
    int pennies, nickels, dimes, quarters;
    double money1;
    screen.println("Empty your piggy bank and count the change, how many quarters ya have?: ");
    int q = (new Integer(keyboard.readLine())).intValue();//asks programmer friendly user to enter a number of quarters
    screen.println("How many dimes?: ");
    int d = (new Integer(keyboard.readLine())).intValue();//asks programmer friendly user to enter a number of dimes
    screen.println("How many nickels?: ");
    int n = (new Integer(keyboard.readLine())).intValue();//asks programmer friendly user to enter a number of nickels
    screen.println("How many pennies?: ");
    int p = (new Integer(keyboard.readLine())).intValue();//asks programmer friendly user to enter a number of pennies
    NumberFormat money = NumberFormat.getCurrencyInstance();
    money1 = (.25 * q) + (.1 * d) + (.05 * n) + (.01 * p);
    screen.println("You're rich! Total, you've got: " + money.format(money1));//finds and displays total money
    }P.S. To make the code formatted better put [ code ] before and [ /code ] after. It's not perfect, but a little better...

  • Totally New in Java - Please help!!

    Hi Dear all,
    l am totally new in Java, and l facing one problem,and really hope can get some help from yours,please!
    l need to write this program:
    The program should do the following:
    1. Input two fields: action (action: add / delete), and account number (any
    digit or character)
    2. if the action is "add" then the program adds one text line to a text
    file.
    "New account is <account number>"
    3. create the text file if it is not already exist (in c:\)
    4. When program runs again with new input values, a new line will be
    appended to the same file.
    5. if the action is "delete" then the program finds the record and removes
    the text line from the file.
    My problem is :
    l just know that l need to create the user interface first,but l don't know how to go on??
    Would you please show me some step how to solve these problem?
    Many many thanks!!
    BaoBao

    I don't know about Swing. I never use it.
    The stuff to create and manipulate files is in the java.io package.
    You'll probably want to use java.io.FileReader and java.io.FileWriter.
    Note that FileWriter has a constructor that lets you append and not overwrite.
    I'll start you off with a test.
    public class AccountListAddTest() {
      public static void main(String[] argv) {
        AccountList accts = new AccountList();
        accts.add("abcdefg12345"); // arg is a hypothetical account number
    }Write an AccountList class that'll work if you compile and run this test. After you run this test for the first time, the file should contain the string
    New account is abcdefg12345.
    This test assumes that the filename is hardcoded into the AccountList class. To keep it simple, make the add method create a new appending FileWriter each time, write, then close the writer.

  • I am completealy new at java.  HELP!!!!

    K, hi, well, i am experienced in HTML and Macromedia Flash, and Game Maker 5, a shit game maker prog. Ne ways, i admire games like RuneScape and would like to know how i would get around to making one. I know that i can't just jut out and make a rs type game. But i would like to know where to start? Are there programs i need to buy or DL, or are there books? And btw, is Java like HTML where u sit in front of a notepad prog, and type? or is it like u type and see whats happening? or do u add objects and give them properties..... Its a whole lot to ask! lol, Help me out.......try to answer it all.

    Resources for Beginners
    Sun's basic Java tutorial
    Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's Thinking in Java (Available online.)
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java. This one has been getting a lot of very positive comments lately.
    But i would like to know where to start? With reading the "New To Java" tutorials.
    Are there programs i need to buy or DLTo start with you only need Notepad, and the JDK (AKA the Java SDK), downloadable from http://java.sun.com/j2ee/1.4/download-sdk.html
    Later on, you might also want an IDE, or maybe just a better text editor. But for now, just stick with Notepad.
    And btw, is Java like HTML where u sit in front of a notepad prog, and type?Mostly, after writing something (in Notepad), then compile it, then run it. And extra step than HTML has.
    or is it like u type and see whats happening?You can also get interactive shells for it, but for now, do not worry about them.
    r do u add objects and give them propertiesYou can get IDEs which let you work this way, but for now, do not worry about them.

  • 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.

  • New to Java: requires help possible tutor plz read

    Ok, i ma very keen to learn the basics of java, however my experience is limited. When i was studying at the university of london i completed an object orientated programming module based on the the book "javagently". Since that time i have not been programming and am really keen to get into it and make my first (simple) application. i have set up java on my pc and have done a few tutorials around but would really like a reconmendation for a good text book that can take me to this level.
    Let me explain what i intend on building, i play a wargame online called "Medieval:TotalWar - Viking Invasion" basically in this game you buy units for fighting and to make them more effective you can add "valor", "weap" or "armour" all of which increase the cost of the unit. a unit has base stats for different attributes and all of these variables adjust the attributes accordingly.
    All the stats for the units i have in excell and text file format, i would ideally like to have scroll down bars that let you select "unit type", "valor", "weap" and "armour" default being 0 and then the app will display all the attributes that apply to those selected options. In theory i cannot see this being too hard but i just dont know where to start.
    I am looking for a good text book that would help acheive this goal and also possibly a kind person that would be able to answer my silly questions privately without me looking like a fool in front of everyone here ;) on a serious note though i am deadly serious about completing this even if it takesa few months to get a grasp, if you have any inptu whatsoever it would be greatly appreciated no matter how small it may seem. if you want to see the txt file it is available here http://kenchi.mysite.freeserve.com/VIKINGS_UNIT_PROD.TXT as an example i also can get it on an excel sheet if it is easier to handle but at moment i can just about copy a txt file let alone do anything else with it.
    thanks in advance
    Baz
    please feel free to reply or email me at [email protected] or if you are really keen visit www.clankenchikuka.com, Baz is my profile.

    i m not sure, if sombody will read ur Q.
    this is not a Q, this is a history.
    who care if u study or u still.
    we ask like this.
    hi, // this is ok :)
    i use xxx // for example JFrame.
    i get Error xxxx // for example class not found.
    please help.
    enough.
    and now filter ur Q, if u would like to get an answer. minimum from me.

  • New to Java, Please help

    Hi, I was trying to play a game and came up with this java error (below), I uninstalled and reinstalled still no fix. I think i need a new class?, If anyone can explain the potential problem to me and help me fix it, that would be much appreciated. I'm a complete NEWB when it comes to java, I'm not even sure how to edit that code. so please remember to explain in the newbiest of newby answers. I am proficient with features of a computer just not java.
    Java Plug-in 1.6.0_24
    Using JRE version 1.6.0_24-b07 Java HotSpot(TM) Client VM
    User home directory = C:\Users\Ethan
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    load: class loader.class not found.
    java.lang.ClassNotFoundException: loader.class
    at sun.plugin2.applet.Applet2ClassLoader.fi… Source)
    at sun.plugin2.applet.Plugin2ClassLoader.lo… Source)
    at sun.plugin2.applet.Plugin2ClassLoader.lo… Source)
    at sun.plugin2.applet.Plugin2ClassLoader.lo… Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.lo… Source)
    at sun.plugin2.applet.Plugin2Manager.create… Source)
    at sun.plugin2.applet.Plugin2Manager$Applet… Source)
    at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.ClassNotFoundException: loader.class

    845681 wrote:
    Hi, I was trying to play a game and came up with this java error (below), I uninstalled and reinstalled still no fix. I think i need a new class?, If anyone can explain the potential problem to me and help me fix it, that would be much appreciated. I'm a complete NEWB when it comes to java, I'm not even sure how to edit that code. so please remember to explain in the newbiest of newby answers. I am proficient with features of a computer just not java.If you want to learn how to program java, which is not the same as playing that particular game then you can start with the following link.
    http://download.oracle.com/javase/tutorial/getStarted/index.html

  • M new to this forum + new to java please help me with file handling program

    hi i want to make a file handling program where in i want to input a text file say f1 whose style is mentioned as below
    aaa...bcd
    aaabbc
    acdce
    a..dd
    abbcd
    now i want to write d out put of file f1 to file f2 but only those string entries widout any ... in them how to do that :-(( please help :((

    import java.io.*;
    import java.lang.*;
    class javcsse{
             void javsce (){
              BufferedReader in;
            PrintWriter out;
            String line;
            try
                in = new BufferedReader(new FileReader("e:\\cntcs\\n7.txt"));
                out = new PrintWriter("e:\\cntcs\\n8.txt");
               line = in.readLine();
               while(line != null)
                     if(line.contains("...") && line.contains("....")){
                         break ;                
                         else{
                               if(line.contains("cc"))
                              System.out.println(line+"\n");
                                      out.println(line);
                    line = in.readLine();
                in.close();
                out.close();
            } catch (Exception ex)
                System.err.println(ex.getMessage());
      public class javcse{
        public static void main(String[] args) {
            new javcsse();
    }hey i wrote this code yet could u tell y is it still not working :((

  • I am new to java please help!!

    please help ive got a method thta i wanto to use it in another class, but it does not work.
    //prueba.java
    import java.io.*;
    public class prueba
    public int numero3;
    public int suma(int numero1,int numero2)
    int numero3=numero1+numero2;
    return numero3;
    //prueba1.java
    import javax.servlet.*;
    import java.io.*;
    import javax.servlet.http.*;
    import prueba;
    public class prueba1 extends HttpServlet
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    PrintWriter out = res.getWriter();
    int num1=1;
    int num2=1;
    prueba uno=new prueba();
    out.println(uno.suma(2,3));
    when i ty to complie this file it throws me thie errors:
    C:\resin-2.0.b2\doc\content-manager\admin\web-inf\classes\prueba1.java:4: cannot resolve symbol
    symbol: class prueba
    import prueba;
    ^
    C:\resin-2.0.b2\doc\content-manager\admin\web-inf\classes\prueba1.java:15: cannot resolve symbol
    symbol : class prueba
    location: class prueba1
    prueba uno=new prueba();
    ^
    C:\resin-2.0.b2\doc\content-manager\admin\web-inf\classes\prueba1.java:15: cannot resolve symbol
    symbol : class prueba
    location: class prueba1
    prueba uno=new prueba();
    ^
    3 errors
    Tool completed with exit code 1
    both , prueba1.java and prueba.java are in the same folder.

    C:\resin-2.0.b2\doc\content-manager\admin\web-inf\classes\prueba1.java:15: cannot resolve symbol
    symbol : class prueba
    location: class prueba1
         prueba uno=new prueba();
    ^
    C:\resin-2.0.b2\doc\content-manager\admin\web-inf\classes\prueba1.java:15: cannot resolve symbol
    symbol : class prueba
    location: class prueba1
         prueba uno=new prueba();
    ^
    2 errors

Maybe you are looking for

  • I can't see my country name when I tried to log into iTunes Store for first time

    Hi, Couple of days ago, I successfully registered in iOS Developer Program. All of the process is completed. Today I tried to log into iTunes Strore from my mac. But it asked me "This Apple ID has not been used with the iTuens Store" Please review yo

  • Unable to install Acrobat 7.0

    After multiple install/uninstalls, I am unable to install Acrobat 7.0.  I have cs2 and windows xp. The other programs (GoLive, Illustrator, etc) appear as install options but the Acrobat 7.0 does not. (It is greyed out). Can anyone assist me on this?

  • Importing XML using AppleScript in CS5.

    Hi, totally new to inDesign but do programming and database work.  I am looking to import an XML file created from our database.  I can do a basic import manually after creating document and importing xml to load tags then creating text box element a

  • Songs wont drag

    I can't drag any songs to new playlist folder or any folder for that matter. What's the matter? Can it be fixed?

  • Peoplesoft messages missing

    We have Peoplesoft HRMS and out of 100 messages sent by peoplesoft, only few are being processed in OIM and rest are not If we try to process the same XML messages again, it gets processed There is no stuck or failed messages in Integration Broker. S