Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 59
  1. #21
    Hodson is offline Member
    Join Date
    May 2010
    Posts
    26
    Rep Power
    0

    Default

    I've checked over all the spellings and stuff so as you say, I can't see why it isn't working.

    I may code it up on a different computer at some point and see if its my computer causing the problem.

  2. #22
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    Do you have JRE installed? Not IDE but JRE itself?

    And moreover, do you have all the NetBeans libs added in your applet jar cause I cannot see any on your screenshots? As a rule either you should add them all right into your jar or add them all right into your web server lib folder :)

    For example you use lib like a

    org.jdesktop.layout.
    Please correct me if I say wrong things but it is NetBeans one only not as for common JDK so it should be especially in your jar I think :)
    Add to your jar required libs and try again...
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

  3. #23
    Hodson is offline Member
    Join Date
    May 2010
    Posts
    26
    Rep Power
    0

    Default

    JRE is installed and all the required libraries are included in the jar file as far as I can see.

    Also just added them into the Web App's Library folder and still doesn't work.

  4. #24
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    Quote Originally Posted by Hodson View Post
    JRE is installed and all the required libraries are included in the jar file as far as I can see.

    Also just added them into the Web App's Library folder and still doesn't work.
    What libs do you add and how you locate them? Right to webapps?
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

  5. #25
    Hodson is offline Member
    Join Date
    May 2010
    Posts
    26
    Rep Power
    0

    Default

    Quote Originally Posted by Webuser View Post
    What libs do you add and how you locate them? Right to webapps?
    I added the Swing Layout Extensions library which contains the org.jdesktop.layout

    I added it into the 'libraries' folder of the web app.

  6. #26
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Lightbulb

    Quote Originally Posted by Hodson View Post
    I added the Swing Layout Extensions library which contains the org.jdesktop.layout

    I added it into the 'libraries' folder of the web app.
    No webapps/.../lib folder is for servlet :) Applet doesn't know this default folder... To make your applet work place org.jdesktop.layout right into applet jar
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

  7. #27
    Hodson is offline Member
    Join Date
    May 2010
    Posts
    26
    Rep Power
    0

    Default

    Quote Originally Posted by Webuser View Post
    No webapps/.../lib folder is for servlet :) Applet doesn't know this default folder... To make your applet work place org.jdesktop.layout right into applet jar
    I'm not sure how I go about doing that, there doesn't seem to be an option to add a lib into the jar file.

  8. #28
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Lightbulb

    Quote Originally Posted by Hodson View Post
    I'm not sure how I go about doing that, there doesn't seem to be an option to add a lib into the jar file.
    You can do this
    1) with your IDE. just when you create jar you should add requested libs or resources...
    2) Or you can do this manually right with your winrar program

    Do that and tell us the result
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

  9. #29
    quance123 is offline Member
    Join Date
    May 2010
    Posts
    2
    Rep Power
    0

    Default

    Sir
    I wanna a tips to develop a program to fire a event when a pen-drive is plugged in into a CPU in a System and then to Copy all the documents of the Pen-drive automaticlly

  10. #30
    quance123 is offline Member
    Join Date
    May 2010
    Posts
    2
    Rep Power
    0

    Default

    Quote Originally Posted by Webuser View Post
    Do you have JRE installed? Not IDE but JRE itself?

    And moreover, do you have all the NetBeans libs added in your applet jar cause I cannot see any on your screenshots? As a rule either you should add them all right into your jar or add them all right into your web server lib folder :)

    For example you use lib like a



    Please correct me if I say wrong things but it is NetBeans one only not as for common JDK so it should be especially in your jar I think :)
    Add to your jar required libs and try again...
    Sir
    I wanna a tips to develop a program to fire a event when a pen-drive is plugged in into a CPU in a System and then to Copy all the documents of the Pen-drive automaticlly
    Add to quance123's Reputation

  11. #31
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default

    > Hodson. Have you gotten an Applet that works on your system yet?

    Try modifying your code by commenting out all the layout stuff from org.jdesktop.layout..
    to the end of the method and replace it with a simple add() statement like:
    add(new javax.swing.JLabel("This is a test")); // added for demo

    Compile, build the jar, copy jar to file with html and open the html in a browser.

    Re multiple jar files with applets. I think you can specify more than one jar file in the archive= tag
    Last edited by Norm; 05-20-2010 at 04:24 PM.

  12. #32
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Lightbulb

    Quote Originally Posted by Norm View Post
    > Hodson. Have you gotten an Applet that works on your system yet?

    Try modifying your code by commenting out all the layout stuff from org.jdesktop.layout..
    to the end of the method and replace it with a simple add() statement like:
    add(new javax.swing.JLabel("This is a test")); // added for demo

    Compile, build the jar, copy jar to file with html and open the html in a browser.

    Re multiple jar files with applets. I think you can specify more than one jar file in the archive= tag
    I think this guy do want a x,y absolute layout for each applet but doesn't include required libs to jar... So each his applet is using this org.jdesktop.layout because NetBeans is really proposes this GUI layout as a default one but he has no org.jdesktop.layout included to his applet jar ;)
    To solve this I propose either to forget using org.jdesktop.layout and come to terms with JDK layout managers only or to study include required libs and resources to one's jar with IDE or manually :)
    ...
    Last edited by Webuser; 05-20-2010 at 05:50 PM.
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

  13. #33
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default

    >WEbuser: But why doesn't he get error messages in the Java console for the missing classes?
    When I compile an applet that uses a class not in the jar file, I get error messages in the Java console when I execute it.

  14. #34
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    Quote Originally Posted by Norm View Post
    >WEbuser: But why doesn't he get error messages in the Java console for the missing classes?
    When I compile an applet that uses a class not in the jar file, I get error messages in the Java console when I execute it.
    emm... perhaps the code block's been caught by try/catch or throws and then ignored stackTrace like "return;" or something...:rolleyes:

  15. #35
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Lightbulb

    watch the code

    Java Code:
    A:
    
    try {
                java.awt.EventQueue.invokeAndWait(new Runnable() {
                    public void run() {
                        initComponents();
                    }
                });
            } catch (Exception ex) {
                ex.printStackTrace();
            }
    the code is running in another thread... To see the real inner thread picture It should be modified I guess like a


    Java Code:
     
    B:
                   java.awt.EventQueue.invokeAndWait(new Runnable() {
                    public void run() {
                    try{                   
                       initComponents();
                         }
                    catch (Exception ex) {
                      ex.printStackTrace();
                      }
    
                    }
                });
    Correct me if I wrong but the problem of invisible error may occure because code A is listening main thread only :) But here one need to control the additional thread errors :)
    Last edited by Webuser; 05-20-2010 at 09:48 PM.
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

  16. #36
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default

    I was assuming that the posted code was having the problem. It doesn't have try/catch blocks. Also post #14 shows that the browser displays an error message and puts up a dialog box, but the OP doesn't see anything in the Java console.

  17. #37
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Question

    Quote Originally Posted by Norm View Post
    I was assuming that the posted code was having the problem. It doesn't have try/catch blocks. Also post #14 shows that the browser displays an error message and puts up a dialog box, but the OP doesn't see anything in the Java console.
    Emm... Not exactly so :) It contains try/catch but the blocks are located right in main method... watch my previous post I quoted Hodson's main method...
    Correct me if I say wrong things but maybe the error is invisible because it occures in another thread...

  18. #38
    Hodson is offline Member
    Join Date
    May 2010
    Posts
    26
    Rep Power
    0

    Default

    Sorry, I got distracted by another project I am working on.

    I added the swing layout extensions library (which contains the org.jdesktop.layout package) and then modified the archive tag to the following:

    Java Code:
    archive="BMI.jar,swing-layout-1.0.4.jar"
    Now when I run the JSP page, it says that the applet has started but it doesn't show on the page at all.

  19. #39
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default

    And still no error messages in the Java Console?

    Why do you call it a JSP page? Are you opening it from a local folder with a browser?

  20. #40
    Hodson is offline Member
    Join Date
    May 2010
    Posts
    26
    Rep Power
    0

    Default

    No error message at all.

    I call it a JSP page as that is what I designed it as in NetBeans (index.jsp). I run it via NetBeans which uses Glassfish in order to show it in the browser.

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 09-29-2009, 04:33 PM
  2. Applet with RS-232
    By j_jpg in forum Java Applets
    Replies: 0
    Last Post: 07-07-2009, 11:59 AM
  3. Calling another applet on click of button in one applet
    By niteshwar.bhardwaj in forum Java 2D
    Replies: 1
    Last Post: 02-19-2009, 01:54 PM
  4. Need with an applet
    By maggie_2 in forum Java Applets
    Replies: 6
    Last Post: 09-21-2008, 09:07 PM
  5. Replies: 4
    Last Post: 06-08-2007, 07: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
  •