[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

JDateTimeChooser?

Posted on 2000-03-21
3
Medium Priority
?
411 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 400 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

656 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