Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!

Jan Volkmann

+ Follow
since Feb 01, 2001
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jan Volkmann

Originally posted by Sowjanya Raghu:
How do I display a modal dialog from an applet in a browser?

For a custom dialog try this (uses browser as frame):

20 years ago

Originally posted by Mindy Wu:
[I]Can you give me a guide of how to set up the classpath properly, please.

Keep the *.html file in the same directory as the applet's class file is in. Edit the html file and remove codebase from the applet-tag. Insert code="[I]AppletName[I].class" if necessary.
Do not use packages unless you like asking for troubles. Although Sun claims it to be possible
I spent three days on it without success. When the applet is loaded the JVM apparently interprets the package-statement as part of the path and looks for the applet class in yet another subdirectory named after the package. I would do so until Kingdom Come, I suppose.
An IDE's appletviewer is much smarter in a way. It has the advantage of having more info about paths'n'packages so it let's you get away with lots of things. This is not beneficial, I think 'cos it is often misleading when trying to detect an error.
hope it helps,
20 years ago
Nope, it doesn't work on the server.
Tomcat throws up the following message:

which is strange cos the path is "/examples/WEB-INF/classes/fse/Applet1.class" and "WEB-INF/classes" is represented by "servlet", I reckon. I even copied all class-files into the "classes"-folder and to "classes/fse/fse". I know it's not very intelligent but what can I do?
20 years ago
Hi Ashwin,
thanks for your quick response. I think you were on the right track. the classes folder belongs to the classpath so it should be codebase="fse" code="Applet1.class".
I tried 16 different combinations from "classes/" to "fse" with dots and slashes and without. just to be on the safe side ;-) Neither worked with a browser :-(
So I copied all class files from classes/fse to classes and now it seems to work although I get a IOException now. But that's probably due to applet restrictions (I#m testing locally, the error msg is a dynamic html page created ba the servlet, so that part is ok). I try to rearrange the stuff on the linux machine and let's see how far I'll get.
20 years ago
I forgot to mention...
JBuilder's servlet-container invokes the applet allright but throws no less than six identical ClassNotFoundExceptions referring to whatever is set as code in the applet-tag (below it's for code="fse.Applet1.class"):

So, it doesn't seem to work at all. But why is the applet invoked anyway??
20 years ago
Hi folks,
I wrote a servlet which checks passwords and (if pw is correct) invokes an applet which reads data from a database. All works fine within my IDE (JBuilder4) running on WinNT. The servlet can also be run in a browser (IE && NN) either locally or via network (the servlet, applet and database are deployed on a Linux host using jdk1.3, tomcat3.2.1 and apache). In both cases, however, the applet cannot be loaded (error msg in statusbar: class Applet1 not found).
As far as I know this occurs if code and codebase in the applet-tag are wrong or the classpath is wrongly set. But the tag, classpath and arrangement of folders is principally the same as with other applets I wrote and there's never been problems. And why does it work within the servlet-container of my IDE?
The *.class files reside in /classes/fse (fse is the name of the package)
The applet-tag is (excerpt):

I read that the code should not include a package name so I tried it without it (and copied the *.class files accordingly). Moreover, I tried codebase="./fse", tried everything with and without quotation marks and the .class ending. But it won't work.
I don't even know what the problem could be. Is it the whole concept? Is it the browsers? Is it down to applet rights? Any clues??
20 years ago

Originally posted by simenwu:
A) Bground extends Thread, so it inherits the run() method.
Because it's an empty method, when you call, it outputs

I think M. Green explained it himself. It should've be:
public void run
20 years ago

Originally posted by sachin_ckd:

i want to know whether is their any method using which i can give a call to a HTML page which i have already designed??
i.e giving a call to a static page once the user id and pw is verified??from a servlet

you could create a dynamic page with a link to your static page. Try this:

It's not very nice but it should work
20 years ago
Hi Tony,
thanks for answering. I figured it out. Now look at this mess:
1. a normal hyperlink works fine anyway
2. a button created with (no JavaScript implemented):

works with jBuilder4 but not with IE5 and is not displayed at all in NCommunicator4.6
3. a button created with (using JavaScript):

does NOT work with jBuilder4 but with IE5 and (yet again) is not displayed in NC4.6
That's strange, 'cos Netscape's Browsers should be able to interpret a simple JavaScript statement since v2.0 onwards. Maybe my settings are wrong (although I'd think JavaScript should be activated by default).
This is rather a HTML/JavaScript kind of problem and since it is not related to pure Java you should remove the whole topic.

20 years ago
Hi folks,
in order to learn something about servlets I wrote a simple one which merely selects entries from a remote database (method=post, only doPost() implemented). It works fine and creates a new page with all results displayed. The only trouble is the back-button which is created by the servlet on the results-page:
- the browser's back-button works just fine.
- the generated back-button works within jBuilder but not with the normal browser.
- if the mouse-pointer is above the generated button, the correct url is displayed in the status bar. If I push the button, however, nothing happens (i.e. no error, no success).
- a refresh on the generated results-page produces a warning (something like: page cannot be refreshed unless information is sent again)
strange, innit?
any hints?
I searched this site for similar problems but couldn't find anything. Hints on that are welcome, too.
so long,
20 years ago

Originally posted by Ajan Balakrishnan:

One Question guys. Did anybody tried Tomcat with jdk1.3 . I heard guys complaining about problems. Please confirm

There are ALWAYS problems but I dunno if it's down to tomcat vs. jdk1.3 The biggest trouble is to identify the problem itself, I think (is it tomcat, jdk, os, servlet-code, paths,...?). There's no tools.jar in jdk1.3, so you don't have to bother about that. I'm not sure about WAR-files and how to use them. But tomcat seems to work just fine with jdk1.3. So, if you're thinking about an upgrade to 1.3 the tomcat stuff shouldn't stop you from doing so.
The only problem is that no one knows about it so it's not easy to get some good advice. Anyway, I just started dealing with servlets. I'm not an expert, really. So, feel free to correct me.
20 years ago

Originally posted by Ajan Balakrishnan:
Good to know it's working

Strange though that it wouldn't work with tomcat. I had the same problems with tomcat-3.2.1, jdk1.3, winNT. One has to be very careful with all those paths. Can't check them too often. If using jBuilder the URL is

By the way, there is no root folder beneath webapps. It works but can be quite frustrating.
20 years ago

Originally posted by tony lu:
thank you for your message at first.
for example, I want to send a message to a window, make it to get the "focus"(be ready to get the key input).

hi tony,
there is no wizard for handling window messages in java development suites which can be quite irritating at first. The Window-class has a method called getFocusOwner() but as far as i know there is no set-method. if you simply want to have the focus placed on some textfield at prog startup it should be the first element added to the container (either hardcoded or by calling the overloaded add(component,int) with int being the index parameter). if you want do it manually you could use the transferFocus() method of class component to move the focus to the next focusable component (this should have the same effect as the tab key). For more sophisticated use have a look at the FocusManager.
hope it helps
20 years ago
oops, used the wrong kind of brackets. it was supposed to look like this:
static (type) (name) = (value); //class var definition
if accessed from outside (if possible) call it like this:
if accessed from within its class refer to it like this:
20 years ago

Originally posted by Rakesh Sharma:

Member variable & Instance variables are the same thing. These are the variables which are declared in the class and used for the creation of object.
Local varables are the varables defined inside a method. These are used inside that particular method only and cannot be accessed outside that methods.

Hi Rakesh and Leslie,
Instance variables are Member variables but the opposite needs NOT to be true. In short: Varaibles declared or defined within a class but outside a method are member varaibles (member of a class) otherwise they are local variables (declared or defined within a method). This is the basic distinction (Unlike in C++ varaibles canNOT be declared or defined outside a class). Member variables are further subdivided into instance variables and class variables. Neither is used to create an object. The difference is just that instance vars are attached to a distinct object (i.e. created with it and destroyed with it) whereas class variables are attached to the class itself (i.e. created only once at start of program and not destroyed until the program is finished).
How to create a class variable? Easy: static <type> <name> = <value>;
How to adress them? this.<name>=<value>; or just <name>=<value>
For obvious reasons it's not allowed to define class vars witjhin a method.
The same holds true for class methods (i.e. static methods).
Hope it helps,
20 years ago