Date Picker
Hi
I wish to use the date picker in a table cell. I believe I can make it work using a CellEditor but I need the Moneydance UI as a parameter. What is the easiest way of getting this?
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Sean Reilly on 31 Mar, 2015 12:35 PM
Hi Mike,
You can check out the example code I just commited for the security price entry (id: "priceui") extension in the git repo:
CustomDateFormat dateFormat = UserPreferences.getInstance().getShortDateFormatter();
asOfDate = new JDateField(dateFormat);
https://bitbucket.org/infinitekind/moneydance_open/src/030d094f622fc1fb3d1fd136b6b2f0061f64de33/src/com/moneydance/modules/features/priceui/priceEntry/PriceEntryScreen.java
Thanks!
Sean
2 Posted by Mike Bray (Quot... on 01 Apr, 2015 05:48 AM
Sean
JDateField does not work in a table cell. I see that there is a MD version of DatePicker and I was hopinmg to use that. It requires the MoneydanceUI as a parameter and I was asking how to get to the current instance. What I have worked out is:
MoneydanceUI mdGUI = Main.mainobj.getUI();
Is this valid and would you recommend its use?
Regards
Mike
Support Staff 3 Posted by Sean Reilly on 01 Apr, 2015 08:10 AM
Hi Mike,Isn't the JDateField a subclass of JTextField? I thought it was and could therefore be used I. A standard table cell editor.
4 Posted by Mike Bray (Quot... on 01 Apr, 2015 02:38 PM
Thanks Sean, you are quite right. Some months ago we had a similar discussion when I was trying to use a JDateField in a table without an editor. It didnot work and at that time you said that you haven't used a JDateField in a table. Putting it into a cell editor seems to work.
Mike Bray (Quote Loader Author) closed this discussion on 25 Apr, 2015 01:51 PM.