Solved

JDateTimeChooser?

Posted on 2000-03-21
3
405 Views
Last Modified: 2008-03-17
Hi,

I need a GUI widget to choose date and time.  Can you point me to one?

Thanks,

Alex.
0
Comment
Question by:akoifman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
stalefish earned 100 total points
ID: 2642412
0
 

Author Comment

by:akoifman
ID: 2642744
Hi,

What about a Time widget.  

Thanks for the Date widget.

Alex.
0
 
LVL 2

Expert Comment

by:stalefish
ID: 2646673
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.toString(i));
            for(int i = 0; i<59; i++) minute.addItem(Integer.toString(i));
            this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
            this.add(hour);
            this.add(minute);
            this.add(ampm);
      }

}
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question