Results 1 to 15 of 15
Thread: NetBeans, html won't update
- 11-07-2008, 09:29 PM #1
NetBeans, html won't update
right this is a newbie question. I have installed netbeans and created a java application with a single applet file for hello world. First time when I build it it and run the app an html file is created that displays it. However if I make any changes and rebuild/recompile everything it just won't update. When I rightclick myApplet.java in netbeans and select run the changes are displayed- I have tried building the project, compiling the package and compiling the actual file in the netbeans project viewer thingy but nothing.
- 11-07-2008, 10:07 PM #2
What is the "it"? The HTML might not need any changes if the class name stays the same.it just won't update.
- 11-07-2008, 10:29 PM #3
that's just it- I do not edit the html file. The applet inside the html does not update after the first compilation.
- 11-07-2008, 11:48 PM #4
Is it a browser caching problem?applet inside the html does not update
How does the <APPLET tag in the HTML access the class file? Does it use a jar file or just a class file?
What happens if you move the HTML and the jar file to a different folder and open the HTML in a browser?
- 11-08-2008, 12:28 AM #5
hmm tried opening in both firefox and IE with the same results.
while a jar file is created the code in the generated html file seems to only access th class:
<APPLET codebase="classes" code="NewApplet.class" width=350 height=200></APPLET>
My "first" compilation was of a blank java project with nothing in it- when I move the file to another folder even if I put the jar and class files together with it I get a square with an X indicating it couldn't find em or something like that.
- 11-08-2008, 02:34 AM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Is that everything working fine on Applet Viewer once you select run on that menu on the class file?
- 11-08-2008, 02:54 AM #7
When you open the HTML file in a browser, there should be a java console for the java vm output messages. Copy the contents of that console here.I get a square with an X
If you have a jar file containing the java class files, change the <APPLET tag in the HTML to include the archive=<jarfilename> attribute and remove the codebase= attribute.
- 11-08-2008, 03:05 AM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 11-08-2008, 02:36 PM #9
Depends on your browser.
On Mozilla, Java console is under Tools|Web Development
On FireFox Java console under Tools
- 11-08-2008, 03:01 PM #10
ok I have managed to get the console but it doesn't help much. After my initial success it won't update again.
1.I create java project
2.add a file of type "java applet"
3.modify my code so it looks like so:
3.then I compile it and in*/
import java.applet.Applet;
import java.awt.Graphics;
public class NewApplet extends java.applet.Applet {
/** Initialization method that will be called after the applet is loaded
* into the browser.
*/
public void init() {
// TODO start asynchronous download of heavy resources
}
public void paint(Graphics g) {
g.drawString("Hello world!", 50, 25);
}
F:\netbeans-5.0\javaAppNew\build
an html file appears with hello world
4. I change "Hello world!" to "hello world! 123!", compilt it and run it- inside netbeans works but when I open it through that html page it's still "hello World!"
I have tried changing the <APPLET tag in the HTML to include the archive=<jarfilename> attribute and remove the codebase= attribute but it does not help and why would I have to do that should that not be done automatically??
java is so frustrating and silly! I am very grateful for your patience with me please don't give up on me!
- 11-08-2008, 03:09 PM #11
yess I figured out the problem!! In firefox REFRESH= USELESS!! I have to close firefox completely and open it again then it updates. Very silly java.
- 11-08-2008, 04:12 PM #12
a Browser's caching is not part of java.
- 11-08-2008, 04:19 PM #13
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
I don't think it's an issue with Java, since you close the Firefox document it wont update.
- 11-08-2008, 09:51 PM #14
ok my mistake sorry :)
- 11-09-2008, 02:52 AM #15
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Similar Threads
-
JPanel won't update
By ibanez270dx in forum New To JavaReplies: 3Last Post: 01-06-2009, 08:59 PM -
How can I include a html file in html textarea?
By surya_dks in forum New To JavaReplies: 2Last Post: 10-04-2008, 07:20 AM -
[SOLVED] Update an XML file
By Eranga in forum Advanced JavaReplies: 4Last Post: 07-15-2008, 02:03 PM -
Using sql:update tag
By Java Tip in forum Java TipReplies: 0Last Post: 01-13-2008, 11:49 PM -
dynamic update in swt
By sandor in forum SWT / JFaceReplies: 0Last Post: 05-14-2007, 08:32 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks