Defining a dd/mm/yyyy field within an abstract table model
Posted
by
Simon Andi
on Stack Overflow
See other posts from Stack Overflow
or by Simon Andi
Published on 2010-12-28T18:10:33Z
Indexed on
2010/12/28
21:54 UTC
Read the original article
Hit count: 322
java
I have defined an abstract table model but one of the columns should house date values as dd/mm/yyyy format not sure how to do this.
I have a external global file and have hard coded the dates as dd/mm/yyyy.
How can I define this column within my abstract table model so that to only allow only dates having dd/mm/yyyy format.
public class OptraderGlobalParameters
{
public static boolean DEBUG = true; //Set DEBUG = true for Debugging
/*=========================*/
/*Table Array For Dividends*/
/*=========================*/
public static String[] columnNames
= {"Date",
"Dividend",
"Actual",
"Yield (%)"
};
public static Object[][] data
= { {"dd/mm/yyyy", new Double(5), new Boolean(false), new Boolean(false)},
{"dd/mm/yyyy", new Double(5), new Boolean(false), new Boolean(false)},
{"dd/mm/yyyy", new Double(5), new Boolean(false), new Boolean(false)},
{"dd/mm/yyyy", new Double(5), new Boolean(false), new Boolean(false)},
{"dd/mm/yyyy", new Double(5), new Boolean(false), new Boolean(false)},
};
}
© Stack Overflow or respective owner