Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

4409723

Suspended
Original poster
Jun 22, 2001
2,221
0
A little background before I get to the point.

I'm in the IB (International Baccalaureate) which is like the AP system in American, or A-levels in England.

Each student is required to write one 3,500-4000 word essay to get their diploma. Periodically throughout the year the administration want to see the progress made on this essay. What follows is usually mass confusion and it's a pain to get your essay back. They often got lost, including my two last submission.

In my computer class I set out to fix this issue by making all the submissions online. It'll be great when it's done and it's almost there. What you're seeing now is the administration's side of the program. Included in a Pre-compiled double-clickable jar and the source code. The program allows the administration to see the student's essays and leave comments. There will be two ways of going through the students, the forward/back button and the drop down menu, both currently in the program. Here is where you guys come in. Independently these work, but when when using the forward and back buttons the drop down menu does not update. I have spent much of today working on this. If you could do this you'd be FIRST on my list to get a gmail invite (when I next get the option) or you would atleast have my eternal gratitude.

Thanks! Any questions, post 'em here!

http://wesley.wsgurus.com/JavaIssues.zip
 

slughead

macrumors 68040
Apr 28, 2004
3,107
237
oh pre-compiled version eh? and you want your school to use this to grade your paper with?

hrm... ;)
 

4409723

Suspended
Original poster
Jun 22, 2001
2,221
0
Don't worry, security will be upped as soon as it is all functional ;). And it's not grading AT all, just leaving comments on progress.
 

King Cobra

macrumors 603
Mar 2, 2002
5,403
0
I can't get passed testDriver() because of the exception (caught) java.lang.ClassNotFoundException. Am I missing something?
 

4409723

Suspended
Original poster
Jun 22, 2001
2,221
0
You need to define mysql.jar (or mysql-connector-java-3.0.14-production-bin.jar same file, just renamed) in the classpath. Thanks for trying it out!

EDIT: I hope you're compiling that yourself, the pre-compiled jar shouldn't have those issues.
 

slughead

macrumors 68040
Apr 28, 2004
3,107
237
Uh.

In java, you have to re-run the constructor after you update something in the UI

I *think* this will work.. I can't get XCode to compile so just replace the back and forward action listeners with this:

Code:
	public class Forward implements ActionListener {
		public void actionPerformed(ActionEvent event) {
			collectguidata();

			try {
				Statement s = conn.createStatement();
				ResultSet rs = s
						.executeQuery("select min(student_id) as next_student_id from essays where student_id >"
								+ student_id);
				//				rs.next();
				if (!rs.next() || rs.getInt("next_student_id") == 0) {
					rs = s
							.executeQuery("select min(student_id) as min from essays");
					rs.next();
					student_id = rs.getInt("min");
				} else {
					student_id = rs.getInt("next_student_id");
				}

			} catch (SQLException e) {
				System.err.println(e.getMessage());
				System.out.println("Error Increasing Student ID");

			}
			collectdbdata();

			updatenameloader();			
			ComboBox.setSelectedItem(nameloader);
                        Viewer();

		}

	}
	

	public class Back implements ActionListener {
		public void actionPerformed(ActionEvent event) {
			collectguidata();
			try {
				Statement s = conn.createStatement();
				ResultSet rs = s
						.executeQuery("select min(student_id) as previous_student_id from essays where student_id <"
								+ student_id);
				//				rs.next();
				if (!rs.next() || rs.getInt("previous_student_id") == 0) {
					rs = s
							.executeQuery("select max(student_id) as max from essays");
					rs.next();
					student_id = rs.getInt("max");
				} else {
					student_id = rs.getInt("previous_student_id");
				}

			} catch (SQLException e) {
				System.err.println(e.getMessage());
				System.out.println("Error Decreasing Student ID");
				
			}
			collectdbdata();
			updatenameloader();
			ComboBox.setSelectedItem(nameloader);
                        Viewer();


		}

	}
 

4409723

Suspended
Original poster
Jun 22, 2001
2,221
0
Not working:


The method Viewer() is undefined for the type Viewer.Back
The method Viewer() is undefined for the type Viewer.Forward
 

slughead

macrumors 68040
Apr 28, 2004
3,107
237
Wes said:
Not working:


The method Viewer() is undefined for the type Viewer.Back
The method Viewer() is undefined for the type Viewer.Forward

oh right, right right


replace Viewer with Super.Viewer() .. (is that right?)

I know you have to run the display parts again, I'm not sure if viewer will override the existing settings or not...
 

slughead

macrumors 68040
Apr 28, 2004
3,107
237
and by the way, how the hell do you get xcode to compile java??

The build menu is all disabled
 

hariprasad787

macrumors newbie
Oct 23, 2008
1
0
Problem with java swing

Hi,

I have developed an application using netbeans(Swing) on windows platform.
It is working fine. But when I try to run the same application on macintosh platform. But the application window doesn't appear properly. Menus and other parts are not visible. Only when the mouse cursor is moved over the menus, thumbnails viewer etc.... these things starts to appear on the application window.

Can anyone sugggest me the reason for this issue and things to be done to fix this issue?


Regards,
Hariprasad
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.