Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23
  1. #21
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Tucson, AZ
    Rep Power

    Default Re: Please help and don't close this thread

    I glanced at the code you posted before:

    Even if I wanted to study your code and tell you what's wrong, I couldn't. It's nearly impossible to comprehend for several reasons: it's formatted bizarrely, with extremely long lines, very little whitespace, and inconsistent indentation; there are no comments; the methods are all too long; it's one gigantic monolithic program blending UI code, SQL code, and who knows what else; and I don't speak whatever language you're using for identifiers, so I can't keep them straight when I'm trying to understand the program. Only the last one is not your fault, and even then, it is your fault that it is such a big problem. If the program structure made any sense at all, I could probably tell what the variables were supposed to be despite not knowing the language.

    Basically, if you are looking for what's wrong with your program, the answer is "everything." My advice is to throw it out, forget about it, and start over from scratch without making so many mistakes. And if you don't understand what you did wrong, then pick up an intro to Java book and start at chapter 1.
    Last edited by kjkrum; 02-23-2014 at 06:49 AM.
    Get in the habit of using standard Java naming conventions!

  2. #22
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    On vacation
    Rep Power

    Default Re: Please help and don't close this thread

    It just did not show any things.
    If you have added lots and lots of println statements to the code and none of them print out on the console when you execute the code, then you must not be executing the code that contains the prinln() statements.
    Before the next test, erase all the old class files. Make sure there are no compiler errors when you compile the code that contains the println() statements.
    Execute the new code in a command prompt window and copy the full contents of the command prompt window and paste it here.
    If you don't understand my response, don't ignore it, ask a question.

  3. #23
    jashburn is offline Senior Member
    Join Date
    Feb 2014
    Rep Power

    Default Re: Please help and don't close this thread

    Based on the starting comments in the code dump,

    Java Code:
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
    this looks like code generated by a GUI builder (NetBeans?). This probably explains the monolithic code. As for the language used, I'm pretty sure it's Indonesian. Off-topic, but imho it's better to use English for reasons like this - when help is needed from an international audience.

    Micro-profiling using println of timings in code can certainly help. However if the application is started via an IDE, then it may not be obvious where the printlns are showing up. E.g., with Eclipse they'll probably show up in Eclipse's Console window. It'll to start the application via the command prompt window as Norm suggested, in which case the printlns will show up on the same window. Again, if the code containing printlns is not executed, nothing will be displayed.

    Another way is to CPU-profile using VisualVM that is bundled with the JDK. See Profiling Applications with VisualVM — Project Kenai ("Profiling applications" and "CPU Profiling" sections only.)

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 2
    Last Post: 12-11-2012, 12:35 PM
  2. Thread doesn't close
    By fioan89 in forum Threads and Synchronization
    Replies: 0
    Last Post: 10-21-2011, 01:07 PM
  3. How to close this thread? (Socket listener)
    By zardos in forum New To Java
    Replies: 5
    Last Post: 03-02-2011, 11:27 PM
  4. Replies: 13
    Last Post: 04-09-2010, 11:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts