Navigation Home / Tags / Java

ranking Sort Sort   |   date Sort Sort   |   member Sort Sort
Syndication

4
Date Submitted Mon. Oct. 23rd, 2006 5:35 PM
Revision 1
Beginner jonathanstarrett
Tags "form input" | Java | JComboBox
Comments 0 comments
I was looking for an easy way to populate a combo box with strings taken from an enumeration, and also to be able to pull out Enum objects from the combo box. After some searching, I found EnumComboBoxModel on the JDesktop website, but was not able to find any code.

Instead I came up with an easier solution that did not require me to define a new Model class, but instead uses javax.swing.DefaultComboBoxModel.

Sorry for the disorganization of the code, but hopefully you get the idea.
4
Date Submitted Mon. Jan. 23rd, 2006 6:55 PM
Revision 1
Coder mattrmiller
Tags Customized | Java | JSlider
Comments 0 comments
Customize JSlider Labels
5
Date Submitted Tue. Feb. 14th, 2006 4:59 AM
Revision 1
Scripter TimYates
Tags Arrow | Graphics | Java | Line
Comments 0 comments
Draws a line (with arrow head) between two given points.
5
Date Submitted Mon. Oct. 30th, 2006 1:03 AM
Revision 1
Scripter SCoon
Tags C | CPlusPlus | Java | Ruby | String
Comments 3 comments
This class intended to collect TODO comments from java/c++/etc source files.

Example:

protected readFileData (String path) throws IOException {
// TODO: add try...catch block for IOException
InputStream is = new FileInputStream(path);
...
}


See also DirectoryScanner class.
5
Date Submitted Wed. Oct. 11th, 2006 7:15 AM
Revision 1
Beginner toriwells
Tags com | Date | Java
Comments 0 comments
This function returns a Date object being set at 12 A.M. It is useful for comparing dates where you don't know if they'll come set at the beginning of the day or not.
5
Date Submitted Mon. Aug. 13th, 2007 12:04 AM
Revision 1
Beginner bcoe
Tags Java | RSS | SAX | XML
Comments 0 comments
From a tutorial on building an RSS SAX parser on my website:

full article can be found here
6
Date Submitted Fri. Feb. 17th, 2006 8:54 AM
Revision 1
Scripter TimYates
Tags Java
Comments 1 comments
More often than not, if your trying to work out what's going wrong with your subclass of InputStream, why the character encoding is getting lost in your database, or your file format reader is failing, you'll need to dump a byte buffer out in a useable form.

Here's two methods, one which appends to a StringBuffer, one which simply prints out to System.out

Tim.

(NB: The line: sb.append( "n" ) ; SHOULD have a leading slash ie: sb.append( "\n" ) ; but the formatter seems to remove it...
6
Date Submitted Fri. Apr. 7th, 2006 9:50 AM
Revision 1
Helper jpinkham
Tags CLASSPATH | DOS | Java
Comments 2 comments
Here's a nifty trick I often use for testing.

Lets say you have a c:\foo\lib directory full of jarfiles for log4j, javamail...whatever.

Modern J2EE containers do a nice job of letting you deploy a jarfile with your code and have a lib directory full of jarfiles like this, but what if you just want to run a quick client from the command line?

Here's what you do:
6
Date Submitted Sun. Jul. 23rd, 2006 5:39 PM
Revision 1
Helper rugi
Tags Array | Java | Random
Comments 0 comments
Method for get n random number's
6
Date Submitted Wed. Sep. 13th, 2006 9:47 AM
Revision 1
Helper alambkin
Tags Exponentiation | Fast | Java
Comments 1 comments
A simple tool used for fast Exponentiation. Very useful if you are creating your own cryptograpgic methods.