akoifman
asked on
JDateTimeChooser?
Hi,
I need a GUI widget to choose date and time. Can you point me to one?
Thanks,
Alex.
I need a GUI widget to choose date and time. Can you point me to one?
Thanks,
Alex.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I've search all over and can't seem to find one. Unless you want to pay money for a jClass package : http://www.klgroup.com/jclass/field/index.html
They do have somethng for time, but I think its pretty crappy.
Should be easy enough to design though. Something along the lines of:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class TimeChooserPanel extends JPanel{
private final static String[] AMPM = {"A.M.", "P.M."};
private JComboBox hour, minute, ampm;
public TimeChooserPanel(){
super();
create();
}
public void create(){
hour = new JComboBox();
minute = new JComboBox();
ampm = new JComboBox(AMPM);
for(int i = 1; i<12; i++) hour.addItem(Integer.toStr ing(i));
for(int i = 0; i<59; i++) minute.addItem(Integer.toS tring(i));
this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
this.add(hour);
this.add(minute);
this.add(ampm);
}
}
They do have somethng for time, but I think its pretty crappy.
Should be easy enough to design though. Something along the lines of:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class TimeChooserPanel extends JPanel{
private final static String[] AMPM = {"A.M.", "P.M."};
private JComboBox hour, minute, ampm;
public TimeChooserPanel(){
super();
create();
}
public void create(){
hour = new JComboBox();
minute = new JComboBox();
ampm = new JComboBox(AMPM);
for(int i = 1; i<12; i++) hour.addItem(Integer.toStr
for(int i = 0; i<59; i++) minute.addItem(Integer.toS
this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
this.add(hour);
this.add(minute);
this.add(ampm);
}
}
ASKER
What about a Time widget.
Thanks for the Date widget.
Alex.