Netbeans debugging an applet

I have a class called JScriptBroker which extends Applet.
I have a class SearchPeaple that extends JScriptBroker and therefore is an applet.
How do I tell netbeans it is an applet because it keeps bugging me the main method is
missing?
Allso I cannot debug an applet that uses JSObject, this is because the applet cannot be
run with the appletviewer. None of the html elements are visible in the appletviewer.
Adding the applet to a jsp or html page in a web project doesn't solve the problem
because breakpoints in the applet are ignored. The following is from the help of
NetBeans
Applets run in the virtual machine of the IDE's default web browser. The IDE uses a different virtual machine and therefore applets are not included in a web application's debug session.
I havent used Netbeans for about 3 years now but I do remember it used to be
possible to debug an applet in the html/jsp file of your choice. Does anybody know how to
do this?

Thanks for your reply, i see I made a mistake in my post
Allso I cannot debug an applet that uses JSObject, this is because the applet cannot be
run with the appletviewer. None of the html elements are visible in the appletviewer.
should be
Allso I cannot debug an applet that uses JSObject, this is because the applet cannot be
run in inaything but the appletviewer. None of the html elements are visible in the appletviewer.
About debugging an applet that extends a class that extends an applet:
Opened a new java class library project in netbeans 4.0 using jre 1.5
Added a class called AppletClass
import java.applet.*;
public class AppletClass extends Applet{
    public void init(){
        System.out.println("OK, this works");
}Right clicked the file and choose debug, that works.
Added a class called SubAppletClass that extends AppletClass
Right clicked it and choose debug, the error is:
Class "SubAppletClass" does not have a main method.

Similar Messages

  • How to Debug Java Applet called in a BSP Component

    Hi All,
    In CRM Marketing->Segments->Graphical Modeler
    A click on settings button will load a Java Applet window.
    The settings window displays some elements. I want to translate a text displayed in that Java Applet window.
    Please let me know the ways to debug a Java applet loaded from BSP Component or ways the data is loaded into Java applet from SAP.
    Your help would be appreciated and points will be rewarded.
    Thanks a lot in advance.

    For the newbies, like me:
    Instruction to setup and debug an applet in Eclipse IDE via your Browser
    Java Console Setup for Applet debugging:
    1. Open up the Java Console Application by double clicking on it at C:\Program Files (x86)\Java\jre1.6.0_03\bin\javacpl.exe
    2. Select the Java Tab
    3. View Applet Runtime Settings button
    4. Enter in the Java Runtime Parameters the following: -Xdebug -Xrunjdwp:transport=dt_socket,address=5555,server=y,suspend=y
    5. Note: the port address 5555 can be anytime you want. You will need to enter whatever number you select into Eclipse IDE.
    6. Note: if you don�t need to debug code in the Applet�s init() method, then use....suspend=n (Not tested yet.)
    Eclipse setup for Applet debugging:
    1. Open up Eclipse and create your Applet. Once you are ready to debug go to the next step.
    2. Select the top level Run menu
    3. Pick the Open Debug Dialog� option
    4. In the left column select Remote Java Application
    5. Then select the �New� button to create a debug configuration for the remote session (the new button looks like a page with a yellow plus in the upper right hand corner)
    6. Give your session a name. I used the class name followed with the work remote for example: mainclassnameRemote
    7. Set connection type to Standard (Socket Attached)
    8. Host to localhost
    9. Port to 5555, or whatever you used in Java Console Setup step 5.
    10. Due not check the �Allow termination of remote VM�
    11. Due not close this window.
    Start debugging:
    1. Go to your Applet html launch file and launch in a browser
    2. Then go back to eclipse and select the debug button
    3. Eclipse should now throw you into the debugger mode.
    4. If it hangs, just retry again. It seems to work ok most of the time. A few time I need to close the browser and start over and then it seems to work.

  • How to Debug multiple Applets in a IDE

    Hi,
    I am relatively new to Java. At work, I have a client-server style application where applets are deployed to the clients in an html page.
    Background:*
    The sequence is something like this:
    - Client goes to the relevant url
    - The returned html page has an embedded login applet
    - Upon successful login, an html page is returned that has two embedded applets
    - On the client side, navigation buttons within the applets take them to other applets
    On the server there is an application running that listens to the relevant socket (that the client sends data to) and sends out appropriate responses and data.
    Question:*
    How do i setup this system in any IDE (any IDE is ok with me) so that i can do the following:
    - Step through and debug the applets (appletviewer doesnt work because it seems to work with independent applets only. In my case, all the applets have relationships among them. eg. unless the login applet successfully completes, the other applets cannot work... etc)
    - Visually view / edit existing applets UI (something like a WYSIWYG tool)
    Thank you so much.
    schinni

    Hi,
    I am actually, working in an applet too, and I also need to debug it. With Eclipse you will easily get it, just click with Right button on the project�s name and choose: Debug As-> Java Applet. You can arrive also by: Debug As-> Open Debug Dialog. At the end you will have a window where you will be able to add the applet parameters in the Parameters tab. Finally you only have to set breakpoint (double click in the left side of any code line) and with F5, F6 and F7 you will get the absolute control. I don't think you've problems even you run multiple applets.
    Hope it helps you (sorry for my poor English).

  • Debug an applet that has a run-time (logic) error how?

    hi,
    I have an applet that has a non-terminating loop in it...I found it after eye-balling my code.
    How would one debug an applet? I have bought sooooo many books on java, & NONE provide/identify a process for debugging applets. I use JTextPad & would appreciate a method i can use to debug applets....ppppllleezzzz

    TheStijn is correct about stepping thru code - you'd need a development environment. However, the better of these for use in a commercial environment are usually expensive (>$1000). The free ones are not so good (although given that WSAD is based on Eclipse and I think WSAD is pretty good, maybe you could go for Eclipse). They also take some time to get to grips with.
    You could instead litter your code with System.out.println() statements to see what it is doing. These can be viewed from the browser's Java console. On IE, you enable the console by doing Tools > Internet Options > Advanced. Scroll down to "Microsoft VM" and select "Java Console enabled". Then the console is visible (after re-starting IE) from the View menu (at the bottom).
    With Netscape (4.7), you do Communicator > Tools > Java Console. You can also view it on other browsers thru similar mechanisms. Hope this helps in the short-term.

  • Debug an Applet ? How ?

    I probably cant see the wood for the trees, but no mater how hard I try, I cannot debug an applet class. Whenever I right-click and run I get
    init:
    deps-jar:
    compile-single:
    run-applet:
    Warning: <param name=... value=...> tag requires name attribute.
    Warning: <param name=... value=...> tag requires name attribute.
    Warning: <param name=... value=...> tag requires name attribute.
    Warning: <param name=... value=...> tag requires name attribute.
    BUILD SUCCESSFUL (total time: 0 seconds)
    I have followed the help guide and have the html file in the src directory. I can run the html file ok in a normal browser. but for the life of me I cannot see where or how to either attach the debugger to the applet process, or even run it and hit a breakpoint.
    I canot run it like a normal application as there is no "Main Class" and trying to set that up is a nightmare in itself. I have only just started using the IDE and although it has similarities with .NET (hope thats not a bad word here) it does seem to be a lot more complex when youre trying to recall everything you forgot from years ago.
    Can anyone explain is an easy straight foward basic language what I need to do ? I find the help files assume that one already has a vast amount of background. The learning curve for me is very steep at the moment.
    Thanks for your time and help.
    Kess

    Quote:
    Copy the MyApplet.html launcher file from the build folder to the package where the applet class lives in the src folder (in this case, to org.me.hello). Make sure that the MyApplet.html launcher file has the same name as the applet class.
    Note that later it says....
    Note that applets run in the virtual machine of the IDE's default web browser. The IDE uses a different virtual machine and therefore applets are not included in a web application's debug session. Debug the applet within the Java project, as explained above.
    So, if you create the htm file and add in some parameters, it becomes a web application and the caveat is that no breakpoints can be set and you cant step into the code.
    Which is the problem I am having.
    Of course none of the examples or help pages only ever give the most simplest of the "Hello Word" examples, and it would appear that doing something a little more complex is beyond the help articles.......
    I am still stuck, and would much prefer someone to state excatly how to debug an applet.....
    I cant believe this beyond some of the experts here.
    Thanks for your comments so far.

  • Debug plugin applet in remote VM

    I am trying to debug a test applet I created so that the debugger will interact with the plug in.
    I have tried to follow all the information I have found in the subject.
    1. Added the parameter to the plugin console
    -Djava.compiler=NONE
    -Xnoagent
    -Xdebug
    -Xrunjdwp:transport=dt_socket,address=jorgefnt:1801,server=y,suspend=y
    When I tried to attach my debugger (through Forte4J) I get the following message
    Debugger exception: Exception while starting debugger:
    Cannot connect to remote vm
    java.net.ConnectException: Connection refused: no further information.
    What am I missing so that I can connect?
    I am using jre 1.3.0_01
    Any ideas
    Thanks a lot
    Jorge Luis

    Hi Luis,
    Check the <connection address> in -Xrunjdwp option and there is no need to specify again
    "suspend=y" as it is default. If "suspend=n" then you can specify in -Xrunjdwp.
    Let me know if you are still having facing the problems.
    Anil.
    Developer Technical Support
    Sun Microsystems Inc,
    http://www.sun.com/developers/support

  • Debug STK applet   with  JCOP 3.0

    Hi all
    i want to debug my STK applet with JCOP tools in eclipse plugin.but somehow i am not able to debug my SIM toolkit with JCOP.
    first ques , is it possible?
    right now i m debuging in manu project---->debug
    then i m choosing java card application to debug,but its not working:(
    how can i proceed step by step for debuging?
    one more ques,
    is it possible to load applet on java card only with JCOP tools?(means without any s/w like views professional or aspects developer.)
    Regards
    Divyesh.

    Hi all.
    I'm having the same problem. I know that a html file is created everytime the applet is invoked (clicking on debug or run) with a diferent name to be called as argument of appletviewer.
    But I will join to the question... How can we use our testpage to do a test of a devel applet?
    Because mine has to be used with javascript and it's very difficult to test it without a custom test page or appletviewer...
    Thank you all

  • Netbeans debug level - missing line numbers in stack trace

    How could I set debug level to something like "lines,vars,source" in Netbeans 6.0?
    I have enabled 'Generate debugging info' in project properties, but in exception stack trace aren't line numbers (only bci).
    Thanks
    David

    Ask in a NetBeans forum, you can probably find one on java-forums.org, Java Ranch or nabble.com.
    This forum's for CLDC and MIDP.
    db

  • Java card applet debugging in Netbeans 6.8

    Hi,
    | am writing a Java Card applet and a client MIDlet. I would like to debug my applet: I want to see the interaction process with MIDlet. However, for some reason I cannot start debugging in Netbeans 6.8. Could someone help? Thanks in advance.
    Regards,
    Aleksandr

    Hi sanyas,
    sorry, i'm not answering your question..
    I'm a newbie in Java Card technology..
    After i had read your post, it makes me curious about Java Card Client..
    I want to know, what kind of Java Card Client that we could create?..
    Can we create a Java Card client application from Java SE (GUI/Swing base application), or it's limited for MIDlet only?
    Thanks in advance..

  • Debug applets

    I am using Sun Java Studio Enterprise Version 8 and I'm wandering if anybody knows the best way to debug a mixed applet/Servlet environment. I am able to debug the servlets running on tomcat without any problems but the applets are not setup to debug. Any ideas on the best way to setup this environment? I appreciate the help.

    From the ide field guide:
    http://usersguide.netbeans.org/files/documents/40/70/Chapter6-WebApps-Tomcat.pdf
    NetBeans IDE does not have a specific project type for applets, so the development cycle for applets is a little different than for other types of projects. You can not designate an applet as a main project, which means that several project-specific commands (such as Run Project) do not apply to applets. However, you can still create, test, and deploy applets fairly easily. The general outline of applet development is as follows:
    1. Create a Java Library project to hold the applet.
    2. Create an applet from one of the templates in the New File wizard and fill in code for the applet.
    3. Test the applet in the JDK's applet viewer by right-clicking the applet's node in the Projects window and choosing Run File.
    4. Create a JAR file for the applet by right-clicking the applet's project node and choosing Build Project.
    5. If you want to add the applet to a Web application, add the applet's project (or just the applet's JAR file) through the Web project's Libraries node.
    ...To run an applet, right-click the applet's node in the Projects window and choose Run File. To start debugging an applet:
    1. Set a breakpoint in the code by selecting the line where you first want execution to pause and press Ctrl-F8.
    2. Right-click the applet's node in the Projects window and choose Debug File.
    Therefore the suggested approach seems to be debug the applet separately.
    Also of possible interest:
    http://www.netbeans.org/servlets/ReadMsg?list=nbusers&msgNo=53777
    Simply open the applet class in the editor and choose "Debug File"
    (normally it is Ctrl-Shift-F5 or menu "Run > Run File > Debug
    foo.java"). The applet viewer comes up and breakpoints that I have set
    in the IDE are perfectly hit.
    http://www.netbeans.org/kb/41/tutorial-applets.html#runanddebug

  • Applet debug from IE

    Hy,
    I've a problem when debugging an Applet using IE.
    I'm using NetBeans 4.1EA2
    The HTML page start and also the applet.
    I put a breakpoint in applet class code but when I try to call a method from the HTML (clicking a button) my program doesn't stop in debug.
    What can I do to debug the applet without AppletViewer?
    Thanks all in advance
    G

    I've found it....
    Refer to : http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/debugger.html
    1)in Java Control Panel-Java-Java Applet Runtime Settings press View
    Under Java Runtime Parameters write this :
    -Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:transport=dt_shmem,address=2502,server=y,suspend=n
    Close
    Test with NetBeans IDE:
    2)In the same folder of your Applet class create an html/jsp page that call the Applet
    3)RightClick-View (IEXPLORE.exe start)
    4)Put a breakpoint where you want
    5)In Run-Attach Debugger chose Sharedmemory
    Name = 2502 (the same address parameter setted above)
    6)OK
    Test your Applet, for example using a button that call a method in your class...here the code in html :
    <input type=button value="Test " onclick="MioApplet.test('This is a test');" >
    where MioApplet is the name of the applet and test is the name of the method inside the class
    Happy???Yes
    Bye

  • Applet programming with Netbeans?

    Well I have been wanting to make a 2D side scrolling SIMPLE game with Java, just as a way for me to get my feet wet and keep practicing programming between classes.
    I have been using this guide: http://www.gamedev.net/reference/programming/features/javagame1/
    But whenever I make a new Java Application in netbeans and try to follow along, it doesn't work.
    I don't mind using notepad and JDK, but in all my classes every program we had to make was able to be made in Netbeans. Alot of these terms like:
    public class HelloWorld extends Applet
    public void paint (Graphics g)
    g.drawString("Hello World!", 50, 25);
    I have never even heard of using g.drawString, we always used System.out.printf or println or just print... Also never extended an Applet.
    Maybe I am just not up to date enough to start this particular tutorial? I can easily get it to work using notepad, HTML, etc. I also have Java Studio Creator 2 (came with a textbook)

    Swing makes it relatively trivial to write an application which will run as either a JApplet or within a JFrame... They're just alternate "top level containers" which contain a JPanel, which contains "all the guts" of your program.
    I find JFrames more convenient to work with locally... the downside is that you have to be careful to avoid doing things (like accessing the local filesystem) which the security manager will (quite rightly) object to when it's published as an applet. Read-up on applet security restrictions before you start and you should be right.
    Alternately, the JDK ships with an appletviewer.
    Netbeans includes an applet-container, specifically to make applet development more convenient... except it would (from my google search) appear to "have a few bugs", like it uses the desktop security manager which would give the developer false positives on what you can do in an applet... and having not used it myself I'm loathe to recommend it.
    Cheers. Keith.

  • Java - Eclipse debug applet with System.out.print in jboss console

    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 jboss 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).

    System.out.println works for me. The output statment are visible in the Console Window within Eclipse.

  • How to debug applets

    I'm a new at this.
    Can anyone suggest of a way to debug applets. I'd love
    to trace through statements in the code. How can I do it?
    Thanks in advance.

    Look into documentation provided by your IDE, it should provide example on how to dynamically debug an applet. Typically you would provide the html file (that loads the applet) name as a configuration parameter
    HTH

  • Applet Debug in IE

    HI,
    Can I debug my applet embeded in Internet Explore?

    Some IDE's will allow you to debug applets using appletviewer. This is outside of the browser.
    If you need to debug in the browser, enable the java console (in control panel) and use system.out.println() to print messages and variables to that console. The console will show up as a coffee cup in the system tray.

Maybe you are looking for