Eclipse debug applet with System.out.print

N

NES

I use System.out.print to debug my java programs using Eclipse. I'm new
with applets, and when nothing showed up in the applet window, I tried
using print statements. I was expecting to see them in the console like
always, but there was nothing there. I tried looking this problem up
online and found nothing. Does anyone know how I can use print
statements to debug my applet? (Japplet to be specific).
Thanks for any help,
Nes
 
J

jlowery05

Are you seeing the console at all? There is a bug in Eclipse that
prevents the console window from coming up.

I think separate threads have separate consoles, also, so make sure
you're monitoring the right one.
 
I

IchBin

NES said:
I use System.out.print to debug my java programs using Eclipse. I'm new
with applets, and when nothing showed up in the applet window, I tried
using print statements. I was expecting to see them in the console like
always, but there was nothing there. I tried looking this problem up
online and found nothing. Does anyone know how I can use print
statements to debug my applet? (Japplet to be specific).
Thanks for any help,
Nes

It would be more productive for debugging if you use the resources of
the Eclipse debugger. That is, "step", "step into" "step over" and etc..
your code and put watches on objects you would like to interrogate. A
little bit slower but you may spot other problems that the println() may
not catch. It will be a much more enriching Java experience.

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
 
N

NES

Yes, I see the console. But there is nothing there. However, I was
unaware of Eclipse having multiple consoles. As for the debugger, I
think it would take too much time for me to learn it, and print
statement work for me. Well, not in this case I guess.
 
I

IchBin

NES said:
Yes, I see the console. But there is nothing there. However, I was
unaware of Eclipse having multiple consoles. As for the debugger, I
think it would take too much time for me to learn it, and print
statement work for me. Well, not in this case I guess.

If you put a print statement in your code, say:
System.out.println("BlabBlabBlab: "+var_BlabBlabBlab);

I am assuming that you have already selected from the menu "Window\Show
View\Console". And you do not see the print output, in the Eclipse
console, then that maybe your problem. That is, it is not falling thru
that code.

GUI *Debuggers* are easy, you just have to do it once to start using it.
Do this:

- Where you put your println() statement just double click on the left
blue border of the editor window at that line. A blue button will
display. This is where you want the program to stop.

- Instead of selecting "Run as Java Applet". Just select "Debug as Java
Applet".

- If\when your program passes that statement, it stops and then the
debugger perspective will display. Up in the top left corner is the
"Debug panel" you will see 5 yellow arrows. Just use the first two. They
all popup a 'tooltip' if you hover your cursor over them.

The first arrow you use to "Step Into". You use this say if you are on a
line of code that calls a method. This will take you into that called
method.

The second arrow is to "Step Over". This means to just goto the next
executable line of code.

To watch an object's value just select the object and then right click.
Then select "Watch". This will put the object, and a display of its
value, up in the right top panel called "Expressions"...

Just fool around with this it will take you a lot further that println()
statements.

While you are trying to debug and debug perspective is open, just select
"Menu Help\Dynamic Help". Then select "Debugging your programs". And
cruse some instruction as you debug.

As a Java programmer, no, as a programmer, you really need to know how
to use a GUI debugger. They are 99.9% of the time the same across all
developer GUI's.

Old saying, "Pay me now or pay me later".

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,194
Latest member
KarriWhitt

Latest Threads

Top