Tim Batts

Greenhorn
+ Follow
since Aug 09, 2010
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 Batts

1. In my experience autogenerated SQL is never a good idea unless you truly don't know any SQL at all. It is rarely the most efficient or simplest way to process a DBMS request and often doesn't even do it right. In this case, I don't have the slightest idea why it generated what it did.

2. I'm not following why you have the Employee table joined to Dept, joined back to Employee again (t2). My understanding is that you want to return all employee records regardless of whether they are assigned to a Dept or not (thereby getting the record with no dept assigned)? This can be achieved by simply selecting whatever name and dept info you need

FROM Employee
LEFT OUTER JOIN Department
ON Employee.DeptID=Department.DeptID

Of course, using your own table names, but you get the idea.
I can't. The IDE won't let me edit the generated code. Which I think is stupid.

I did find a work around: the generated code for the main is this:


I replaced it with the following to actually set a reference variable for the form:

But I don't understand why running that statement in the constructor would not have maximized the frame. I would think it would work no differently than the previous statement setDefaultCloseOperation and should execute.

Altering the main as I did works, but if someone can confirm for me if that will have other consequences for the application I would appreciate it. Or if there is another way to do it.
9 years ago
I am generating a swing JFrame via NetBeans and the goal is to get it to maximize automatically when the JFrame opens. JFrame is implemented as a class extension of javax.swing.JFrame.

I thought setExtendedState(JFrame.MAXIMIZE_BOTH); would work, but it isn't. Can anyone help?

9 years ago
Every program has to have a main() because that is the main method that kicks everything else off. In Head First some of the examples they give are incomplete because they are only intended to show you a particular part of the coding process, especially at the beginning. I think this is one of those cases
9 years ago
That's what I thought. I have jdk 1.6.0_21 and had to add an entry to the PATH variable to point to the \bin directory within the main Java directory
9 years ago

David Newton wrote:That would not lead to the error you posted above, unless you started using a version that automatically put the current directory on the classpath, but okay. Glad you got it working. What version are now using to run your application?



Question: could this error have been caused by adding an entry to the PATH environment variable?
9 years ago
I found it:

Echo e2=e1;

should be

Echo e2=new Echo();

to create a new instance rather than duplicate the original count
9 years ago

Paul Clapham wrote:Evidently you didn't notice the "Code" button above the box you posted in. Try it again: first click the Code button, then paste your code between the tags which it generates.



Thanks... I'm new to the forum scene as well
9 years ago
sorry about the indent format... the indent was there when I pasted the code to the forum, but disappeared when I submitted my post
9 years ago
Brand spankin new rookie here. Entered the following test class and my output is incorrect. e2.count is supposed to end at 10 but I get 24 when I execute it. I've desk-checked 3 times and I get the 10 I'm supposed to, but output is still 24. Any ideas?

9 years ago