Contents
- Avoid typing in user input every time you run your program
- Convert a double to an int
- Example Java Applet with GUI Buttons
Java Tips
Avoid typing in user input every time you run your program
Modified: 2007-04-23 23:21:12
From #letu on irc.freenode.net:
22:12 < SirAlaran> Tip of the day:
22:12 < SirAlaran> To avoid typing in user input every time you run your
program, you can do something like this:
22:12 < SirAlaran> echo "csedegree.prj" | java Main
22:17 < SirAlaran> There's a better way though.
22:17 < SirAlaran> Stick all your sample input in a text file.
22:17 < SirAlaran> java Main < testFile.txt
This tip was originally from Dr. Baas.
- Java Examples: Convert double to string - Added: 2007-04-26 21:55:23
http://joecode.blogspot.com/2005/06/java-examples-convert-double-to-string.html
Convert a double to an int
Modified: 2007-04-26 21:56:03
If x is a double variable, just cast it to an int like this:(int)x
Example Java Applet with GUI Buttons
Modified: 2007-04-27 13:49:48
Here is the applet version of the last program I wrote for Computer Science 2: Graph Lines. I've also made the code available..