Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Need help debugging my EasyPlannerApp
Index -> Programming, Java -> Java Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh pageAdd this topic to your bookmarks (CTRL-D) View next topic
Author Message
gsquare567




PostPosted: Tue Oct 31, 2006 9:07 pm   Post subject: Need help debugging my EasyPlannerApp

okay, so the thing works, all except for the edit command. it either a) doesnt edit the contact, or b) duplicates the list + (a). i've looked through it, and i'm a beginner with the whole swing thing so if its something small then dont make fun Very Happy. thanks a LOT for any1 who helps, or just reads my entire code. it has tons of commenting so you can understand it even if you dont know java lol. thanks, and heres the code:


EasyPlannerApp.java
 Description:

Download
 Filename:  EasyPlannerApp.java
 Filesize:  29.95 KB
 Downloaded:  141 Time(s)

 
Sponsor
Sponsor
Sponsor
sponsor
rdrake




PostPosted: Tue Oct 31, 2006 9:33 pm   Post subject: (No subject)

Please, please, please PLEASE attach the source file in the post when it's ~100 lines or above.
 
Andy




PostPosted: Tue Oct 31, 2006 9:38 pm   Post subject: (No subject)

bam! i'm on a roll today Very Happy
 
gsquare567




PostPosted: Wed Nov 01, 2006 12:41 pm   Post subject: (No subject)

so is any1 gonna read it???
 
gsquare567




PostPosted: Fri Nov 03, 2006 10:28 pm   Post subject: (No subject)

comon
 
Booya




PostPosted: Wed Nov 08, 2006 2:55 pm   Post subject: Code

i was looking through the code had like a ton of errors in it and it was too long sorry but i dont have the time to fully look at it on the weekend ill attepmt to see whats wrong with it.
 
batman




PostPosted: Wed Nov 08, 2006 2:58 pm   Post subject: Program

Wow this is a very long code!!!!!!!! Ok i dont know if ur teacher talked to you about this but using classes then using interference to make other classes then using a applet afterwards. Basically this makes smaller pieces of ur code. Maybe I should do a tutorial on how to do this using interference????????? Or maybe someones already done that.
 
wtd




PostPosted: Wed Nov 08, 2006 3:29 pm   Post subject: (No subject)

Interference?

Perhaps you mean inheritance. That concept is covered quite well in the Introduction to Java.
 
Sponsor
Sponsor
Sponsor
sponsor
batman




PostPosted: Wed Nov 08, 2006 4:29 pm   Post subject: Code

Quote:

Interference?

Perhaps you mean inheritance. That concept is covered quite well in the Introduction to Java.


Inheritance is what I mean my bad. Yea so gsquare567 if i were u u should go to the introduction to java and try to learn how to use inheritance. It will make ur code much neater. Also you need to add more comments so we can undertsand what u are doing.
 
gsquare567




PostPosted: Thu Nov 09, 2006 6:27 pm   Post subject: (No subject)

thanks for actually reading my code!
btw, i have no teacher, i self-taught myself, and also, i know what inheritance is but what are you talking about? how can i use inheritance (extends or implements, right?) here? i was thinking of making another class in the same file called Contact but its already done and i'll do that later once i figure out this problem. but do you know why it isnt editing properly?
 
gsquare567




PostPosted: Wed Nov 15, 2006 2:12 pm   Post subject: (No subject)

waiting
 
wtd




PostPosted: Wed Nov 15, 2006 5:35 pm   Post subject: (No subject)

A piece of feedback...

You have:

code:
   private void centerWindow(Window w)

   {

      Toolkit tk = Toolkit.getDefaultToolkit();// creates a Toolkit object

      Dimension d = tk.getScreenSize();// creates a Dimension object using the Toolkit object



      setLocation((d.width-w.getWidth())/2, (d.height-w.getHeight())/2);

      // sets the frames location to the width/2 and the height/2

   }


Now, there are afew issues here. First, the syntactic stuff. The superficial (but important) things.

Your first two comments are utterly unnecessary. If the person cannot figure this information out from the code, then they don't know Java and shouldn't be reading your code. Your third comment, meanwhile, should be on the line preceding the code it is concerned with.

However, there is a much bigger, fundamental, "OOP is weird" issue going on here.

You have your instance method take a parameter that is a Window object. But... when you use this, you just pass in "this". This is redundant.

code:
   private void centerWindow() {
      Toolkit tk = Toolkit.getDefaultToolkit();
      Dimension d = tk.getScreenSize();

      // sets the frames location to the width/2 and the height/2
      setLocation((d.width - this.getWidth()) / 2, (d.height - this.getHeight()) / 2);
   }


One last thing.

code:
[code]   private void centerWindow() {
      Dimension d = Toolkit.getDefaultToolkit().getScreenSize();

      // sets the frames location to the width/2 and the height/2
      setLocation((d.width - this.getWidth()) / 2, (d.height - this.getHeight()) / 2);
   }[/code]
 
gsquare567




PostPosted: Fri Nov 17, 2006 7:56 pm   Post subject: (No subject)

haha thanks i guess... i use it as more of a universal method i just copy and paste, no use making a diff class just for that, but the window could be many things, and my comments are extremely basic throughout... but i just made that when i was just starting and havent really thought about just taking out those 2. can you please read my code you could probably solve my problem in a second.
 
wtd




PostPosted: Fri Nov 17, 2006 8:27 pm   Post subject: (No subject)

I could probably find the root of your problem readily, were your code not so infernally hard to read do to the little details you probably don't think I should waste time pointing out. Smile

Your comments, for instance, are horrible. Comments should be used sparingly, and not to say things the code itself is saying. When they are used, they should precede the code to which they apply.
 
gsquare567




PostPosted: Sun Nov 19, 2006 7:21 pm   Post subject: (No subject)

ok dude, firstly, calm down... im used to putting so many comments for skewl java course. it doesnt make it THAT much harder to read... you probably couldnt help me anyways its probably too advanced. if any1 knows java.io pack well then try skimming through my edit function Very Happy
 
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh pageAdd this topic to your bookmarks (CTRL-D) View next topic

Page 1 of 2  [ 19 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: