|
Advertisement
|
Forum posts by Charles Bell:Posted in Java Answers Forum, Jun 20, 2002, 12:03 AM
import java.text.*;import java.util.*;public class FormatStuff{ public FormatStuff(){ doStuff(); } public static void main(String[] args){ new FormatStuff(); } public void doStuff(){ //format I get from database is 2002-06-20, and I want to show it as 20th June 2002 System.out.println(formatDateString("2002-06-01"));...
Posted in Java Answers Forum, Jun 19, 2002, 11:45 PM
All you have to do is split the number into two parts, the integer part and fraction part.Leave the fraction part alone.Format the integer part as in the program and then concatenate that string with the string value of the fraction part.
Posted in Java Answers Forum, Jun 19, 2002, 10:23 PM
On my machine, this gives:>java FormatStuff1st June 20021st June 20022nd June 20022nd June 20023rd June 20023rd June 200214th March 200230th May 200225,000.642233,354,550.9222,455,000.6421,234.652,544,000.64225,899,999 ,000.647
Posted in Java Answers Forum, Jun 19, 2002, 10:21 PM
import java.text.*; import java.util.*; public class FormatStuff{ public FormatStuff(){ doStuff(); } public static void main(String[] args){ new FormatStuff(); } public void doStuff(){ //format I get from database is 2002-06-20, and I want to show it as 20th June 2002 System.out.println(formatDateString("2002-06-01"));...
Posted in Java Answers Forum, Jun 19, 2002, 7:36 PM
There is an excellent article:Using Timers in Swing Applications at:http://java.sun.com/products/jfc/tsc/articles/timer/
Posted in Java Answers Forum, Jun 19, 2002, 2:39 PM
Note to the administrator:The java tags would not preserve the indents in this file. Some people get flamed over tiddly things like that. Please don't flame me. I don't care either way. I know how to use my text processor./* ClickRectangle.java* @author: Charles Bell* @version: June 19, 2002*/import java.awt.*;import java.awt.event.*;import...
Posted in Java Answers Forum, Jun 19, 2002, 1:09 PM
All you have to do is unzip or jar xvf src.zipthe src.zip file that comes with the java development kit which you already have./* * @(#)Byte.java 1.28 01/12/03 * * Copyright 2002 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package java.lang; /** * * The Byte class...
Posted in Java Answers Forum, Jun 18, 2002, 10:13 PM
Hey, a JTextArea is not the normal graphics context for drawing. You should use a Canvas or a Panel or JPanel.Applets and JApplets are subclasses of Panel.Here is some simple demo code I wrote for you doing line sketching on a Canvas./* SimpleLineSketch.java * @author: Charles Bell * @version: June 18, 2002 */ import java.awt.*; import...
Posted in Java Answers Forum, Jun 18, 2002, 7:11 PM
The following is an example of a program that manages employee objects. The program allows the user to add, delete, and view employee objects which can be created, and deleted dynamically at run time, and saved for next time the program is started.I used properties files as a convenient way to store the data for an employee in a file for easy...
Posted in Java Answers Forum, Jun 18, 2002, 7:11 PM
The following is an example of a program that manages employee objects. The program allows the user to add, delete, and view employee objects which can be created, and deleted dynamically at run time, and saved for next time the program is started.I used properties files as a convenient way to store the data for an employee in a file for easy...
Posted in Java Answers Forum, Jun 18, 2002, 2:57 PM
Vector aliens = new Vector();aliens.add(new Alien("v1"));aliens.add(new Alien("alpha two"));aliens.add(new Alien("r2d2"));aliens.add(new Alien("victor"));aliens.add(new Alien("spongeBob"));class Alien{ private String name = ""; public Alien(String name){ this.name = name; } public String getName(){ return name; }}
Posted in Java Answers Forum, Jun 18, 2002, 12:29 PM
Your links give:This page is not available.
Posted in Java Answers Forum, Jun 18, 2002, 12:26 PM
Follow this link:http://www.acm.org/crossroads/xrds4-3/codeob.htmlor any of the results from this search link:http://ixquick.com/do/metasearch.pl?cat=web&cat=web&cmd=proces s_search&language=english&query=java+code+obfuscator
Posted in Java Answers Forum, Jun 17, 2002, 10:14 PM
It looks to me like the length of your fields are not always going to be the same length. Example:$14.95 as a string is not the same as $101.98If you truly want to code your file data so you can read in a random access way, the data must be formatted and padded so that each chunk is the same length so that your program can calculate where to...
Posted in Java Answers Forum, Jun 17, 2002, 9:51 PM
/* Visualize.java* @author: Charles Bell* @version June 17, 2002*/import java.awt.*;import java.awt.event.*;import java.awt.image.*;import java.io.*;import javax.sound.sampled.*;import javax.swing.*;public class Visualize extends JFrame implements ActionListener, Runnable{ private Thread thread; private AudioInputStream ais; private float...
|