I want to use the Nebula CDateTime component, but I have the problem, that the selected date is not marked in the panel (selected is the 17):
What do I need to change so that the selected date ishighlighted?
There's a bug report about this:
Highlighting feature for CDateTime. There's also code that you could use to get it working in your code.
Unfortunately, it doesn't seem to ever have made it into the release version for whatever reason.
Related
The current JavaFX implementation of a DatePicker only allows you to select a year and month by clicking the < > buttons. Most modern implementations of DatePicker allow you to select the year for example like this:
How do we get this functionality?
So far I have not seen a datepicker with that feature in JavaFX. Neither the javafx.scene.control.DatePicker nor the ControlsFX- and JFXtras-controls have such a functionality as far as I know (ControlsFX even doesn't provide a datepicker to my knowledge).
However on http://calendarcontrolinjavafx.blogspot.com/2012/01/calendar-control-in-javafx-20.html there is a custom datepicker with such a functionality (but with a different style) together with a demo application.
Unfortunately the implementation is from 2012 and is in JavaFX 2. However, with minimal changes it runs with >= JavaFX 8. Below are a few snapshots. I have no idea concerning the stability but maybe it's worth a try.
I am not sure if you needed a year picker or a year-month picker but I assume the latter. I also needed one for year-months and could not find anything that works for javafx 8 or above so I wrote one: https://github.com/perNyfelt/fx-yearmonth-picker.
For my company, I'm working on an Eclipse plugin which should do the following: show a table with sentences from the active editor that are incorrect in some way, accompanied by proper feedback. So far, so good.
However, sometimes the sentences/feedback are incorrect. I want a third column with checkboxes so that, when clicked, the related sentence/feedback combination is put in a different tab. Because I'm only programming in Java for 2 weeks now, I'm stuck: the plugin (written by my predecessor) is a class 'public class feedbackView extends ViewPart' using TabFolder and Table. But when I try to include checkboxes, all examples on the Internet use JTable. And I cannot get JTable to work in the current script and in the way I want (in Eclipse itself, instead of in a separate frame).
Ideally, I want Example of feedbackView with TabFolder. If in the 'Hide?' column the checkbox is checked, the sentence/feedback row should be transferred to the '||Hidden||' tab.
After this long introduction (hopefully clear), my questions:
Can I use Tabfolder/Table for this? Or
Should I use the JTable class (and how can I get this to work)?
Thanks in advance!
JTable is from Java Swing, with is the Java GUI component. Where Eclipse Table is the an Eclipse GUI component. There are two different world, for building GUI's in Java.
Warning: You can not mix these two different Java GUI libraries!
I am using the below library JDateChooser, which is a Date Picker GUI which we can put into Netbeans pallet.
http://plugins.netbeans.org/plugin/658/jdatechooser-1-2
However this do not display any dates. Dates are empty. Below is the image.
I do not have to post the code here, because I did nothing other than dragging and dropping the GUI element. Can someone please tell me why this is happening?
JDateChooser from vadimig doesn't seem to work with Nimbus, seems to work okay for Windows look and feel, you'd have to test it with the other system looks feels.
Either change the component you are using or change the look and feel you are using
The problem is the width of the component, just increase that value.
If your DateChooserCombo is called chooserDate, it must be like this:
Dimension size = chooserDate.getCalendarPreferredSize();<br>
size.width += 90;<br>
chooserDate.setCalendarPreferredSize(size);<br>
I am looking for a component for Swing that would do the same thing that Windows 7 date and time pickers do (or be even better). They look so:
And have following features I need:
you cannot enter an invalid value (value is ignored as you type and not when you leave the field)
it allows continuous updating of the field until the first change made by user (take a look on the time setting in Windows 7)
you can select and change at once only one position - not the whole text at once (so colons and points cannot be removed)
up and down buttons
calendar button (but it's rather optional for me)
I have tried JSpinner with a DateEditor but it doesn't have this features. JXDatePicker only adds the calendar button.
Generally I am looking for a nice way to let user enter date and time in a powerful and simple way. Windows 7 solution seems to be quite good.
Thank you!
best and free DatePickers around are JXDatePicker and JCalendar, in both cases are there focus about correct implementations of Date and Focus workaround, and excelent Renderer and Editor for JTree / JTreeTable / JTable
to your needs ---> all these funcionalities are implemented by default, not clear from your questions exactly whats wrong, I'm Win7 and JXDatePicker and JCalendar but I never saw these issues,
in both cases you have to implementing own workaround for SpecialDays as hollydays (and etc),
Is it possible to add a DateTimePicker to a JTable Cell.A particular column should be updated with date and time..Is it possible to add such a component to a JTable
The LGoodDatePicker library includes three TableEditor classes. These classes allow the programmer to add a DatePicker, a TimePicker, or a DateTimePicker, to the cells of a Swing JTable (or to a SwingX JXTable).
Fair disclosure: I'm the primary developer.
The picker classes can also be added to normal swing panels or other swing containers.
Here is an example of how to add a DateTimePicker to your JTable:
// Create a table.
JTable table = new JTable(new DemoTableModel());
// Add the DateTimeTableEditor as the default editor and renderer for
// the LocalDateTime data type.
table.setDefaultEditor(LocalDateTime.class, new DateTimeTableEditor());
table.setDefaultRenderer(LocalDateTime.class, new DateTimeTableEditor());
// Explicitly set the default editor and renderer for column index 0.
TableColumn column = table.getColumnModel().getColumn(0);
column.setCellEditor(table.getDefaultEditor(LocalDateTime.class));
column.setCellRenderer(table.getDefaultRenderer(LocalDateTime.class));
I've pasted screenshot below of the table editor demo, the picker components, and the full demo. Note that the library includes a separate demo for the table editors. It's in the Repository under this folder: "LGoodDatePicker/Project/src/main/java/com/github/lgooddatepicker/demo/TableEditorsDemo.java".
The library can be installed into your Java project from the project Release Page.
The project home page is on Github at:
https://github.com/LGoodDatePicker/LGoodDatePicker .
.
Yes it is. See this Swing Tutorial Track:
http://download.oracle.com/javase/tutorial/uiswing/components/table.html#combobox
Try to use the FLib-JCalendar component as an CellEditor in a JTable.
(and post the working example here if you made it work)
Yes, but you'll need to implement both TableCellRenderer and TableCellEditor. As suggested by #Jens Schauder, the tutorial may be helpful. You might also look at this tutorial based example using JCheckBox.
Simply use this code to set DatePicker in column 0:
TableColumn dateColumn = YOURTABLE.getColumnModel().getColumn(0);
dateColumn.setCellEditor(new DatePickerCellEditor());
By using the premise of Jens link and applying that logic with the below link, you can add a date time picker into a JTable, just be careful, combining JCheckbox, JCombobox and the date time picker into a JTable the focus get a little messy, but i believe it can be solved with a focus listener, it will just take some time t implement.
I am currontly working on such a Table render-er with will incorperate it all, i will post it online when im done.
Link: date and time picker in JAVA