Richard Muller

Greenhorn
+ Follow
since May 05, 2002
Merit badge: grant badges
For More
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 Richard Muller

I wrote a Windows executable that gets launched by double-clicking the name of java source program. My executable invokes java.exe with suitable parameters to cause the execution of DrJava.exe loaded with the content of the java file whose name was double-clicked.
My executable runs with a hidden window. By java.exe creates a Command window that serves no useful purpose in this app. Is there a simple way to suppress the creation of this Command window. Java.exe help does not indicate any option to cause it to run "silently".
The generated window's caption contains the fully qualified name of jave.exe. I guess I could get my app to search for that window and, when found, send it ShowWindow/Hide message. Any other idea?
21 years ago
I can access Tomcat on my workstation through http://localhost:8080 on IE6 over Win2000ProSP2.
I found the etc\hosts file which maps localhost to 127.0.0.1.
I added Tomcat mapped to 127.0.0.1:8080 and tried:
http://Tomcat
This didn't work -- I get the usual:
The page cannot be displayed
Any ideas how I can do this.
21 years ago
Can I download a new copy of HotSpot or do I have to reinstall J2SE in the hpe of solving the following problem.
I have a commercial app that displays a splash screen with a progress bar. This app has been running fine for a month or two, but failed to load today with the following lines:
HotSpot Virtual Machine Error, Internal Error
Error ID: 43113F32554E54494D45110E43505002CB
Problematic Thread: prio=5 tid=0x235dc0 nid=0x88 runnable
I had almost exactly the same error a month or so ago and discovered that I had two HotSpot directories from the current and previous version of J2SE. After eliminating the older one, all went well.
I'm running the following over Windows 2000 Pro SP2:
java version "1.3.1_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_03-b03)
Java HotSpot(TM) Client VM (build 1.3.1_03-b03, mixed mode)
21 years ago
Hi Dirk,
My question is: what's the easiest way to get a frame window automatically sized to contain it's components exactly.
The code I posted produces a window containg two components: (1) a scrolling pane containg a table; and (2) a pane containing three buttons arranged horiziontally.
But without my sizing statement (determined by trial and error):

the table wouldn't be displayed in full and abutted by the button pane. There would be a gap between them unless the user manually resized the frame window.
Regards,
Richard
[ May 10, 2002: Message edited by: Richard Muller ]
21 years ago
The window generated by the code below has its size set by the following line:

I determined the size by trial-and-error for a 1024x768 display. But I'd like to set the size dynamically. I tried packing the main window but that didn't work at all, presumably because the BorderLayout doesn't lend itself to that.
Will GridBagLayout give better results?

[ May 09, 2002: Message edited by: Richard Muller ]
[*** TAB characters removed ***]
[ May 10, 2002: Message edited by: Dirk Schreckmann ]
21 years ago
> Status � doesn't really need its own package though (unless �
I am definitely planning reuse.
> The line, bError? sMessage : "", is also still unnecessary.

Woops, great observation!
> � aren't using any object-oriented features
As Stroustrup said, he sees C++ as a �better C�, so I think of what I write as C++ all the time, even without coding polymorphism, etc. :-)
> � using a special status object to handle errors still seems pretty odd.
Granted, it probably looks weird to seasoned Java programmers, but to me it compensates for my loss of a preprocessor that lets me write my own shorthand. Old habits die hard. :-)
> � replace all calls to System.out.println() with calls to your own cout()
You�re prescient: you�re reading my mind before I even had the idea. Writing that long string has been bugging me! Now, I�ve just got to decide on the syntax to distinguish between:

Maybe cout/coutnl, though two extra letters my kill me. :-)
> RunExecutable(new String[] {"program.exe", "arg1", "arg2"})
That�s great syntax! Exactly the style I�m trying to adopt.
Finally, thanks again for all you help in educating me in Java. I�m sure our paths will cross again as I post other questions.
Regards,
Richard
P.S.
1.Obviously my post of the code omitted one thing: the subdirectory containing the (C++ based) binary executable that the RunExecutable invoked. I should probably have mentioned that.
2.All the routines other than main and Status were based on published code from TechRepublic's Java Anthology
[ May 09, 2002: Message edited by: Richard Muller ]
21 years ago
Hi David,
Thank you for continuing offer guidance.
I agree with you that your code for reading a line is obviously far better than mine ... if the goal were simply "read a line from the console".
But I'm trying to fry bigger fish.
(1) I want to simply the use of java for myself and perhaps other C++ programmers. So writing

instead of

is preferable to me.
Actually, I want a little more than that: I want minimal effort to detect and respond to errors.
(2) I'm not interested in doing this merely for one simple statement. The code below demonstates the several simplifications (to my mind) that I coded.
Pursuant to your suggestions, I improved:
(1) Removed extends Object: I stuck it in because I got a diagnostic regarding my defining toString(). Thanks to you, I now see that that "solution" was incorrect. It now occurs to me that every class inherently extends Object, so I see why it�s redundant.
(2) Removed st arguments; included initialization in all the support routines.
Following is the full code I have. In the light of all the above, I hope you take a more kindly view of it, but I would still value any guidance you may wish to provide. Again, thanks for all the time you�ve contributed to this little idea.
DemoStuff


Status

[ May 08, 2002: Message edited by: Richard Muller ]
[ *** TAB characters removed *** ]
[ May 09, 2002: Message edited by: Dirk Schreckmann ]
21 years ago
Hi David,
Thanks for commenting on my code. I've revised the code for and packaged Status, as shown below.
I continued passing the st argument because I need to reinitialize the static st object on every use of Status -- I'm confident you concur - and IMHO it's nicer to do it with the invocation of a routine rather than having it as a (forgettable) stand-alone line.
I did eliminate the unnecessary initializations in the constructor. In fact, I eliminated the explicit constructor entirely.
Below is the revised Status and an example of its utilization.
Again, thanks for your suggestions.
I'm still interested whether use of an interface would reduce the code in any respect.
Regards,
Richard
Status.java

DemoStuff.java

[ May 07, 2002: Message edited by: Richard Muller ]
[ May 07, 2002: Message edited by: Richard Muller ]
[ May 07, 2002: Message edited by: Dirk Schreckmann ]
21 years ago
I looked at interfaces a little, but didn't see how to apply them in this situation.
I finally got something reasonable working using an auxilliary class. Can we do better with interfaces (or any other way)?

[ May 07, 2002: Message edited by: Richard Muller ]
[ May 07, 2002: Message edited by: Dirk Schreckmann ]
21 years ago
Hi Bear,

You're an ex-C/C++ programmer


You've got that right!
Thanks for pointer [pun intended] in the right [Java] development.
Regards,
Richard
21 years ago
Hi All,
How do I pass a callback to a routine, and then invoke it? What I have in mind is something like the code below.
TIA,
Richard
21 years ago
Hi Dirk,
Thanks for the heads-up on UBB tags.

... so you must be very intelligent.

Thanks, I know the multiplication table, too.

Hope to see you 'round the ranch some more, pardner!

This milieu suits my temperment, since I do a lot of C/W dancing.
On a serious note, I like your site a lot. I'm accustomed to using NGs, but your site offers a finer breakdown of topics. Further, the respondents appear to offer substantive responses on point.
Finally, I'm thankful for the existence of the Web in general, because I need plenty of help as I tackle coming up to speed on Java. I come to this language with a built-in resentment for suffering the loss of so many features of C++ beloved to me. So thanks for your great work.
Regards,
Richard
21 years ago
One other suggestion: Autoexec.bat is a holdover from DOS. On current Windows versions, it is better IMHO to click on Start | Settings | Control Panel and select System and then the Advanced tab. Finally, add or edit CLASSPATH in the System variables listbox. This works on Windows2000 Pro and, I believe, on Server and Advanced Server. It probably works similarly on Win98 and WinME .. but I don't run the latter two, so I'm not sure.
Yoy folks posted some great responses on this thread. I played with it a little more, mainly to use Swing.
I added code to position the carat at the end of the field, and long data to test it. I noted that the default (for J2SDK1.3.1_03, anyway) is to put the carat at the beginning, regardless of length.
Finally, requestFocus for JComponent is not deprecated.
Code follows:

[ May 05, 2002: Message edited by: Dirk Schreckmann ]
21 years ago