One thing to note about jEdit if you're going to use it on Microsoft Windows: If you like to open files from the Windows Explorer by right-clicking on a file, and then selecting an option like "Open with jEdit", you need to use the Windows installer.
Scala, Java, Unix, MacOS tutorials (page 424)
I don't write much in the way of business application code any more, but if I did, I would generate Java code like crazy.
Think about it, whenever you write database-driven applications, one common denominator is that every database driven project has the database design completed before you start coding. And then, once you start coding, I'll bet 80% of the code is related to what I call CRUD ("create, read, update, delete") functionality.
And you know what -- you can generate this Java database code, either statically, or more powerfully, dynamically.
I can never find a list of states for an HTML select/option list (aka, combobox, drop-down list) when I need one, so I’m putting two versions here. The first select/option list shows a list of states, but only shows the abbreviations of the states:
By default jEdit stops at the beginning and end of each word when using the "next word" (CTRL + Right Arrow) and "previous word" (CTRL + Left Arrow) actions. Personally, I don't like this; I'd much rather it stop only at the beginning of each word. Fortunately the authors have made it easy to change this, if not easy to find.
To change this behavior in jEdit, you just need to remap the keystrokes to alternative actions. Just follow these steps:
Java servlet redirect FAQ: Can you provide an example of how to perform a Java servlet redirect?
Some time ago I wrote about forwarding from a servlet to a JSP. Depending on the circumstance I might rather redirect from a servlet to a JSP. When I need to to do a redirect instead of a forward I use this code:
Here's a quick note for those of us that like to create prototypes during a requirements process using HTML. Whenever you want to create a button that is supposed to simulate the action of moving to another screen, you can use code similar to the following code snippet to simulate this behavior:
Java Hibernate debug faq: How can I see the SQL that is actually being run/executed when I'm using Hibernate?
To debug Hibernate output, just configure this parameter in your hibernate.properties file:
hibernate.show_sql=true
This Hibernate configuration parameter will cause Hibernate to show the actual SQL that is being generated/used when your queries are run. Of course it can be a little verbose, but hopefully it will also give you all the SQL you need to troubleshoot your problem.
Here are a few links that I've been reading today:
- Alice in Use Case Land
- Data Flow Diagrams vs UML Functional Analysis Techniques
- Software development cost estimating tools
Here's a page that lists a bunch of cost estimating tools for software development.
JTable popup menu introduction
Here's a copy of a class file I created to demonstrate how to put a popup menu (JPopupMenu) on a JTable in a Java application. Actually, the intent of this particular class was to see if I could get the popup menu to work on the header cell of a JTable, but that ended up being a no-brainer.
Wow, it's been a long time since I've done anything out here. Busy, busy, busy. Here's a link to a tutorial I've written about creating a splash screen for Java applications.
Introduction
This Java Monte Carlo simulation tutorial, and the corresponding Java program, was inspired by the story and subsequent movie "Minority Report", as well as my recent interest in Monte Carlo simulations.
A co-worker, Chris Smith, created a very elegant Perl program to parse a Microsoft Excel XLS file for me some time ago. I recently modified that program to convert what was essentially a "glossary" in an Access database.
I first saved the Access database table as an Excel file. Then I used the following Perl program to extract the contents of the second and third columns from that file, and write them out to another file. The output file was in a Wiki (technically TWiki) format.
Here's a link to a tool named JSmooth that lets you create Windows executable files from standard Java JAR files. It looks like this can make the installation process on the Windows platform much more friendly.
Ant web build script FAQ: Can you share an example Ant build script for a web application?
Sure, here's a sample Ant build script for a Java web application. I've included other example Ant scripts for Java Swing/JFC/GUI applications on this website, but this one demonstrates how to use Ant to build a web app instead.
Ant Swing build script FAQ: Can you share an example of an Ant build script for Java Swing applications?
Here is another sample Ant build script for a Java application. Again, I hope it can help you "Learn Java by Example", or in this case, "Learn Ant by Example".
Ant Java build scripts: Can you share an example of an Ant build script for a standalone Java application?
This is a sample Ant build script for a Java application I wrote. It is a GUI/Swing application named "AlwaysOnTop". I include it here because I'm a big believer in learning by example, and maybe this Ant script can help you create an Ant script for your own applications.
Note to self: Don't *ever* take shortcuts when writing code, even prototypes. Every time an application gets to a certain size, you'll regret those shortcuts, because you won't be able to do what you want to do in a timely manner.
There's something good to be said about "the simplest thing that could possibly work", but don't take that to mean "taking really dumb shortcuts is okay".
Java String array FAQ: Can you share an example of how to determine the largest String in a Java String array?
Sure, in this tutorial I'll share the source code for a complete Java class with a method that demonstrates how to find the longest String in a Java string array.
Finding the longest string in a Java string array
Here's the source code that shows how to find the longest string in a Java String array: