Tim Blommerde

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

Recent posts by Tim Blommerde

Dear Javaranchers,
For this application I'm writing I got an XML document containing a lot of CData parts. A couple of these parts should not be shown. Especially one of these parts with always the same content. There fore I'd like to know if there's an XSL part that checks the content of the CData part and depending on it either shows the CData part, or does not show it.
Thanks in advance,
Tim
If you're looking for information on building GUI's with Java, you might check out this page: http://developer.java.sun.com/developer/onlineTraining/GUI/ .
Have fun,
Tim
18 years ago
Though I do not see why the NT machine wouldn't run your batch as the Win9x machines, I might have an idea on getting more information on the problem. Try to use the command prompt to open the batch file instead of double clicking. This will give you probably some more information on why your batch isn't running. Information you won't see when you double click, because then the command prompt is closed immediately.
Good luck,
Tim
18 years ago
Dear Joseph John,
Too be honest, I do not completely grasp your intentions, nor do I understand what you are trying to do with the code part you provided. But if you're looking for a way to print a HashMap, like you stated in the title of your post, all you have to do is use the toString() method.

Good luck,
Tim
18 years ago
Dear Wai Meng,
Of course it is possible to format dates into whatever format you want. The easiest way to do this is by using the java.text.SimpleDateFormat class. It gives you the possibility to set the format when creating an instance of the class, while the format(Date d) function returns a String with the date according to the set format.
I wasn't sure if in your case you had an object of type Date or of type String, with the date from the Oracle database. If you have a Date object called dDate, then this is about all you need to do to print the date in your preferred format:

If you have a String with the date in it, say sDate, you'll have to parse it to a Date first, before you can do the above. The parsing can be done with the java.text.SimpleDateFormat too. Though in this case you'll need a second formatter, this time with the format of the Oracle date:

Hope this helps,
Tim
18 years ago
For as far as I know, both will get a different object, representing the same data.
Have fun,
Tim
Well, as I stated before, for as far as I know the thing you want, running an applet by double clicking on its .jar file, isn't possible. I guess you'll have to write a HTML file and use that together with a batch file that calls the appletviewer with the HTML as a parameter. That's about all I can think of. Sorry.
Best wishes,
Tim
18 years ago
Of course getting yourself familiar with the Java language is the first thing you should do. After that you might look into the java.awt.image.renderable package and the java.io package. Of course it all depends on what kind of game you want to create.
A slightly outdated site called 'The Java Game Programming Tutorial' might set you on the right track. Another tutorial, found at the Sun site, learns you how to create a Bingo game. I know it does not sound spectacular, but you said you're rather new to Java, so you have to start at the bottem.
Good luck,
Tim
18 years ago
Hi,
For as far as I know, you can't run an applet by simply double clicking its .jar file. Because .jar files are zipped, you can associate the .jar extension with your favourite zip tool - Winzip for instance - and then double clicking the .jar file will open the package, showing all included files in your zip tool.
Hope this helped,
Tim
18 years ago
First of all I'd like to state that I'm no expert on designing an application. But, because I have some knowledge on Design Patterns and always like to help, if possible, I'd like to suggest you read some bit on the following two patterns: 'Model-View-Controller' and 'Model-View-Presenter'.
The Model-View-Controller (MVC) Pattern, which originates from SmallTalk, is used quite often nowadays in nearly all J2EE projects, but could ofcourse also be applied to less complicated applications like yours. The Model-View-Presenter (MVP) pattern looks much like the MVC pattern, but might be a bit less complex and more usable in your situation.
Note that the above provided links are but a start. If you think you can use the patterns, you'd better browse the net for more information and maybe some good examples. I bet you can find far more information if you looked around a bit.
Good luck,
Tim
Dear Miftah Khan,
To be honest, I haven't read much books on Design Patterns, but for as far as I know, there's one Design Patterns book that's the source of all other Design Patterns books. It dates back to 1995 I believe and contains all Design Patterns a seasoned software engineer should know. It's called 'Design Patterns: Elements of Reusable Object-Oriented Software' and was written by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides.
Though it's not focused on Java, in my humble opinion, it's still a book that every self-respecting Java Designer should have on his bookshelf. It contains the basic Design Patterns and together with a more Java and Enterprise orientated book it should provide all the information you'd ever need.
Best regards,
Tim
Though the document Code Signing for Java Applets might be a bit outdated, it's still very usefull. As is the document you can find at http://ourworld.compuserve.com/homepages/jozart/article/index.html.
Of course Sun's site also offers good, general information on the security of applets and signing applets. The lessons Quick Tour of Controlling Applets and Signing Code and Granting It Permissions might be a good start too.
Good luck,
Tim
[This message has been edited by Tim Blommerde (edited September 28, 2001).]
18 years ago
Dear Ronald,
I've written a small application for you that will do what you wanted. I've not added comments, because I think that you will be able to follow the flow quite easily and that together with the API's javadocs you will be able to understand the example without any difficulties.
Note that you can call the run the application with two different argument sets. Either by giving two dates:

This will computes the difference in days between the two days. If there's a difference in years, the answer will not be correct anymore. You could of course add a check in difference in years too, but that's up to you. The second parameter set should consist of a date and a number, with the character 'd' in front of it:

This will give the date, # days after the given date. Hopefully this will help you a bit further. Date calculations are a bit tedious, but with the above example and the previous posts, you should be able to write your application with one hand on your back.
Good luck,
Tim

Code Example - DateTest.java

[This message has been edited by Tim Blommerde (edited September 28, 2001).]
19 years ago
Dear Philip Pross,
Though I'm not completely certain because I've never tried it myself, I do believe you can use an applet on your own web page, while the applet's code is placed on another server. It is done by setting the codebase of the applet tag:

If you're going to try it, please post the result so others can see if it indeed worked or not.
Good luck,
Tim

[This message has been edited by Tim Blommerde (edited September 28, 2001).]
19 years ago
This might sound like a stupid question, but what browsers are you using to test the applet? I'm no Applet Guru, but for as far as I know, the way to call an applet in the HTML code is different between the two major browsers (Netscape and Internet Explorer) as well as the JVM the applets run in. So an applet might run in IE, but not in Netscape.
So, could you provide some more information on the browsers you're using to test the applet, because that's probably your problem. If you're using a IE on your windows environment and Netscape on your Mac, I'd search the web for some documentation on browser-differences for applets.
Good luck,
Tim
19 years ago