Mark Mokris

Ranch Hand
+ Follow
since May 08, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Mark Mokris

In Java, there is an import distinction between primitive data types and objects. They are very different. When you wish to store an integer, you need a variable of type int. This always uses exactly 32 bits of memory.
Example: int i = 3452;
If I want to store a String (BTW In Java, Strings are objects, not primitive data types), you need an object reference variable, and then you have to instantiate the object.
Example:
String str;
str = new String("This is a test");
You can also write it using Java's shorthand notation for calling the String constructor.
String str = "This is a test";
Nonetheless, you are STILL creating an object reference variable of type String, and "pointing" it to a String object. This is different than a simple primitive data type like int.
21 years ago
It probably has to do with the CLASSPATH. The classes must now be in a directory which is the name of the package, and the CLASSPATH must include that directory. As is, when compiling the child class, the compiler can no longer find the compiled parent. This is not an issue when you have no explicit package.
21 years ago
You have to set the DOS PATH environment variable to "point" to c:\jdk1.3.1_08\bin. The installation set does not do this automatically.
21 years ago
I have a Windows-based GUI application that I wrote as a Java standalone application. I want to create a nice InstallShield installation set for it and make it as easy as possible for users to install on their Windows desktop. How do I install the Java JRE?
I can make the installation of the Java JRE as part of my install set. But others have suggested that I should check to see if the Java JRE is already loaded on the customer's machine.
My concern is...These will be relatively unsophisticated PC users. I DON'T want them to make any judgements about the Java JRE. I wouldn't have to worry about this if I programmed the application in Visual C++. So why should I have to worry about it with a Java app?
In fact, there is NO reason the end user needs to know that this app was written in Java. I want to avoid asking them "Is the Java JRE loaded? Where is the JAVA_HOME directory?" This would be silly to ask the typical noprogrammer I think.
Am I going to be able to create such a streamlined installation?
21 years ago
Hey Mike. That is a cool idea. I will try it.
What other resources might I create? Maybe the ServerSocket will be perfect. I don't have to actually use the ServerSocket instance of course? Or do I?
The idea is that it acts like a "memory switch." Right?
21 years ago
I have a Java standalone application which supplies a GUI to the user (i.e. JFrame). It is a "standard" windows-type application running on the desktop. It is started using the java command.
I want no more than one instance of this program running on a user's desktop at a time. Right now, a user can run multiple versions of the program just by starting from additional command prompts. Is there a way to check to see if an instance of the program is already running on the desktop? I am running on an MS Windows platform.
21 years ago
I have a Java standalone app which generates a HTML file and writes it out to the c: drive. I want to fire off the web browser like Internet Explorer passing the name of this file.
How do I execute a Windows based program from a Java app?
21 years ago
Is it possible to pass out info, maybe just a numeric code, out of an applet to the calling web page so the code may be interrogated by Javascript?
21 years ago
I am writing some applets using J2SDK 1.4 and IE6.
I activated the Java Console in IE6, but my System.out.println() message do not show up. They always used to. I always relied on these for debugging. Is there something else I have to activate?
Thanks Java Ranchers!
21 years ago
Thanks Michael and Eugene! Your posts are a tremendous help, and I appreciate the examples.
Mark
Thanks a lot for that perspective Mike! I followed your link to the white paper on HTTP protocol at the W3C web site. I see how that is the authorative source on HTTP of course, but that doc is too tough for me. Are there any other sources for this information that might be a little more user friendly?
I just want to know how to construct some of the HTTP requests. Some examples would go a long way.
I have been experimenting and learning more about the use of HttpURLConnection. It looks like I can write Java apps which programmatically access web pages and web sites. I am just wondering how far I can take this.
I can do the equivalent of a HTML <form action="GET"...> thru an HttpURLConnection and read the results with a stream. What if the form script I am posting to is expecting an action="POST" rather than action="GET". Can I still accomplish this programmatically through the HttpURLConnection since I can't string together all the name/value pairs with the URL?
Can I use HttpURLConnection to "sign on" with my user and password to a website and continue through an entire "ASP session", just like I would if I was physically typing and interacting with the web site.
I have a specific application in mind, and the answers to these questions would be my first step.
Thanks!
Sorry I don't have the solution to your problem, but will chime in and mention that the Sun One debugger was hanging on me also, so I abandoned it.
21 years ago
I have a GUI app with somes JTextFields. The text displayed or entered in these fields really "butts up" against the left edge of the field border. I would like to introduce a slight margin, maybe just a couple pixels.
Is that possible? I can't find it in my Swing docs.
Thanks!
21 years ago
Eugene! WOW! You are right on!!!
I would never have guessed this, but where it works I am using jdk1.3 and where it doesn't work I am using jdk1.4. I actually don't need the contentLength, I was using it to tell me whether the connection was successful or not. I guess I will just go ahead and read the thing and not worry aout the content length.
MAN I OWE YOU A BEER! THANKS!
Thanks for sending me the private message on this too.