Adam Altmann

Greenhorn
+ Follow
since Jun 08, 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 Adam Altmann

We're having a minor debate here, and we've been unable to find a definitive answer with Google.

When should you close PreparedStatements, and why?

Particularly, should you close them before reassigning?

For example:

PreparedStatement pstmt = null;

pstmt = whatever;
//Should I close it here? How come?
pstmt = somethingElse;



Thanks in advance.
Hello all,

I've been using Java for a while now, and have passed the SCJP exam, but feel as though my understanding of the language is less than complete. Before I start digging in to the J2EE and all it has to offer, I'd like to be more confident with my level of knowledge.

I'd like some suggestions on where to focus my attention. I'm comfortable enough with Swing, and can get by with what I know of JDBC. I'm currently reading up on design patterns, and then plan on diving into the java.util and java.io packages a bit further.

I guess what I'm asking is, what packages and/or classes do you find yourselves making use of most often? What should I focus on, to make the most of my time and become more productive? This may seem terribly vague, and I apologize. I'm simply not sure where I should go from here.

Any insight would be appreciated.

-Adam
18 years ago
It's the URL string for setting up a DSN-less connection to a FoxPro database. It works, but I want to know what each part means, or at least where I can find the information on my own. My Google-Fu is weak on this one:



Any guidance would be greatly appreciated.
I'm writing an application that has one main JFrame with a menubar. ActionListeners on the menubar call a seperate class, which will generate a JPanel, and that panel then gets added to the main JFrame. As of right now, all selections from the menubar will generate the proper JPanels, and everything works as intended. However, if I generate one type of JPanel, and then select a different one, I get graphical corruption. It looks as though components are being drawn on top of what's already there.

How do I reset the JFrame, making it a "blank slate" before I add a new JPanel?
18 years ago
I've managed to solve this riddle on my own. Further research showed that I needed to add the location of j2ee.jar to the CLASSPATH. Success!

(Unfortunately, now I'm having trouble with Tomcat seeing my servlet! Woe is me!)
My Dearest Java-People,

How are you? I am fine. I must admit however, that things are not going quite as splendidly as I had hoped concerning Servlets and JSP. I've managed to fumble my way through installation of the J2EE SDK 1.4 All-In-One Bundle, and have even managed to get Tomcat up and running. Life was looking rosy until I tried completing an exercise from one of the books I've purchased. It was at compile time when disaster struck! I now face six, count em', SIX disasterous errors.

People's Exhibit A:



Not being a completely hapless twit, I feebly searched the intarweb to help with my plight. It was in this, my darkest of hours, that I stumbled upon information regarding mysterious Environment Variables. With assistance from my aging grandmother, I've toiled to set the following:

%J2EE_HOME% C:\Sun\AppServer
%JAVA_HOME% C:\Sun\AppServer\jdk

Yet still I'm faced with those same half-dozen errors, and I know not what to do. I've become quite emotionally distraught, and now turn to you for aid. Hopefully someone will hear my piteous plea, and provide me what answers I seek, while I go drown my sorrows in a bowl of Mint Chocolate Chip Ice Cream.

Sincerely,

Adam
Hello,

Would it be possible for you to remove these foolish periods from my display name? I registered once before, sans periods, but had forgotten my login and password, and so was forced to reinvent myself.

I assure you it's me. I'm the only Adam Altmann I've ever known. (It's a shame, really.) So clearly I know what I'm talking about.

Thanks much.

-Adam
18 years ago
OR,

Since I may be doing things the Hard Way. Is there a way to get a JTable to show row numbers? I'm looking through the API as I type, but I'm not seeing anything.

Thanks again,

-Adam
18 years ago
Hello,

I'm working with JTables (It's good stuff.) and am using TableSorter to add cool, column-sorting goodness to my application. It works. It's fantastic. I get giddy just thinking about it.

My problem lies in the fact that I'd like to have a nifty little column on the left which holds the row number (like any spiffy database/spreadsheet thingie should). I'd like these to remain starting at 1 and incrementing per record...you know the deal. So, what I have to do is figure out how to get TableSorter to skip that particular column.

When I look at the TableSorter code, I'm "Like, woah." Can anyone point me in the right direction?

Thanks.

-Adam
18 years ago
Here's the code I've written. There are three seperate classes. One for the main() method, one to generate the backing GUI, and one for the internal frame.







The backing UI (with the menu-bar) shows up as Synth, while the internal frames show up in Motif. This happens when I run from the command-line, OR run from Eclipse.

Any ideas?

*Edit: I've run it on two seperate systems with the same result.
[ June 17, 2005: Message edited by: Adam. Altmann. ]
18 years ago
Hello,

I've been asked to write a Multiple-Document interface application, and have a very basic version up and running. It seems however, that the "Look and Feel" for JInternalFrame does not pay attention to the rest of the application. My backing frame (L&F = whatever the default is on Windows) does not match the internal ones (L&F = Motif). I've managed to change the Look and Feel for everything using UIManager, but it just doesn't look "the same". I'm wary of using Motif, as it will frighten the unsuspecting users.

Is there a simple way to "fix" these uncooperative Internal Frames without having to change whatever the Default Look and Feel is? (The L&F was "updated" with 1.5, was it not? I'm assuming it's that L&F that the backing frame is using, which is what I'd prefer).

Thanks,

-Lost in Wisconsin
18 years ago
The path to the .JAR file.

"C:\Documents and Settings\user\Desktop\Application.jar"

or

"C:\Applications\Application.jar"

etc.

It doesn't seem to matter where it is, it won't run if I set the Scheduled Task up like this...though it seems that Windows is trying to run it, since it produces the lovely JVM error.

Though if I set up the batch file as so:



...Scheduled Tasks will run it just fine.
18 years ago
Yes, I can run it from the Command Line. I've got:

C:\>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.5.0_03

C:\>echo %CLASSPATH%
.

C:\>echo %PATH%
C:\Program Files\Java\jdk1.5.0_03\bin;


I think that covers everything. I can run my application from the command line, or by double-clicking on it. If I go to add a Scheduled Task, and browse to the .JAR and add it that way. I get the "Cannot find main class" error dialog. But if I run a batch file including "java -jar Application.jar", it works just fine.

Am I missing something with either JAVA_HOME, PATH, or CLASSPATH?

Thanks for your help.
18 years ago
Update,

I've worked around this issue by writing a batch file to run the .JAR, and adding the batch file to Scheduled Tasks. The good news is it works now. The bad news is, I haven't learned why it didn't work in the first place. An unfortunate state of affairs, to be sure.
18 years ago
Also,

The manifest file contains the following:



Whis is correct, as far as package and name are concerned. Like I said, it works if I doubleclick it.
18 years ago