java

recent posts related to java, jdbc, spring, etc.

A Java MySQL UPDATE example

Java MySQL FAQ: Can you share an example of a Java MySQL UPDATE example (using a Java PreparedStatement object)?

A Java MySQL SELECT example

Summary: This is a Java/MySQL SQL SELECT example, demonstrating how to issue a SQL SELECT command from your Java source code, using a MySQL database.

A Java MySQL INSERT example (using PreparedStatement)

Java MySQL INSERT example: Can you share a Java MySQL INSERT example, specifically using a Java PreparedStatement object?

A Java MySQL INSERT example (using Statement)

Java MySQL INSERT example: Can you share an example of a Java MySQL INSERT example using the Java Statement class?

Free Java and Object Oriented Programming (OOP) training material

Just a quick note that over the last few days I finished a major re-work of my old Java and Object Oriented Programming (OOP) training material. I used variations of this Java/OOP training material with several classes I taught from 1998 through about 2005.

I still need to make a few more changes to improve the material, but this big change involved reformatting the training material (courseware) into much longer pages that are easier to read, and improving the appearance of the pages.

Java temporary files - how to create and delete temporary files

Java File I/O FAQ: How do I create a Java temporary file? Also, after I create a temporary file, when is it deleted?

I just ran into this question on the Mac/Java mailing list, so I thought I'd write a quick "Java temporary file" test to explore this. Here are the results.

Java - the mouse cursor location (the current mouse position)

Java mouse cursor location FAQ: How do I get the location of the mouse (mouse cursor) in Java?

I just ran into this problem in my Java Robot programming, and the short answer is, to get the current mouse cursor location/position, use the getPointerInfo method of the java.awt.MouseInfo class, like this:

Point p = MouseInfo.getPointerInfo().getLocation();

A custom Java mouse cursor that displays the mouse XY coordinates

Java mouse FAQ: How do I create a custom Java mouse cursor (mouse pointer)?

For my Java/Swing XY mouse position/coordinates application I finally dug into Swing and figured out how to create a Java mouse cursor that shows the X/Y position (coordinates) of the mouse cursor at any moment in time. I can't figure the right way to word that, so it may not make sense, but hopefully this picture of what I've done will help demonstrate my custom Java mouse cursor:

Java - custom mouse cursor - show X/Y coordinates/position/location

A Java JRuby screenshot (screen capture) example

Java image FAQ: Can you show me how to create a screen capture in Java?

I don't have any Java screen capture code to share at the moment, but if you don't mind a JRuby screen capture example (which you can easily convert to Java), this JRuby screenshot (screen capture) source code example should help point you in the right direction:

A Java Robot class mouse and keyboard/keystroke example

Java Robot FAQ: Can you show me an example of how to use the Java Robot class?

Answer: Um, yeah, sure ... I say that a little jokingly. Okay, what really happened is that while developing this Java Robot example code on my Mac, I had to reboot it about 10 times. When you use the Java Robot class, you're poking your head out into the native operating system, and if you mess up with your GUI events -- at least on a Mac OS X system -- a lot of bad things can happen.

Syndicate content