Help with Mail program

Hello,
I am having trouble with my Mail program. Since turning on my computer this morning, I cannot get the program to respond. It will open, but it just sits with the timer going, and none of the emails show up. I have to do a force quit on it and do not know where to go (as far as settings etc.), or what I need to check into to figure out the problem. Does anyone have suggestions, or are familiar with the problem?
Thank you very much for any help,
Keri

Check the console (in the Utilities folder) for errors.

Similar Messages

  • Help with Paint program.

    Hello. I am somewhat new to Java and I was recently assigned to do a simple paint program. I have had no trouble up until my class started getting into the graphical functions of Java. I need help with my program. I am supposed to start off with a program that draws lines and changes a minimum of 5 colors. I have the line function done but my color change boxes do not work and I am able to draw inside the box that is supposed to be reserved for color buttons. Here is my code so far:
    // Lab13110.java
    // The Lab13 program assignment is open ended.
    // There is no provided student version for starting, nor are there
    // any files with solutions for the different point versions.
    // Check the Lab assignment document for additional details.
    import java.applet.Applet;
    import java.awt.*;
    public class Lab13110 extends Applet
         int[] startX,startY,endX,endY;
         int currentStartX,currentStartY,currentEndX,currentEndY;
         int lineCount;
         Rectangle red, green, blue, yellow, black;
         int numColor;
         Image virtualMem;
         Graphics gBuffer;
         int rectheight,rectwidth;
         public void init()
              startX = new int[100];
              startY = new int[100];
              endX = new int[100];
              endY = new int[100];
              lineCount = 0;
              red = new Rectangle(50,100,25,25);
              green = new Rectangle(50,125,25,25);
              blue = new Rectangle(50,150,25,25);
              yellow = new Rectangle(25,112,25,25);
              black = new Rectangle(25,137,25,25);
              numColor = 0;
              virtualMem = createImage(100,600);
              gBuffer = virtualMem.getGraphics();
              gBuffer.drawRect(0,0,100,600);
         public void paint(Graphics g)
              for (int k = 0; k < lineCount; k++)
                   g.drawLine(startX[k],startY[k],endX[k],endY[k]);
              g.drawLine(currentStartX,currentStartY,currentEndX,currentEndY);
              g.setColor(Color.red);
              g.fillRect(50,100,25,25);
              g.setColor(Color.green);
              g.fillRect(50,125,25,25);
              g.setColor(Color.blue);
              g.fillRect(50,150,25,25);
              g.setColor(Color.yellow);
              g.fillRect(25,112,25,25);
              g.setColor(Color.black);
              g.fillRect(25,137,25,25);
              switch (numColor)
                   case 1:
                        g.setColor(Color.red);
                        break;
                   case 2:
                        g.setColor(Color.green);
                        break;
                   case 3:
                        g.setColor(Color.blue);
                        break;
                   case 4:
                        g.setColor(Color.yellow);
                        break;
                   case 5:
                        g.setColor(Color.black);
                        break;
                   case 6:
                        g.setColor(Color.black);
                        break;
              g.setColor(Color.black);
              g.drawRect(0,0,100,575);
         public boolean mouseDown(Event e, int x, int y)
              currentStartX = x;
              currentStartY = y;
              if(red.inside(x,y))
                   numColor = 1;
              else if(green.inside(x,y))
                   numColor = 2;
              else if(blue.inside(x,y))
                   numColor = 3;
              else if(yellow.inside(x,y))
                   numColor = 4;
              else if(black.inside(x,y))
                   numColor = 5;
              else
                   numColor = 6;
              repaint();
              return true;
         public boolean mouseDrag(Event e, int x, int y)
              int Rectheight = 500;
              int Rectwidth = 900;
              currentEndX = x;
              currentEndY = y;
              Rectangle window = new Rectangle(0,0,900,500);
              //if (window.inside(Rectheight,Rectwidth))
                   repaint();
              return true;
         public boolean mouseUp(Event e, int x, int y)
              int Rectheight = 500;
              int Rectwidth = 900;
              startX[lineCount] = currentStartX;
              startY[lineCount] = currentStartY;
              endX[lineCount] = x;
              endY[lineCount] = y;
              lineCount++;
              Rectangle window = new Rectangle(0,0,900,500);
              if (window.inside(Rectheight,Rectwidth))
                   repaint();
              return true;
         public void Rectangle(Graphics g, int x, int y)
              g.setColor(Color.white);
              Rectangle screen = new Rectangle(100,0,900,600);
    }If anyone could point me in the right direction of how to go about getting my buttons to work and fixing the button box, I would be greatly appreciative. I just need to get a little bit of advice and I think I should be good after I get this going.
    Thanks.

    This isn't in any way a complete solution, but I'm posting code for a mouse drag outliner. This may be preferable to how you are doing rectangles right now
    you are welcome to use and modify this code but please do not change the package and make sure that you tell your teacher where you got it from
    MouseDragOutliner.java
    package tjacobs.ui;
    import java.awt.BasicStroke;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Container;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Point;
    import java.awt.Stroke;
    import java.awt.event.*;
    import java.util.ArrayList;
    import java.util.Iterator;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    * See the public static method addAMouseDragOutliner
    public class MouseDragOutliner extends MouseAdapter implements MouseMotionListener {
         public static final BasicStroke DASH_STROKE = new BasicStroke(1.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_BEVEL, 10.0f, new float[] {8, 8}, 0);
         private boolean mUseMove = false;
         private Point mStart;
         private Point mEnd;
         private Component mComponent;
         private MyRunnable mRunner= new MyRunnable();
         private ArrayList mListeners = new ArrayList(1);
         public MouseDragOutliner() {
              super();
         public MouseDragOutliner(boolean useMove) {
              this();
              mUseMove = useMove;
         public void mouseDragged(MouseEvent me) {
              doMouseDragged(me);
         public void mousePressed(MouseEvent me) {
              mStart = me.getPoint();
         public void mouseEntered(MouseEvent me) {
              mStart = me.getPoint();
         public void mouseReleased(MouseEvent me) {
              Iterator i = mListeners.iterator();
              Point end = me.getPoint();
              while (i.hasNext()) {
                   ((OutlineListener)i.next()).mouseDragEnded(mStart, end);
              //mStart = null;
         public void mouseMoved(MouseEvent me) {
              if (mUseMove) {
                   doMouseDragged(me);
         public     void addOutlineListener(OutlineListener ol) {
              mListeners.add(ol);
         public void removeOutlineListener(OutlineListener ol) {
              mListeners.remove(ol);
         private class MyRunnable implements Runnable {
              public void run() {
                   Graphics g = mComponent.getGraphics();
                   if (g == null) {
                        return;
                   Graphics2D g2 = (Graphics2D) g;
                   Stroke s = g2.getStroke();
                   g2.setStroke(DASH_STROKE);
                   int x = Math.min(mStart.x, mEnd.x);
                   int y = Math.min(mStart.y, mEnd.y);
                   int w = Math.abs(mEnd.x - mStart.x);
                   int h = Math.abs(mEnd.y - mStart.y);
                   g2.setXORMode(Color.WHITE);
                   g2.drawRect(x, y, w, h);
                   g2.setStroke(s);
         public void doMouseDragged(MouseEvent me) {
              mEnd = me.getPoint();
              if (mStart != null) {
                   mComponent = me.getComponent();
                   mComponent.repaint();
                   SwingUtilities.invokeLater(mRunner);
         public static MouseDragOutliner addAMouseDragOutliner(Component c) {
              MouseDragOutliner mdo = new MouseDragOutliner();
              c.addMouseListener(mdo);
              c.addMouseMotionListener(mdo);
              return mdo;
         public static interface OutlineListener {
              public void mouseDragEnded(Point start, Point finish);
         public static void main(String[] args) {
              JFrame f = new JFrame("MouseDragOutliner Test");
              Container c = f.getContentPane();
              JPanel p = new JPanel();
              //p.setBackground(Color.BLACK);
              c.add(p);
              addAMouseDragOutliner(p);
              f.setBounds(200, 200, 400, 400);
              f.addWindowListener(new WindowClosingActions.Exit());
              f.setVisible(true);
    }

  • I desperately need help with Mail, specifically sending

    For Starters:  I am on OSX 10.9.2 and am trying to use mail 7.2.
    https://discussions.apple.com/post!input.jspa?container=2998&containerType=14&qu estion=I+desperately+need+help+with+Mail%2C+specifically+sending
    I cannot send.  I have been at this for hours and hours and hours.  Here are the details.
    my mail server however is s1.sistercompany.net
    I can receive email just fine.  I can also send mail just find having set this up on my iphone and also in thunderbird (which i hate hate hate hate hate hate hate, which is why I am desperate to set up mail)
    The settings in thunderbird are as follows:
    Servername: s1.sistercompany.net
    port: 465
    Authentication method:  normal password
    Connection Security:  SSL/TLS
    However, I just can't get this to work in Mail.  When I write an email and hit send I get a popup that says:
    Cannot send message using the server s1.sistercompany.net
    The certifcate for this server is invalid.
    Now, my tech guy says yeah the certifacte is invalid because you are going through sistercompany server, there should be some way to just accept the certifcate anyway (but he has never used mail before).
    So I have serached around and come up with this: http://support.apple.com/kb/PH11706
    Which tells me to use the verify certificate dialogue, which I would do except there is no verify certificate dialog.  Any thoughts?
    <Email Edited by Host>

    I don't have a problem watching the Lost episode on abc.com, using a stock MacBook with 512MB RAM. I don't know what technology abc.com uses in their viewer, but I have Flip4Mac and the latest version of Flash player installed.

  • Help with sycning with Mail program

    I use the Mail program on our iMac, which syncs with my yahoo account. However, the folders I have set up through the Mail program differ from yahoo and Mail simply syncs the emails themselves. How do I get my iPhone to sync with Mail instead of yahoo. I could only figure out a way to sync the iPhone with my yahoo account/folders instead of the Mail program & folders. Can anyone help me?
    Thanks.

    Email account mailboxes and messages are not included with the iTunes sync process.
    If you want mailboxes and messages synced, you need to switch to an IMAP account which is specifically designed to accessing the account with more than one email client. All server stored mailboxes with an IMAP account are kept synchronized with the server automatically with each email client used to access the account.
    Creating a Yahoo account with the Yahoo account preset on the iPhone creates the account as an IMAP account, but Yahoo does not support accessing a Yahoo account as an IMAP account with any other email client.
    Google supports accessing a Gmail account as an IMAP account with an email client on your computer and with the iPhone's Mail client. The same with a MobileMe account.

  • Why can't I send photos with mail program?

    Up until recently, I have been able to send my iPhotos in my mail program, but it gives me a message that "Cannot send message using the Server smtp.earthlink.net
    I think it has to do with my Account set up, but not sure...I am frustrated as I have some pictures I want to send. Any help is appreciated here !! Thanks in advance for your help !!

    Kathee
    That is an issue with your Account. You need to talk to Earthlink technical suport or post on the Mail forum.
    Regards
    TD

  • Help! Mail program not working anymore!

    Hi there-
    All of the sudden my mac mail program is not working. I click on it, and it appears to launch, but then never starts up or anything, and I can't see the menu bar at the top when I click on the application icon.
    Could this be because I have too many mail messages? If so, how do I fix it???
    Help! I need my email account back!!
    Thanks.

    Hello Heidi.
    Check Multiple applications quit unexpectedly or fail to launch. Although this indicates when this occurs with multiple applications, the same troubleshooting steps apply.
    Perform the troubleshooting steps in the order provided with the exception of re-installing the Mail.app if you get that far. If the previous troubleshooting steps do not resolve it, IMO it is best to target the Mail.app preference file first and if you need the instructions for doing so, let me know.

  • Need help with Mail address book and calendar.

    Hello,
    I am a new Mac User. I just purchased my first MacBook. My goal is to switch totally over to Mac for both home and work. I was able to get the mail program to pull down my exchange mail, however it does not appear to have taken in my address book.
    My goal would be for my machine to totally sync up with my mail, and calendar the same way that my iPhone does. Is there a way to do this?
    If I can't get my contacts and calendar to "sync". I will not be able to use my Mac at work.
    Any help or assistance would be greatly appreciated.
    Regards,
    Jason

    I do not believe you can sync your data between Outlook and Address Book and iCal. You can transfer data using a third-party utility, Outlook2Mac. However, you could integrate with your Outlook account using Entourage, one of the Office 2008 applications. You would have to purchase Microsoft Office 2008.

  • Please help with mail!

    Can anybody help me with resetting my mail? Right now everytime I click on the mail icon a box pops up asking me for a password which it never takes. I don't know what to do. Please help!
    MacBookPro   Mac OS X (10.4.8)  

    Same problem, but only on my iBook. Mail with identical preferences works fine on the iMac. Have reset accounts, but mail just spins for about 30 minutes trying to download. Also if I identify anything as "Junk" the program immediately freezes causing me to force quit. The message in force quit is that "Mail is not responding."
    This happens both in wireless and wired mode. Passwords appear to be OK. Is it possible for the mail program to become corrupted, and if so how do I go about reinstalling?

  • HELP: My mail program is running at a snail's pace...

    My Mail program has slowed to a crawl. Everything else on my computer is running fine, but even with nothing else running, every single function takes forever. Things that should be instantaneous (selecting text, positioning the cursor, changing font, etc.) takes several minutes. It's almost unusable.
    I've looked online, and followed the instructions:
    (from: http://danwarne.com/is-apple-mail-running-slow-speed-it-up/)
    "You can check your current 'envelope archive' size by entering this in the terminal:
    ls -lah ~/Library/Mail/Envelope\ Index
    Then to optimise it (cleans out stuff that has been marked for deletion but not actually deleted, defragments the structure, etc):
    sqlite3 ~/Library/Mail/Envelope\ Index vacuum;
    Then check your envelope archive size again to see the results…
    ls -lah ~/Library/Mail/Envelope\ Index
    It compacted my envelope archive down from 55MB to 50MB — not a huge increase, but the speed difference was dramatic.
    In particular, my 'sent mail' folder which had been taking 10 – 15 seconds to open (8,000 items) now only takes two or three seconds."
    That didn't work, so I tried this:
    (from: http://www.macworld.com/article/56673/2007/03/mailfix.html)
    "The Brute Force solution
    This solution forces Mail to build a completely new Envelope Index from scratch. It’s not my preferred solution, but it will ensure that you’re starting with a completely clean index file.
    Quit Mail, and in the Finder, navigate to your user’s Libary -> Mail folder, and then move the file named Envelope Index out to the desktop. When you relaunch Mail, it will tell you it needs to import your messages. Click Continue and then just wait—it took about a minute to import 9,900 messages on my MacBook Pro. When the import is done, you should be looking at Mail just as it was before—but with any luck it will be running more quickly, and any odd message-related issues you were having should be resolved."
    That didn't work either.
    I check my Activity Monitor and have at least 80% of my cpu idle, and about 960 mb free system memory, so there doesn't seem to be anything hogging up the processors.
    My livelihood is dependent upon access to email. If anyone has any suggestions, please let me know ASAP.
    Thanks very much!
    TRUE
    TRUE(at)TRUEart(dot)biz

    My Mail program has slowed to a crawl. Everything else on my computer is running fine, but even with nothing else running, every single function takes forever. Things that should be instantaneous (selecting text, positioning the cursor, changing font, etc.) takes several minutes. It's almost unusable.
    I've looked online, and followed the instructions:
    (from: http://danwarne.com/is-apple-mail-running-slow-speed-it-up/)
    "You can check your current 'envelope archive' size by entering this in the terminal:
    ls -lah ~/Library/Mail/Envelope\ Index
    Then to optimise it (cleans out stuff that has been marked for deletion but not actually deleted, defragments the structure, etc):
    sqlite3 ~/Library/Mail/Envelope\ Index vacuum;
    Then check your envelope archive size again to see the results…
    ls -lah ~/Library/Mail/Envelope\ Index
    It compacted my envelope archive down from 55MB to 50MB — not a huge increase, but the speed difference was dramatic.
    In particular, my 'sent mail' folder which had been taking 10 – 15 seconds to open (8,000 items) now only takes two or three seconds."
    That didn't work, so I tried this:
    (from: http://www.macworld.com/article/56673/2007/03/mailfix.html)
    "The Brute Force solution
    This solution forces Mail to build a completely new Envelope Index from scratch. It’s not my preferred solution, but it will ensure that you’re starting with a completely clean index file.
    Quit Mail, and in the Finder, navigate to your user’s Libary -> Mail folder, and then move the file named Envelope Index out to the desktop. When you relaunch Mail, it will tell you it needs to import your messages. Click Continue and then just wait—it took about a minute to import 9,900 messages on my MacBook Pro. When the import is done, you should be looking at Mail just as it was before—but with any luck it will be running more quickly, and any odd message-related issues you were having should be resolved."
    That didn't work either.
    I check my Activity Monitor and have at least 80% of my cpu idle, and about 960 mb free system memory, so there doesn't seem to be anything hogging up the processors.
    My livelihood is dependent upon access to email. If anyone has any suggestions, please let me know ASAP.
    Thanks very much!
    TRUE
    TRUE(at)TRUEart(dot)biz

  • Need some help with a program Please.

    Well, im new here, im new to java, so i need your help, i have to make a connect four program, my brother "Kind of" helped me and did a program for me, but the problem is i cant use some of those commands in the program and i have to replace them with what ive learned, so i will post the program and i will need your help to modify it for me.
    and for these programs, also i want help for:
    They have errors and i cant fix'em
    the commands that i've leaned:
    If statements, for loops, while loops,do while, strings, math classes, swithc statement, else if,logical operators,methods, one and two dimensional arrays.
    Thanx in advance,
    truegunner
    // Fhourstones 3.0 Board Logic
    // Copyright 2000-2004 John Tromp
    import java.io.*;
    class Connect4 {
    static long color[]; // black and white bitboard
    static final int WIDTH = 7;
    static final int HEIGHT = 6;
    // bitmask corresponds to board as follows in 7x6 case:
    // . . . . . . . TOP
    // 5 12 19 26 33 40 47
    // 4 11 18 25 32 39 46
    // 3 10 17 24 31 38 45
    // 2 9 16 23 30 37 44
    // 1 8 15 22 29 36 43
    // 0 7 14 21 28 35 42 BOTTOM
    static final int H1 = HEIGHT+1;
    static final int H2 = HEIGHT+2;
    static final int SIZE = HEIGHT*WIDTH;
    static final int SIZE1 = H1*WIDTH;
    static final long ALL1 = (1L<<SIZE1)-1L; // assumes SIZE1 < 63
    static final int COL1 = (1<<H1)-1;
    static final long BOTTOM = ALL1 / COL1; // has bits i*H1 set
    static final long TOP = BOTTOM << HEIGHT;
    int moves[],nplies;
    byte height[]; // holds bit index of lowest free square
    public Connect4()
    color = new long[2];
    height = new byte[WIDTH];
    moves = new int[SIZE];
    reset();
    void reset()
    nplies = 0;
    color[0] = color[1] = 0L;
    for (int i=0; i<WIDTH; i++)
    height[i] = (byte)(H1*i);
    public long positioncode()
    return 2*color[0] + color[1] + BOTTOM;
    // color[0] + color[1] + BOTTOM forms bitmap of heights
    // so that positioncode() is a complete board encoding
    public String toString()
    StringBuffer buf = new StringBuffer();
    for (int i=0; i<nplies; i++)
    buf.append(1+moves);
    buf.append("\n");
    for (int w=0; w<WIDTH; w++)
    buf.append(" "+(w+1));
    buf.append("\n");
    for (int h=HEIGHT-1; h>=0; h--) {
    for (int w=h; w<SIZE1; w+=H1) {
    long mask = 1L<<w;
    buf.append((color[0]&mask)!= 0 ? " @" :
    (color[1]&mask)!= 0 ? " 0" : " .");
    buf.append("\n");
    if (haswon(color[0]))
    buf.append("@ won\n");
    if (haswon(color[1]))
    buf.append("O won\n");
    return buf.toString();
    // return whether columns col has room
    final boolean isplayable(int col)
    return islegal(color[nplies&1] | (1L << height[col]));
    // return whether newboard lacks overflowing column
    final boolean islegal(long newboard)
    return (newboard & TOP) == 0;
    // return whether newboard is legal and includes a win
    final boolean islegalhaswon(long newboard)
    return islegal(newboard) && haswon(newboard);
    // return whether newboard includes a win
    final boolean haswon(long newboard)
    long y = newboard & (newboard>>HEIGHT);
    if ((y & (y >> 2*HEIGHT)) != 0) // check diagonal \
    return true;
    y = newboard & (newboard>>H1);
    if ((y & (y >> 2*H1)) != 0) // check horizontal -
    return true;
    y = newboard & (newboard>>H2); // check diagonal /
    if ((y & (y >> 2*H2)) != 0)
    return true;
    y = newboard & (newboard>>1); // check vertical |
    return (y & (y >> 2)) != 0;
    void backmove()
    int n;
    n = moves[--nplies];
    color[nplies&1] ^= 1L<<--height[n];
    void makemove(int n)
    color[nplies&1] ^= 1L<<height[n]++;
    moves[nplies++] = n;
    public static void main(String argv[])
    Connect4 c4;
    String line;
    int col=0, i, result;
    long nodes, msecs;
    c4 = new Connect4();
    c4.reset();
    BufferedReader dis = new BufferedReader(new InputStreamReader(System.in));
    for (;;) {
    System.out.println("position " + c4.positioncode() + " after moves " + c4 + "enter move(s):");
    try {
    line = dis.readLine();
    } catch (IOException e) {
    System.out.println(e);
    System.exit(0);
    return;
    if (line == null)
    break;
    for (i=0; i < line.length(); i++) {
    col = line.charAt(i) - '1';
    if (col >= 0 && col < WIDTH && c4.isplayable(col))
    c4.makemove(col);
    By the way im using Ready to program for the programming.

    You can't really believe that his brother did this
    for him...I did miss that copyright line at the beginning when
    I first looked it over, but you know, if it had been
    his brother, I'd be kinda impressed. This wasn't a
    25 line program. It actually would have required
    SOME thought. I doubt my brother woulda done that
    for me (notwithstanding the fact that I wouldn't need
    help for that program, and my brother isn't a
    programmer).I originally missed the comments at the top but when I saw the complexity of what was written then I knew that it was too advanced for a beginner and I relooked through the code and saw the comments.

  • Help with Payroll program

    Hello I need help with the following code for a Payroll program.
    //CheckPoint: Payroll Program Part 3
    //Java Programming IT215
    //Arianne Gallegos
    //05/02/2007
    //Payroll3.java
    //Payroll program that calculates the weekly pay for an employee.
    import java.util.Scanner; // program uses class Scanner
    public class Payroll3
         private string name;
         private double rate;
         private double hours;
         // Constructor to store Employee Data
         public EmployeeData( String nameOfEmployee, double hourlyRate, double hoursWorked )
              name = nameOfEmployee;
              rate = hourlyRate;
              hours = hoursWorked;
         } // end constructor
    } //end class EmployeeData
       // main method begins execution of java application
       public static void main( String args[] )
          System.out.println( "Welcome to the Payroll Program! " );
          boolean quit = false; // This flag will control whether we exit the loop below
          // Loop until user types "quit" as the employee name:
          while (!quit)
           // create scanner to obtain input from command window
            Scanner input = new Scanner ( System.in );
            System.out.println();  // outputs a blank line
            System.out.print( "Please enter the employee name or quit to terminate program: " );
            // prompt for and input employee name
            String nameOfEmployee = input.nextLine(); // read what user has inputted
            if ( nameOfEmployee.equals("quit")) // Check whether user indicated to quit program
              System.out.println( "Program has ended" );
              quit = true;
    else
              // User did not indicate to stop, so continue reading info for this iteration:
              float hourlyRate; // first number to multiply
              float hoursWorked; // second number to multiply
              float product; // product of hourlyRate and hoursWorked
              System.out.print( "Enter hourly rate: " ); // prompt
              hourlyRate = input.nextFloat(); // read first number from user
              while (hourlyRate <= 0) // prompt until a positive value is entered
                 System.out.print( "Hourly rate must be a positive value. " +
                   "Please enter the hourly rate again: " ); // prompt for positive value for hourly rate
                  hourlyRate = input.nextFloat(); // read first number again
              System.out.print( "Enter hours worked: " ); // prompt
              hoursWorked = input.nextFloat(); // read second number from user
              while (hoursWorked <= 0) // prompt until a positive value is entered
                 System.out.print( "Hours worked must be a positive value. " +
                   "Please enter the hours worked again: " ); // prompt for positive value for hours worked
                  hoursWorked = input.nextFloat(); // read second number again
              product = (float) hourlyRate * hoursWorked; // multiply the hourly rate by the hours worked
              // Display output for this iteration
              System.out.println(); // outputs a blank line
              System.out.print( nameOfEmployee ); // display employee name
              System.out.printf( "'s weekly pay is: $%,.2f\n", product);  // display product
              System.out.println(); // outputs a blank line
          // Display ending message:
          System.out.println( "Thank you for using the Payroll program!" );
          System.out.println(); // outputs a blank line
       } // end method main
    } // end class Payroll3I am getting the following errors:
    Payroll3.java:18: invalid method declaration; return type required
    public EmployeeData( String nameOfEmployee, double hourlyRate, double hours
    Worked )
    ^
    Payroll3.java:28: class, interface, or enum expected
    public static void main( String args[] )
    ^
    Payroll3.java:33: class, interface, or enum expected
    boolean quit = false; // This flag will control whether we exit the loop b
    elow
    ^
    Payroll3.java:36: class, interface, or enum expected
    while (!quit)
    ^
    Payroll3.java:42: class, interface, or enum expected
    System.out.println(); // outputs a blank line
    ^
    Payroll3.java:43: class, interface, or enum expected
    System.out.print( "Please enter the employee name or quit to terminate p
    rogram: " );
    ^
    Payroll3.java:45: class, interface, or enum expected
    String nameOfEmployee = input.nextLine(); // read what user has inputted
    ^
    Payroll3.java:48: class, interface, or enum expected
    if ( nameOfEmployee.equals("quit")) // Check whether user indicated to q
    uit program
    ^
    Payroll3.java:51: class, interface, or enum expected
    quit = true;
    ^
    Payroll3.java:52: class, interface, or enum expected
    ^
    Payroll3.java:57: class, interface, or enum expected
    float hoursWorked; // second number to multiply
    ^
    Payroll3.java:58: class, interface, or enum expected
    float product; // product of hourlyRate and hoursWorked
    ^
    Payroll3.java:60: class, interface, or enum expected
    System.out.print( "Enter hourly rate: " ); // prompt
    ^
    Payroll3.java:61: class, interface, or enum expected
    hourlyRate = input.nextFloat(); // read first number from user
    ^
    Payroll3.java:64: class, interface, or enum expected
    while (hourlyRate <= 0) // prompt until a positive value is entered
    ^
    Payroll3.java:68: class, interface, or enum expected
    hourlyRate = input.nextFloat(); // read first number again
    ^
    Payroll3.java:69: class, interface, or enum expected
    ^
    Payroll3.java:72: class, interface, or enum expected
    hoursWorked = input.nextFloat(); // read second number from user
    ^
    Payroll3.java:75: class, interface, or enum expected
    while (hoursWorked <= 0) // prompt until a positive value is entered
    ^
    Payroll3.java:79: class, interface, or enum expected
    hoursWorked = input.nextFloat(); // read second number again
    ^
    Payroll3.java:80: class, interface, or enum expected
    ^
    Payroll3.java:86: class, interface, or enum expected
    System.out.println(); // outputs a blank line
    ^
    Payroll3.java:87: class, interface, or enum expected
    System.out.print( nameOfEmployee ); // display employee name
    ^
    Payroll3.java:88: class, interface, or enum expected
    System.out.printf( "'s weekly pay is: $%,.2f\n", product); // display
    product
    ^
    Payroll3.java:89: class, interface, or enum expected
    System.out.println(); // outputs a blank line
    ^
    Payroll3.java:91: class, interface, or enum expected
    ^
    Payroll3.java:96: class, interface, or enum expected
    System.out.println(); // outputs a blank line
    ^
    Payroll3.java:98: class, interface, or enum expected
    } // end method main
    ^
    The problem I am having is getting the constructor to work with the rest of the program can someone please point out to me how to correct this. I have read my textbook as well as tutorials but I just don't seem to get it right. Please help.
    P.S. I have never taken a programming class before so please be kind.

    Ok, I changed the name of the constructor:
    //CheckPoint: Payroll Program Part 3
    //Java Programming IT215
    //Arianne Gallegos
    //04/23/2007
    //Payroll3.java
    //Payroll program that calculates the weekly pay for an employee.
    import java.util.Scanner; // program uses class Scanner
    public class Payroll3
         private string name;
         private float rate;
         private float hours;
         // Constructor to store Employee Data
         public void Payroll3( string nameOfEmployee, float hourlyRate, float hoursWorked )
              name = nameOfEmployee;
              rate = hourlyRate;
              hours = hoursWorked;
         } // end constructor
    } //end class EmployeeData
       // main method begins execution of java application
       public static void main( String args[] )
          System.out.println( "Welcome to the Payroll Program! " );
          boolean quit = false; // This flag will control whether we exit the loop below
          // Loop until user types "quit" as the employee name:
          while (!quit)
           // create scanner to obtain input from command window
            Scanner input = new Scanner ( System.in );
            System.out.println();  // outputs a blank line
            System.out.print( "Please enter the employee name or quit to terminate program: " );
            // prompt for and input employee name
            String nameOfEmployee = input.nextLine(); // read what user has inputted
            if ( nameOfEmployee.equals("quit")) // Check whether user indicated to quit program
              System.out.println( "Program has ended" );
              quit = true;
    else
              // User did not indicate to stop, so continue reading info for this iteration:
              float hourlyRate; // first number to multiply
              float hoursWorked; // second number to multiply
              float product; // product of hourlyRate and hoursWorked
              System.out.print( "Enter hourly rate: " ); // prompt
              hourlyRate = input.nextFloat(); // read first number from user
              while (hourlyRate <= 0) // prompt until a positive value is entered
                 System.out.print( "Hourly rate must be a positive value. " +
                   "Please enter the hourly rate again: " ); // prompt for positive value for hourly rate
                  hourlyRate = input.nextFloat(); // read first number again
              System.out.print( "Enter hours worked: " ); // prompt
              hoursWorked = input.nextFloat(); // read second number from user
              while (hoursWorked <= 0) // prompt until a positive value is entered
                 System.out.print( "Hours worked must be a positive value. " +
                   "Please enter the hours worked again: " ); // prompt for positive value for hours worked
                  hoursWorked = input.nextFloat(); // read second number again
              product = (float) hourlyRate * hoursWorked; // multiply the hourly rate by the hours worked
              // Display output for this iteration
              System.out.println(); // outputs a blank line
              System.out.print( nameOfEmployee ); // display employee name
              System.out.printf( "'s weekly pay is: $%,.2f\n", product);  // display product
              System.out.println(); // outputs a blank line
          // Display ending message:
          System.out.println( "Thank you for using the Payroll program!" );
          System.out.println(); // outputs a blank line
       } // end method main
    } // end class Payroll3I still get the following error codes:
    C:\IT215\Payroll3>javac Payroll3.java
    Payroll3.java:28: class, interface, or enum expected
    public static void main( String args[] )
    ^
    Payroll3.java:33: class, interface, or enum expected
    boolean quit = false; // This flag will control whether we exit the loop b
    elow
    ^
    Payroll3.java:36: class, interface, or enum expected
    while (!quit)
    ^
    Payroll3.java:42: class, interface, or enum expected
    System.out.println(); // outputs a blank line
    ^
    Payroll3.java:43: class, interface, or enum expected
    System.out.print( "Please enter the employee name or quit to terminate p
    rogram: " );
    ^
    Payroll3.java:45: class, interface, or enum expected
    String nameOfEmployee = input.nextLine(); // read what user has inputted
    ^
    Payroll3.java:48: class, interface, or enum expected
    if ( nameOfEmployee.equals("quit")) // Check whether user indicated to q
    uit program
    ^
    Payroll3.java:51: class, interface, or enum expected
    quit = true;
    ^
    Payroll3.java:52: class, interface, or enum expected
    ^
    Payroll3.java:57: class, interface, or enum expected
    float hoursWorked; // second number to multiply
    ^
    Payroll3.java:58: class, interface, or enum expected
    float product; // product of hourlyRate and hoursWorked
    ^
    Payroll3.java:60: class, interface, or enum expected
    System.out.print( "Enter hourly rate: " ); // prompt
    ^
    Payroll3.java:61: class, interface, or enum expected
    hourlyRate = input.nextFloat(); // read first number from user
    ^
    Payroll3.java:64: class, interface, or enum expected
    while (hourlyRate <= 0) // prompt until a positive value is entered
    ^
    Payroll3.java:68: class, interface, or enum expected
    hourlyRate = input.nextFloat(); // read first number again
    ^
    Payroll3.java:69: class, interface, or enum expected
    ^
    Payroll3.java:72: class, interface, or enum expected
    hoursWorked = input.nextFloat(); // read second number from user
    ^
    Payroll3.java:75: class, interface, or enum expected
    while (hoursWorked <= 0) // prompt until a positive value is entered
    ^
    Payroll3.java:79: class, interface, or enum expected
    hoursWorked = input.nextFloat(); // read second number again
    ^
    Payroll3.java:80: class, interface, or enum expected
    ^
    Payroll3.java:86: class, interface, or enum expected
    System.out.println(); // outputs a blank line
    ^
    Payroll3.java:87: class, interface, or enum expected
    System.out.print( nameOfEmployee ); // display employee name
    ^
    Payroll3.java:88: class, interface, or enum expected
    System.out.printf( "'s weekly pay is: $%,.2f\n", product); // display
    product
    ^
    Payroll3.java:89: class, interface, or enum expected
    System.out.println(); // outputs a blank line
    ^
    Payroll3.java:91: class, interface, or enum expected
    ^
    Payroll3.java:96: class, interface, or enum expected
    System.out.println(); // outputs a blank line
    ^
    Payroll3.java:98: class, interface, or enum expected
    } // end method main
    ^
    27 errors
    Any other suggestions?

  • Help with Recurrsion program

    I seem to be having a little problem with my program. In my main program, depending on which method comes first, the other methods wont work for example the way my main program is not, with occurance method before removeLetter method, the occurance method works fine, but my removeLetter meth won't remove the letter. But if i switch the two and have removeLetter first then it will remove the letter, but my occurance method will come back say the letter is not in the word even when it is...can someone help me? Thanx in advance...
    class CharacterRecurrance{
         private int i=0;
         private int occur=0;
         void inString(String s, char n){
              if(i<s.length()){
                   if(s.charAt(i)==n)
                        System.out.println("Yes, the letter" + " " + n + " " + "is present");
                   else{
                        i++;
                        inString(s,n);
              else System.out.println("No, the letter" + " " + n + " " + "is not present");
         void occurance(String s, char n){
              if(i < s.length()){
                   if(s.charAt(i)==n){
                        occur++;
                        i++;
                        occurance(s,n);
                   else{
                        i++;
                        occurance(s,n);
              else System.out.println("The letter" + " " + n + " " + "appears" + " " + occur + " " + "times");
         void removeLetter(String s, char n){
              if(i < s.length()){
                   if(s.charAt(i)==n){
                        s = s.replace(s.charAt(i),' ');
                        i++;
                        removeLetter(s,n);
                   else{
                        i++;
                        removeLetter(s,n);
              else System.out.println(s);
    class Program3_10{
         public static void main(String[] a) {
              CharacterRecurrance find = new CharacterRecurrance();
              String word = "mississippi";
              char letter = 's';
              find.inString(word, letter);
              System.out.println();
              find.occurance(word, letter);
              System.out.println();
              find.removeLetter(word, letter);
    }

    Or make it zero in the last step of each function. Like this-void occurance(String s, char n){
              if(i < s.length()){
                   if(s.charAt(i)==n){
                        occur++;
                        i++;
                        occurance(s,n);
                   else{
                        i++;
                        occurance(s,n);
              else{
                   System.out.println("The letter" + " " + n + " " + "appears" + " " + occur + " " + "times");
                   i=0; // reset to zero.
         }

  • Help with pathfinding program

    hi,
    i study java at school and i need help with my project.
    im doing a simple demonstration of a pathfinding program whose algoritm i read off Wikipedia (http://en.wikipedia.org/wiki/Pathfinding)where the co-ordinates of the start and end points
    are entered and the route is calculated as a list of co-ordinates. Here is the section of code i am having trouble with-
    void find_path(int x,int y,int p,int q)
    int t1;int t2;
    int temp_pool[][]=new int[4][3];//stores contagious cells of elements in grid pool
    int grid_pool[][]= new int[100000][3];
    int pass_pool[][]=new int[4][3];//stores the pool of squares which can be added to the list of direction
    int path[][]= new int[10000][3];//stores actual path
    int count=1;int note=10;int kk=0;
    int curx,cury;
    //the above arrays contain 3 columns - to store x and y co-ordinate and a counter variable(the purpose of which will become clear later)
    grid_pool[0][0]=p;
    grid_pool[0][1]=q;
    grid_pool[0][2]=0;
    int counter=grid_pool[0][2];
    for(int i=0;i<=100;i++)
    counter++;
    curx=grid_pool[0];
    cury=grid_pool[i][1];
    temp_pool[0][0]=curx-1;
    temp_pool[0][1]=cury;
    temp_pool[0][2]=counter;
    temp_pool[0][0]=curx;
    temp_pool[0][1]=cury-1;
    temp_pool[0][2]=counter;
    temp_pool[0][0]=curx+1;
    temp_pool[0][1]=cury;
    temp_pool[0][2]=counter;
    temp_pool[0][0]=curx;
    temp_pool[0][1]=cury+1;
    temp_pool[0][2]=counter;
    int pass=0;
    for(int j=0;j<=3;j++)
    int check=0;
    int in=temp_pool[j][0];
    int to=temp_pool[j][1];
    if(activemap[in][to]=='X')
    {check++;}
    if(linear_search(grid_pool,in,to)==false)
    {check++;}
    if(check==2)
    pass_pool[pass][0]=in;
    pass_pool[pass][1]=to;
    pass++;
    }//finding which co-ordinates are not walls and which are not already present
    for(int k=0;k<=pass_pool.length-1;k++)
    grid_pool[count][0]=pass_pool[k][0];
    grid_pool[count][1]=pass_pool[k][1];
    count++;
    if(linear_search(grid_pool,x,y)==true)
    break;
    //in this part we have isolated the squares which run in the approximate direction of the goal
    //in the next part we will isolate the exact co-ordinates in another array called path
    int yalt=linear_searchwindex(grid_pool,p,q);
    t1=grid_pool[yalt][2];
    int g1;int g2;int g3;
    for(int u=yalt;u>=0;u--)
    g3=find_next(grid_pool,p,q);
    g2=g3/10;
    g1=g3%10;
    path[0]=g2;
    path[u][1]=g3;
    path[u][2]=u;
    for(int v=0;v<=yalt;v++)
    System.out.println(path[v][0]+','+path[v][1]);
    ill be grateful if anyone can fix it. im done with the rest though

    death_star12 wrote:
    hi,
    i study java at school and i need help with my project.
    im doing a simple demonstration of a pathfinding program whose algoritm i read off Wikipedia (http://en.wikipedia.org/wiki/Pathfinding)where the co-ordinates of the start and end points
    are entered and the route is calculated as a list of co-ordinates. Here is the section of code i am having trouble with-
    ...The part "i am having trouble with" means absolutely nothing to the people who are answering questions here. It's like going to the doctor with a broken rib and just saying "doc, I don't feel so well". Get my point?
    Also, please take the trouble to properly spell words and use a bit of capitalization. Your question is hard to read as it is, which will most probably cause (some) people not to help you. And lastly, please use code tags when posting code: it makes it so much easier to read (see: [Formatting Messages|http://mediacast.sun.com/users/humanlever/media/forums_text_editor.mp4]).
    Thanks.

  • Need help with Mail

    Hi:
    Need your help with something I don´t understand: we try to set up a new hotmail account in Mail (we have used both Preference Panel and directly in Mail) but it never recieves the Inbox. I can send but don´t see anything in Inbox.
    I looked into User/Library/Mail/V2/accountname/INBOX.mbox/ and the folder with the xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx name structure is never created.
    I tried to set up another hotmail account and it works ok, only this specific account fails.
    I Used a Permissions repair, didn't worked. Erased all data in V2, again not worked. Tried to "cheat" Mail setting up another hotmail account and then changing info to the specific account failing, not luck. Also reset sync services (http://support.apple.com/kb/TS1627?viewlocale=es_ES), still not work. Rebuild inside Mail also didn´t worked. Any idea to get this account working?
    BTW, sorry for my bad english...

    Quit Mail. Force quit if necessary.
    Back up all data. That means you know you can restore the Mail database, no matter what happens.
    Triple-click the line below on this page to select it:
    ~/Library/Mail/V2/MailData/Envelope Index
    Copy the selected text to the Clipboard (command-C). In the Finder, select
    Go ▹ Go to Folder
    from the menu bar. Paste into the box that opens (command-V), then press return.
    A Finder window will open with a file selected. Move the selected file to the Desktop, leaving the window open. Other files in the folder may have names that begin with "Envelope Index". Move those files, if any, to the Trash.
    Log out and log back in. Relaunch Mail. It should prompt you to re-import your messages. You may get a warning that the index is damaged and that Mail has to quit. Click OK.
    Test. If Mail now works as expected, you can delete the file you moved to the Desktop. Otherwise, post your results.

  • Help with a Program I am writing!  Please!

    Hello All,
    This is my first post...I hope to find some answers to my program I am writing! A couple things first - I am 17, and have designed a comp. science class for myself to take while a senior in high school, since there was not one offered. My end of the 2nd term project is to write a program that encompasses the information I have learned about for the past two terms. I know the very basics, if that. Please help!
    My program involves the simple dice throwing program, 'Dice Thrower' by Kevin Boone. The full text/program write out can be found at:
    http://www.kevinboone.com/PF_DiceThrower-java.html
    I am hoping to add a part to this program that basically tells the program if the dice show doubles, pop up a little GUI window that says "You are a Winner! You Got Doubles!"
    I was thinking as I finished chapter 7 in my text book, that either an 'if/else' or 'switch' statement might be the right place to start.
    Could someone please write me a start to the program text that I need to add to 'Dice Thrower', or explain what I need to do to get started! Thank you so much, I really appreciate it.
    Erick DeVore - Eroved Kcire

    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.JLabel;
    import javax.swing.JFrame;
    import java.awt.FlowLayout;
    import java.awt.Color;
    public class DiceThrower extends Applet
    Die die1;
    Die die2;
    public void paint (Graphics g)
         die1.draw(g);
         die2.draw(g);
         g.drawString ("Click mouse anywhere", 55, 140);
         g.drawString ("to throw dice again", 65, 160);
    public void init()
         die1 = new Die();
         die2 = new Die();
         die1.setTopLeftPosition(20, 20);
         die2.setTopLeftPosition(150, 20);
         throwBothDice();
         // Erick's Program Insert below
         public class WinnerGui extends JFrame;
      public WinnerGui();
        super ("You Are The Winner with GUI");
        Container c = getContentPane();
        c.setBackground(Color.lightGray);
        c.setLayout(new FlowLayout());
        c.add(new JLabel("You're a Winner! You Got Doubles!"));
            //End Erick's Program insert
         DiceThrowerMouseListener diceThrowerMouseListener =
              new DiceThrowerMouseListener();
         diceThrowerMouseListener.setDiceThrower(this);
         addMouseListener(diceThrowerMouseListener);
    public void throwBothDice();
         die1.throwDie();
         die2.throwDie();
         repaint();
    class Die
    int topLeftX;
    int topLeftY;
    int numberShowing = 6;
    final int spotPositionsX[] = {0, 60,  0, 30, 60,  0,  60};
    final int spotPositionsY[] = {0,  0, 30, 30, 30,  60, 60};
    public void setTopLeftPosition(final int _topLeftX, final int _topLeftY)
         topLeftX = _topLeftX;
         topLeftY = _topLeftY;
    public void throwDie()
         numberShowing = (int)(Math.random() * 6 + 1);
    public void draw(Graphics g)
         switch(numberShowing)
              case 1:
                   drawSpot(g, 3);
                   break;
              case 2:
                   drawSpot(g, 0);
                   drawSpot(g, 6);
                   break;
              case 3:
                   drawSpot(g, 0);
                   drawSpot(g, 3);
                   drawSpot(g, 6);
                   break;
              case 4:
                   drawSpot(g, 0);
                   drawSpot(g, 1);
                   drawSpot(g, 5);
                   drawSpot(g, 6);
                   break;
              case 5:
                   drawSpot(g, 0);
                   drawSpot(g, 1);
                   drawSpot(g, 3);
                   drawSpot(g, 5);
                   drawSpot(g, 6);
                   break;
              case 6:
                   drawSpot(g, 0);
                   drawSpot(g, 1);
                   drawSpot(g, 2);
                   drawSpot(g, 4);
                   drawSpot(g, 5);
                   drawSpot(g, 6);
                   break;
    void drawSpot(Graphics g, final int spotNumber)
         g.fillOval(topLeftX + spotPositionsX[spotNumber],
              topLeftY + spotPositionsY[spotNumber], 20, 20);
    class DiceThrowerMouseListener extends MouseAdapter
    DiceThrower diceThrower;
    public void mouseClicked (MouseEvent e)
         diceThrower.throwBothDice();
    public void setDiceThrower(DiceThrower _diceThrower)
         diceThrower = _diceThrower;
    }That was what I have dwindled it down to, using my knowledge, as well as others' expertise...however I am listening to what you say, and get these messages when I try to compile in the CMD:
    line 63 - illegal start of expression (carrot at p in public)
    line 63 - ; expected (carrot at c in class)
    line 63 - { expected (carrot at ; at end of line)
    line 65 - illegal start of expression (carrot at p in public)
    line 83 - <identifier> expected (carrot as: (this) ) -- I don't even know what that means ^
    line 84 - invalid method declaration; return type required (carrot at a in add)
    line 84 - <identifier> expected (carrot like this: [see below])
    addMouseListener(diceThrowerMouseListener);
    ^
    line 84 - ) expected (carrot is one place over from previous spot [see above]
    line 93 - illegal start of expression (carrot at p in public)
    I know this seems like a lot of errors, but believe it or not, I actually had it up in the high teens and was able to fix some of them myself from going by previous examples, as well as looking things up in my text book. If anyone has any suggestions concerning the syntax errors of the code, please please let me know and I will work my hardest to fix them...thank you all so much for helping.
    Erick

Maybe you are looking for

  • How to add two datasets inside a same tablix?

    Hi Everyone, I want to create a report as using project server datas with two datasets in the same tablix.my report has three grouping by Months,Resources, and Resource Role.my dataset has resource name parameter.when i selected a few resource as fil

  • HP Pavilion p7-1421 Desktop PC BEATS AUDIO not working.

    Hi, new here with thankfully my first problem with the desktop in the subject line. Somewhere along the way, the Beats Audio stopped working correctly. The Equalizer sliders will not move at all, and the "Test Speakers" button will highlight the left

  • How to view the schema of a table?

    Hi, I have a table and would like to use the schema as a base to create other similar tables, however I couldn't find much information on how to retrieve the schema of a table in windows azure database. Could anyone shed some light?  Thank you!

  • I need Checking in Production Order Qty

    Hi all, In our industry we are creating Production Order From Sales Order (MTO Scenario) by using T.Code CO08 or CO01 T.Code with out running MRP.Now if anybody intend to change the PO qty by using CO02 T.Code system allows and as a result the Sales

  • How do I move photos that I've already imported?

    I've imported some photos to the wrong folder.  I could use IOS Finder to move the photos, but I worry that the links to LR will be loss.  How do I move photos within LR? Thanks,