Still having trouble - Constructors

Please see: http://forum.java.sun.com/thread.jsp?forum=54&thread=269276
Really finding this one difficult and have tried the suggestions but even though the applet compiles it is not right. Arrrgghhhh please help!!!!
"Class MyPoint" holds x and y co-ords of a point.
- Write two constructor methods
- 1 of which accepts two integer arguments and assigns them to two instance variables x and y
- The other takes NO arguments and assigns the defualt value 5 to each instance variable

So hopefully this should be right...
import java.awt.*;
public class MyPoint extends java.applet.Applet
          int x=50;
          int y=99;
          Point start, end;
          public void init()
               setBackground(Color.black);
          public MyPoint ()
               this (5,5);
               start = new Point (x,y);
          public MyPoint (int x, int y)
               end = new Point (x,y);
               repaint();
          public void paint(Graphics g)
               g.setColor(Color.green);
               g.drawLine(start.x,start.y,end.x,end.y);

Similar Messages

  • Are people still having trouble with iPhone/HP Laptops?

    Since I've had my Envy I've had no end of trouble with getting it and the iPhone to play nice. Any my search continues. So far, I have updated every bios, reinstalled Windows 7/iTunes many times, have restored the iPhone far more times than I care to remember and I am STILL having troubles with this thing. Having got through the Syncing issues with the PM55 chipset and iPhone I can now sync with my laptop. However all is not well as it would seem that I cannot sync my photo's. It doesn't matter if I have 0gb, 15gb or 30gb free, iTunes is telling me that there is not enough memory available. This error seems like an old one and there is even some info in the Apple KB but after following all that I still can't get it to sync my photo's.
    Some info on my setup:
    HP Envy 15 (all the latest drivers installed, bios F.24) Core i7-820, 8gb ram etc.
    iPhone 32gb, ver 3.1.3
    iTunes (whatever the latest one is)
    I should add that I can sync my iPhone with an identical install of intunes on my vintage Quad core desktop PC, but as I use my Laptop a lot more (and have all my media, email, and contacts etc on it) I would prefer to sync to it.
    Is there anything that I can do? Its very frustrating to have blown $4k on this equipment and it doesn't work...

    Well I tried deleting the photocache but alas, no luck. I also tried syncing with just the photo's enabled, and it worked! So then I enabled my other media and that copied across too! I thought I was on a bit of a roll here, but now whenever I try and sync it will do one of 3 things:
    iTunes will crash.
    iTunes will indicate that there is not enough memory on the device (+9GB free)
    iTunes will remove the iPhone from the sidebar (and my computer/disk management) even though it will continue to charge.
    Interesting point to note is that it works fine (cable/iphone/itunes/media library) on my desktop and macbook. Still really disappointed that I cannot get these two to cooperate. Also still haven't got any contacts from outlook but that may not be related?

  • Still having trouble with Gallery Slideshow

    Still having trouble with Gallery Slideshow, in Live Preview it bounces to  the top of the page but not centered where I like it.
    Hope someone can help.
    Thanks

    no is not hosted anywhere Im working on a Fantasy Photography site. from the image the top one is design mode and bottom is preivew mode. But my problem is
    as you can see from the images ( red boxes )  it moves when is in preview mode and the sizes of the images change as well as you can see. I dont know why? I tried figuring it out
    but no luck. I hope this helps.
    thanks

  • Sony just isn't helping me. I'm still having trouble transferring my NX3 video files.

    Well, I'm still having trouble transferring my NX3 video files to my editing software.  Sony suggested using the Sony Content Browser but that doesn't work. Sony just can't seem to help me. If the scene shot on the card is longer than 10 minutes, 4 frames of audio is lost from each file.  So if you shoot 60 minutes straight (say a wedding, you loose audio every 10 minutes)  I guess this doesn't sound important, unless it happens just as the bride is saying "Yes" in her vows.
    My original post is as follows:
    Sony NXCAM (NX-3) drops audio tracks when importing into FCPX and Premiere.
    I called Sony on Feb 13, 2015. I spoke with Doug (case no. 661972). I've been using my NX-3 for about 3 months. I'm still testing Sony NX-3. Looking for a way to transfer the video and audio without dropping audio frames. I didn't catch it at first, I mean it's only a few audio frames. It seems to happen with files over 12 minutes shooting. It seems that I can't upload the video/audio shot in my NX-3 to either my iMac (using FCPX nor Premiere) nor can I upload it to my PC (using Premiere) without 3 to 6 audio "frames" being dropped. When I spoke with Doug at Sony, a person I've actually spoke with in the past, he seemed frustrated. I was speaking with him as a professional and was attempting to find a solution, he was being protective and wanted to place blame at other companies. He stated that the camera played back the files correctly so it isn't a Sony problem. I explained that it is a problem for all of us if we choose Sony as our purchase. He told me "you should all buy Canons next time." That kind of through me. How do you speak to that. I explained that I am just looking for a solution and he told me to call the software and computer companies. Doesn't Sony realize that just because the camera works, that isn't the end of the road. You need to put the video into a devise to edit the video. I asked him what software would he recommend to a professional to use to edit footage taken by the Sony, he no reply. All I received from Doug was a really bad feeling about Sony. I've been a Sony "shooter" for over 34 years. I still can't believe the way I was treated. Not sure now what path I will take with this. But I surely need to tell everyone (all of my associates who have been asking me how I like my new camera) what response I received from Sony. Buy a Canon. By the way, I asked if Sony might have another camera of the same type that didn't drop audio. Doug didn't know. Really strange. Is Doug not happy with his prosition with Sony? 

    Auto Correct:
    As far as I'm aware this cannot be turned off. Someone may prove me wrong on this point
    CDDB Update:
    Again, as far as I'm aware this cannot be done. You could use WMP to update the files then import them into iTunes.
    Music Deletion:
    iTunes seems to only ask you if you want to delete a file if the file is located in its library folder. In the Preferences>Advanced>General section try changing your iTunes Music Folder to the folder where all your music is stored and it should ask you if you want to move files to the recycle bin when you delete them.
    Library Update:
    This is a feature I with iTunes would introduce. When you delete or move a file iTunes loses track of it. What it needs to be able to do is first check to see that all the existing files in the library are still there, and remove the ones that aren’t, then it needs to search for new tracks.
    It can search for new tracks but if you have renamed a file, then it will be in the library twice, one is the old file (which will no longer play because it doesn’t exist) and the other is the new file.
    The way I now avoid iTunes annoyances in relation to file names and folder organisation is I let iTunes sort it all out for me. Selecting "Keep iTunes Music folder organised" and "Copy files to iTunes folder when adding to library" will get iTunes to sort your music into Artist folders, then within the Artist folders are Albums, then within the album folders are the actual files, which are named Track Number Artist. For example Coldplay - Clocks will be named 05 Clocks.mp3.
    WARNING: Selecting "Keep iTunes Music folder organised" will copy all the music in your library to the iTunes Music folder. You must have enough Hard Disk space to do this.
    ...that wound up longer then I thought it would. Hope you can make sense of it all.
    Cheers,
    Ben

  • Am still having trouble downloading Adobe Flash Player.

    Am still having trouble downloading Adobe Flash Player.

    Count your blessings. You're better off without it.
    If you insist upon having Flash Player, there is one and only one URL from which to download it:
    http://get.adobe.com/flashplayer/
    You must also enable plug-ins in Safari. Make your Safari Preferences look like this:
    FYI this is the legitimate Flash Player installer:
    This one is bogus:

  • Still having trouble logging in--are you?

    Hi,
    This question's not as crucial as my other post. Is everyone else still having trouble logging in, and getting that error message.
    I end up clicking on My Questions and eventually journey to the post area.
    If there's an answer, please let me know (and others, maybe, too)
    Thank you.
    Allan the Questioner

    First, I've never asked you to "give me a Solved" because that is a violation of the Terms of Use. Second, I don't recall getting angry with you about anything. I don't even know you. Third, I answered your question. If you think I was rude, then I apologize. Rest assured I'll make no further effort to help you.

  • Still having trouble

    I'm still having trouble updating my itunes still geting errors when trying to update it wont even let me uninstall itunes been looking through the forums and saw someone use fixit but so far its been going for a few hours only saying attempting to resolve problems with tiunes i have no other ideas on what to do to fix itunes so i can update it and have it work properly

    I'm still having trouble updating my itunes still geting errors when trying to update it wont even let me uninstall itunes been looking through the forums and saw someone use fixit but so far its been going for a few hours only saying attempting to resolve problems with tiunes i have no other ideas on what to do to fix itunes so i can update it and have it work properly

  • Still having trouble"Custom" Persissions

    Sorry if I duplicate, as I posted this as a reply to a closed question and wasn't sure if it would be answered.
    I have followed all the discussions and fixed up the "Custom" permissions on my Startup drive, 3 Partitioned drives, and External Firewire drive, BUT my external Firewire WD 1Tb drive that I use for Time Machine will NOT toe the line! I have followed all the commands suggested by V.K. And still have a padlck on my drive.
    I have done :
    sudo chflags nouchg /Volumes/"Terrasaur"
    sudo chmod 775 /Volumes/""Terrasaur"
    to no avail
    and
    chflags -R nouchg /Volumes/Terrasaur
    chmod -RN /Voumes/Terrasaur
    chmod 775 /Volumes/Terrasaur
    No change!
    Here is some data that MAY help.
    ====================>snip<==========
    G5-Desktop:~ steve$ id
    uid=501(steve) gid=501(steve) groups=501(steve),98(_lpadmin),80(admin)
    G5-Desktop:~ steve$ ls -ale /Volumes
    total 80
    drwxrwxrwt@ 19 root admin 646 19 Oct 11:08 .
    drwxrwxr-t@ 45 root admin 1598 19 Oct 00:46 ..
    0: 9D0FB03D-A6E9-43F7-BCF6-FD3BC370C936 allow list,addfile,search,add_subdirectory,deletechild,readattr,writeattr,readextattr,writeextattr,readsecurity
    1: EA51D771-76E4-4638-A1BA-732654853029 allow list,addfile,addsubdirectory,readattr,writeattr,readextattr,writeextattr,readsecurity
    -rwxrwxrwx 1 matt matt 82 3 Jun 2006 ._512 PSP
    -rwxrwxrwx 1 matt matt 82 30 May 2006 ._JOHN
    -rwxrwxrwx 1 steve steve 82 17 Sep 2007 ._Jeff
    -rwxrwxrwx 1 steve steve 82 10 Jan 2007 ._MATTS
    -rwxrwxrwx 1 matt matt 82 16 Jan 2006 ._PSP
    -rwxrwxrwx 1 steve steve 82 10 Nov 2005 ._PSP 512
    -rwxrwxrwx 1 steve steve 82 3 Nov 2005 ._PSP 512G
    -rwxrwxrwx 1 steve steve 82 17 Sep 2007 ._Steve
    -rwxrwxrwx 1 matt matt 82 2 Dec 2007 ._Untitled
    drwxrwx---@ 22 steve Jeff 816 10 Aug 10:53 Firewire Backup
    drwxrwx---+ 38 steve steve 1360 24 Sep 08:39 Jeff
    0: user:Jeff allow list,addfile,search,add_subdirectory,deletechild,readattr,writeattr,readextattr,writeextattr,readsecurity
    drwxrwxr-x+ 21 steve steve 782 3 Oct 20:51 Lower Internal
    0: EA51D771-76E4-4638-A1BA-732654853029 allow list,addfile,addsubdirectory,readattr,writeattr,readextattr,writeextattr,readsecurity
    drwxrwx---+ 370 steve steve 12648 26 Sep 22:26 Matt
    0: user:matt allow list,addfile,search,add_subdirectory,deletechild,readattr,writeattr,readextattr,writeextattr,readsecurity
    lrwxr-xr-x 1 root admin 1 19 Oct 10:55 Startup Disk -> /
    drwxr-xr-x 3 matt admin 102 8 Jan 2008 Terrasaur
    drwxr-xr-x 3 matt admin 102 6 Jun 18:25 Terrasaur 1
    drw-rw-r--+ 54 root admin 1904 1 Sep 14:43 Terrasaur 2
    0: EA51D771-76E4-4638-A1BA-732654853029 allow list,addfile,addsubdirectory,readattr,writeattr,readextattr,writeextattr,readsecurity
    G5-Desktop:~ steve$
    ====================>snip<==========
    The disk "Terrasaur" is the one I'm having trouble with.
    Can anyone help please?
    Steve

    that's the problem. eject that drive. then enter the following in Finder commandshiftg. In the resulting popup enter /Volumes
    This will open a finder window for /Volumes directory which is normally hidden. all your drives should be there. the real drives look like aliases. but there should also be a couple of fake Terrasaur drives. they will look like actual folder. Delete them. If there is some stuff inside that you might need copy them somewhere first. now mount the real Terrasaur drive and rerun the terminal commands to unlock it.

  • Still having trouble with Adobe Viewer

    I'm still having the issue that when I have multi state objects, (state 1 is off the page, state 2 is on the page) the hidden state (state 2) is showing up on the iPad Adobe Viewer when you click the |||| icon from the menu in the upper left corner. In the overlay creator panel 'tap to play/pause' is not checked.  'Cross Fade' and 'Hide before playing' are checked. 
    Any help would be appreciated!!  thank you!

    What I was able to determine:  In the Oject States where all the states are listed.  The State where there is no object in view needs to be listed first. (doesn't matter what state number it is, just needs to be first in the list)  When I did this for all my MSO's there was no viewing problems!!  Thanks for leading me down the right path. much appreciated!

  • Still having trouble with NeoSpeech

    I have re-installed NeoSpeech and I am still having problems.  I read the comments about this but I have not seen anything that fixes the problems I am having.
    When I select the Kate voice it works, but if I select the Paul voice you don't see that short processing status, and no audio is created.  It selects the Paul option in the drop-down, but there is no audio.  If I create audio with Kate, then switch it to Paul, nothing happens and the voice remains Kate.  As I said, I reinstalled but nothing changed.  What else should I do?
    To Adobe: Does this feature have bugs, or should it be working?

    no is not hosted anywhere Im working on a Fantasy Photography site. from the image the top one is design mode and bottom is preivew mode. But my problem is
    as you can see from the images ( red boxes )  it moves when is in preview mode and the sizes of the images change as well as you can see. I dont know why? I tried figuring it out
    but no luck. I hope this helps.
    thanks

  • Still having trouble with audio on Macbook Pro

    I had posted a discussion board earlier on this issue. I've been having trouble with audio for certain videos on youtube and basically any website embedded with a video. The audio works for a few seconds that doesn't or it doesn't work at all. My volume is up, not on mute, and the one on the video isn't on mute either. It's funny because I just tried watching a video on Firefox (as opposed to Safari) and it works. Could it possible be something with the settings for safari?

    Try restarting your Mac, resetting your router, and resetting your modem. My cable internet has gotten slow at times as well, and when I reset my router everything cleared up.

  • HT4061 hi im still haveing trouble with my ipad its not conected i must be doing something wrong tell me again how to conect my ipad

    why am i haveing trouble downloading to my ipad it froze

    First, try a system reset although I can't give you any confidence.  It cures many ills and it's quick, easy and harmless...
    Hold down the on/off switch and the Home button simultaneously until you see the Apple logo.  Ignore the "Slide to power off" text if it appears.  You will not lose any apps, data, music, movies, settings, etc.
    If the Reset doesn't work, try a Restore.  Note that it's nowhere near as quick as a Reset.  It could take well over an hour!  Connect via cable to the computer that you use for sync.  From iTunes, select the iPad/iPod and then select the Summary tab.  Follow directions for Restore and be sure to say "yes" to the backup.  You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod.  Again, say "yes."
    At the end of the basic Restore, you will be asked if you wish to sync the iPad/iPod.  As before, say "yes."  Note that that sync selection will disappear and the Restore will end if you do not respond within a reasonable time.  If that happens, only the apps that are part of the IOS will appear on your device.  Corrective action is simple -  choose manual "Sync" from the bottom right of iTunes.
    If you're unable to do the Restore, go into Recovery Mode per the instructions here.

  • Still having trouble with Adobe AIR - Trying to download free trial.

    I'm having an issue with Adobe AIR.  Last month I purchased Photoshop CS 5.5 with the agreement of a free upgrade to Photoshop CS 6 10 days after it comes out (should be today that I get the CD key, right?) and I'd like to get myself ready to just plug the key in and go, especially considering the trouble  I had actually downloading PS CS 5.5 (not too promising, eh?).
    I can see the yellow DOWNLOAD button and when I click it Adobe AIR comes on and asks me to read the license, etc.  I click AGREE and... it closes immediately.  Every time.
    I've tried on a few different browsers and don't have any anti-virus messing with it.
    Thanks for your help anyone and everyone.

    You will still need to resolve the AIR issue to install the software as we use it's components in many of our Creative Applications.  I would recommend reviewing Troubleshoot AIR installation | Windows - http://helpx.adobe.com/air/kb/troubleshoot-air-installation-windows.html.
    You are also welcome to follow the steps listed in http://forums.adobe.com/thread/981369 to initiate a direct download.  Depending on the Adobe product though you are installing you will need to have Adobe AIR functioning for a successful installation.

  • Any other iPhone owners still having trouble with AMDS?

    Even with the new iTunes update, AMDS didn't install. I managed to get AMDS installed independently with someone's method of copying new directory and registry files, but it's still not allowing the driver software to be updated on my iPhone. Anyone else out there just having problems with AMDS in general?

    Good gracious. Are you "Kate" from over there in the comments section? (I'm Tony, by the way.)
    I'm a bit worried that this might be related to the issue with your USBport.inf file that popped up in the sfc /scannow results from last year. The .inf files contain instructions on how a driver needs to be installed.
    It might at this point be worth attempting the procedures described from the document we following on the scannow on fixing files that scannow cannot repair.
    [How to use the System File Checker tool to troubleshoot missing or corrupted system files on Windows Vista or on Windows 7|http://support.microsoft.com/kb/929833]
    (The one issue I'm worried about with that is the result from the scannow run that suggested that there might be an issue with your System Restore. I don't want to get you into a situation where you can restore if everything turns to custard for us.)

  • Still having trouble with the checkWinner

    it's making it so that every empty array spot is equal so the checkWinner method is screwing up, any ideas on how to fix this?
    import javax.swing.*;
    import java.text.*;
    import java.applet.*;
    import java.io.*;
    import java.awt.*;
    import java.lang.*;
    import java.util.*;
    import java.math.*;
    import java.sql.*;
    import java.security.*;
    import java.beans.*;
    import javax.crypto.*;
    import javax.net.*;
    import org.omg.CORBA.*;
    import java.awt.color.*;
    import java.util.jar.*;
    public class TwoDArray
         String [] [] board=new String [3] [3];
         int x;
         public TwoDArray()
              for(int x=0;x<3;x++)
                   for(int y=0;y<3;y++)
                        board[x][y]="";
         public void getMove(int row, int col, String letter)
              if(board[row][col].equalsIgnoreCase(""))
                   board[row][col]=letter;
              x++;
         public void printBoard()
              for(int x=0;x<3;x++)
                   System.out.print("|");
                   for(int y=0;y<3;y++)
                        System.out.print(board[x][y]);
                   System.out.println("|");
         public boolean checkWinner()
              boolean win=false;
              if(x>=3)
                   if(board[0][0].equalsIgnoreCase(board[0][1])&&board[0][0].equalsIgnoreCase(board[0][2]))
                        win=true;
                        return win;
                   if(board[0][0].equalsIgnoreCase(board[1][0])&&board[0][0].equalsIgnoreCase(board[2][0]))
                        win=true;
                        return win;
                   if(board[0][1].equalsIgnoreCase(board[1][1])&&board[0][1].equalsIgnoreCase(board[2][1]))
                        win=true;
                        return win;
                   if(board[0][2].equalsIgnoreCase(board[1][2])&&board[0][2].equalsIgnoreCase(board[2][2]))
                        win=true;
                        return win;
                   if(board[1][0].equalsIgnoreCase(board[1][1])&&board[1][0].equalsIgnoreCase(board[1][2]))
                        win=true;
                        return win;
                   if(board[2][0].equalsIgnoreCase(board[2][1])&&board[2][0].equalsIgnoreCase(board[2][2]))
                        win=true;
                        return win;
                   if(board[0][0].equals(board[1][1])&&board[0][0].equalsIgnoreCase(board[2][2]))
                        win=true;
                        return win;
                   if(board[2][0].equals(board[1][1])&&board[2][0].equalsIgnoreCase(board[0][2]))
                        win=true;
                        return win;
              return win;     
         public static void main(String[] args)
              boolean winner=false;     
              String player1="X";
              String player2="O";
              String instructions="Welcome to Tic-Tac-Toe.";
              for (int i = 0;i<instructions.length() ;i++ )
                    System.out.print(instructions.charAt(i));
              try
              Thread.sleep(99);
              }catch(InterruptedException e) {e.printStackTrace();}
              System.out.println();
              TwoDArray board=new TwoDArray();
              String input1=JOptionPane.showInputDialog("Enter the row you wish to move in.");
              int rowmove=Integer.parseInt(input1);
              String input2=JOptionPane.showInputDialog("Enter the column you wish to move in.");
              int colmove=Integer.parseInt(input2);
              board.getMove(rowmove,colmove,player1);
              board.printBoard();
              while(winner==false)
                   String input3=JOptionPane.showInputDialog("Enter the row you wish to move in.");
                   int rowmove2=Integer.parseInt(input3);
                   String input4=JOptionPane.showInputDialog("Enter the column you wish to move in.");
                   int colmove2=Integer.parseInt(input4);
                   board.getMove(rowmove2,colmove2,player2);
                   board.printBoard();
                   board.checkWinner();
                   if(board.checkWinner()==true)
                        System.out.println("O WINS");
                        System.exit(0);
    String input5=JOptionPane.showInputDialog("Enter the row you wish to move in.");
              int rowmove3=Integer.parseInt(input5);
    String input6=JOptionPane.showInputDialog("Enter the column you wish to move in.");
              int colmove3=Integer.parseInt(input6);
              board.getMove(rowmove3,colmove3,player1);
                   board.printBoard();
                   board.checkWinner();
                   if(board.checkWinner()==true)
                   System.out.println("X WINS");
                        System.exit(0);
    }

    if(board.checkWinner()==true)can be:
    if(board.checkWinner())
    if(winner==false)can be:
    if(!winner)It isn't actually causing trouble right now, but the "x" in the constructor and in printBoard hide the member variable "x". If you aren't careful, you will use the wrong "x" somewhere and confuse yourself. Besides, the member variable "x" is a bad name. It should be "numberOfMoves" or something like that.
    Once you fix what scsi-boy said with checkWinner, take out all but the last "return winner;" line, and change it to "if...else if...else if...else if..." It is cleaner to have only one return statement. And, once one "if" is true, you don't need to check the rest.

Maybe you are looking for

  • Security Question: Shared Files on a Network

    Security Question from a Network Newbie Hi: I recently returned from a meeting at a large city hotel.While at the meeting, I used the fancy hotel's hard-wired connection to access the internet. Imagine my surprise when the next morning one of the oth

  • Why can i not add individual photos from my photo stream to individual albums ...like i used to in iPhoto ??

    unable to add individual photos to individual albums.

  • Error: jspx file is too large

    its size is 169KB , when compiling it ,JDev reports the following error: Error: code segment of method _jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) too large JDev is 10.1.3.2.0.4066 thx ,best regards

  • Fake Apple Inc. pages on Facebook

    I would like to report some Facebook business pages that are posing as pages maintained by Apple Inc. These pages are not owned, maintained or operated by Apple Inc.; the original VERIFIED Apple Inc. business page was deleted awhile ago. In fact, one

  • 3hr 38min mp3 file only opens as 16mins 44secs!?

    Hi folks I'm new to the forum having only just registered. I use Audition 1.0 at work. Recently I have been recording 3 to 4 hour audio sessions initially to VHS LP then recorded to Tascam DR100 then transfered to PC. The trouble I am encountering is