John Martinson

Greenhorn
+ Follow
since Jun 17, 2005
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 John Martinson

you've probably already done this but try looking at
http://java.sun.com/docs/books/tutorial/uiswing/components/frame.html

It's a nice gui tutorial.

You may need to set the layout manager for your FRame

JFrame.setLayout(LayoutManager arg);

Hope this helps
18 years ago
I did put in dubugging statements. I usually don't ask someone for help until I've done all that I know to do. (Which I know other people who don't).

I did not however put a debug statement at the last line of the thread. And when I did that it worked. Turns out it was doing everything but automatically Exiting the System. So I just put System.exit(0); Where it should have naturely died on it's own.
18 years ago
Bad form on my part-- StringTokeniszer.nexttoken.()trim() will return String.

John
18 years ago
the String tokenizer returns String on the return. Your code shouldn't even compile.

Try changing the int departureDate --- String departureDate.

John
18 years ago
Sorry to leave out the details.

What it does is it opens a text file and and two excel files. It then sorts out unneeded items from the text file based on the contents of the two excel files. It uses the POI API to read the Excel files, and write the output in an excel file. it deals with perhaps 100s of 1000s of String comaparisons as each run involves files with houndreds of row of data.

I originally designed to run from commandline arguments that user would give indicating where all the files are located. When I run it that way it runs fine. Then I set it up to recieve a "-g" parameter to use a GUI to get that same information.

I have a main class that recieves the parameters. When it recieves the file names as parameters they are passed to the object that does all of the work and everything works just fine.

When the main class recieves a "-g" parameter it runs the following code and this is the only thing that is different



I run the file using the following command line
java -cp .\lib\JMOD.jar;.\lib\POI.jar; jmod.JMOD -g

Thanks
18 years ago
I have an app that I am running in JRE 1.3 and 1.5. It started out as just a simple UI with cammandline arguements and had no problems. When I made a GUI Version of it it hangs in JRE 1.3, but not JRE 1.5.

When I look at the task manager in Windows it's getting 0 CPU usage.
Normally it gets 98 or 99 CPU usage. I can't figure out what the difference is.

any suggestions
18 years ago
Does anyone know of a better way to update the contents of a Jtable?


John Martinson

The more I learn the more I realize I don't know anything --some guy

18 years ago
I'm trying to connect to a MS Access 97 database that is password protected and I know the password and I enter it into my application correctly and I even open the data base thru access with no problem. But my application keeps telling me I have an invalid password.

Is there some sort of incompatable encrypting going on behind the scenes or is it just bad code?

John
thanks that hit the spot
18 years ago
Just real quick before I go home for the night, maybe someone can answer and save me some time searching in the morning.

I would like to use JAXP in an application that has be able to run on the JVM 1.3. 1.5 is not supported by our wonderful Information Management community. I've poked around a bit on java.net for the JAXP jars so that I can include it in my application. According to java.sun.com it's there but I'm either blind or they hid it really well. (I'm not excluding blind)

Thanks in advance.

John Martinson
18 years ago
Problem resolved. No Idea what it was I just changed retyped my SQL statement to make it clearer to read and it worked. No idear what made it work but here's the code for those really demented people who might want to figure it out.



yeilds "true" so rs.next(); is not failing.
Okay,
I'm getting an Invalid cursir stat Error when I try to execute the following code.
myStmt = "Select COUNT(Closure) " +
" FROM moded" +
" WHERE " +
"(closure = \'OPEN\' AND " +
"[logged on] > #"+dBegin+"# AND " +
"[logged on] < #" +dEnd + "# AND " +
"field38 = \'" +catCount[i][0] +"\');";
System.out.println(myStmt);
rs = stmt.executeQuery(myStmt);
rs.beforeFirst();
rs.next();
System.out.println(rs.getInt(1)); <------
Error occurs here, and I don't know why. Should the rs be 1 int?

Thank you in advance
John Martinson
this is how it works, because I know people will search these later for an answer, I know I do

okay you make your jar file and then you go to the cammand line

and you type like so
java -cp c:\java\myjar.jar;c:\java\externaljar.jar; packagename/MainClass

I hope this will help someone in the future, because I had a doosy of a time figuring it out and no postings seemed to help until Ernest here posted his reply, thanks Ernest!

John (The one man programming show) Martinson
18 years ago
I've had success using the ResultSet class in java.sql. in the API specs on the java.sun page there are some examples and what not.

basicly what you do is
in psudo code*
// set Result rs = statemant.executeQuerry("SQL Querry");
//rs.next() will let you go through the rows
//String s = rs.getString(columnNo.);

that's a really simple and ugly overview, but once you start looking at the Java docs on http://java.sun.com/reference/api/index.html you'll get the idea on what to do.

John Martinson
18 years ago