Results 1 to 3 of 3

Thread: Applet problem

  1. #1
    Prompt is offline Member
    Join Date
    Jan 2011
    Posts
    11
    Rep Power
    0

    Default Applet problem

    I am using netbeans. When I run my applet in netbeans via applet viewer I see the proper output. But when I use the html generated by the netbeans from the project's directory, it doesn't show the correct output in the applet.

    A cause of the problem might be that I am calling a .exe via ProcessBuilder in the applet using a different thread, the applet didn't throw no exception or anything so i'm not sure if thats the problem. I can show code if you need to, any suggestions?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Perhaps it's a path issue, but who knows. Putting some debug statements into your code might help. Otherwise it's hard for us to guess what's wrong.

  3. #3
    Prompt is offline Member
    Join Date
    Jan 2011
    Posts
    11
    Rep Power
    0

    Default

    I don't think its a path issue because, I copied the needed files and executable in the directory of the net bean project.

    So I just did a test program using the following code :
    Java Code:
     public void paint(Graphics g) {
            super.paint(g);
            int midX = getWidth()/2;
            int midY = getHeight()/2;
            g.drawString("Testing", midX,midY/2);
    
            if(comm.getApproxFounders() == null){
                javax.swing.JOptionPane.showConfirmDialog(rootPane,"NULL!");
            }
            
            System.out.println(comm.getApproxFounders());
            final int width = 10;
            final int height = 10;
            final int spacing = 3;
            
            for(int i = 0; i < comm.getApproxFounders().size(); ++i){
                String s = comm.getApproxFounders().get(i);
                for(int j = 0; j < s.length(); ++j){                                
                    int y = i * (height + spacing);
                    int x = j * (width + spacing);
                    if(s.charAt(j) == '0') g.drawOval(x,y, width,height);
                    else g.drawRect(x,y, width, height);
                    
                }
            }
        }
    and using netbeans through the "Run file" command for the applet, it opened the appletviewer with the correct output as follows :


    but using the browser( google chrome ), I don't get a proper output. However I do get the confirm dialog box saying "NULL" so something is wrong. I am guessing the system is stopping the execution of the .exe but thats just a speculation. Any suggestions.

Similar Threads

  1. Problem with my applet.
    By PhQ in forum Java Applets
    Replies: 15
    Last Post: 04-09-2010, 03:58 AM
  2. applet and JPS problem.... please help me
    By rockster14 in forum Java Applets
    Replies: 0
    Last Post: 08-07-2009, 10:44 PM
  3. Problem with Applet
    By tomjrmkay in forum Java Applets
    Replies: 1
    Last Post: 12-19-2008, 10:35 AM
  4. Serious applet problem
    By willemjav in forum Java Applets
    Replies: 1
    Last Post: 03-25-2008, 05:01 PM
  5. Applet problem
    By Ed in forum Java Applets
    Replies: 2
    Last Post: 07-02-2007, 03:35 PM

Posting Permissions

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