Bug In Java 5 Date/Calendar Timezone Implementation (possibly 6 also)

Hey All,
Really been scratching my head over a date issue I've observed for a while now in relation to TimeZone handling in java.
It first manifested itself as strange behaviour in my Default TimeZone "Europe/Dublin" (ie. GMT with DST)
e.g:
System.setProperty("user.timezone", "Europe/Dublin");
Date epoch=new Date(0);
System.out.println("Epoch:"+epoch);
yields:
Epoch:Thu Jan 01 01:00:00 GMT 1970
1AM (BUG???????)
If I set the TZone above to GMT it outputs correctly as
Epoch:Thu Jan 01 00:00:00 GMT 1970
As there is no offset from GMT I can only think that DST is being handled incorrectly around the epoch. (even though it is not in DST on Jan 1st)
So I wrote the following test using calendars to test my theory.
          System.setProperty("user.timezone", "UTC");
          Calendar test=Calendar.getInstance(); //will use the user.timezone
          Calendar test2=Calendar.getInstance(TimeZone.getTimeZone("Europe/Dublin"));
          for (int year=1965;(year<=1975);year++){
               test.clear();test2.clear();
               test.set(year, 0, 1, 0, 0, 0);
               test2.set(year, 0, 1, 0, 0, 0);
               System.out.println("UTC:"+ test.getTime()+ " --- EU/Dub:"+test2.getTime());
Which yields the following interestingly inconsistent output (BUG?????)
UTC:Fri Jan 01 00:00:00 UTC 1965 --- EU/Dub:Fri Jan 01 00:00:00 UTC 1965
UTC:Sat Jan 01 00:00:00 UTC 1966 --- EU/Dub:Sat Jan 01 00:00:00 UTC 1966
UTC:Sun Jan 01 00:00:00 UTC 1967 --- EU/Dub:Sun Jan 01 00:00:00 UTC 1967
UTC:Mon Jan 01 00:00:00 UTC 1968 --- EU/Dub:Mon Jan 01 00:00:00 UTC 1968
UTC:Wed Jan 01 00:00:00 UTC 1969 --- EU/Dub:Tue Dec 31 23:00:00 UTC 1968
UTC:Thu Jan 01 00:00:00 UTC 1970 --- EU/Dub:Wed Dec 31 23:00:00 UTC 1969
UTC:Fri Jan 01 00:00:00 UTC 1971 --- EU/Dub:Thu Dec 31 23:00:00 UTC 1970
UTC:Sat Jan 01 00:00:00 UTC 1972 --- EU/Dub:Sat Jan 01 00:00:00 UTC 1972
UTC:Mon Jan 01 00:00:00 UTC 1973 --- EU/Dub:Mon Jan 01 00:00:00 UTC 1973
UTC:Tue Jan 01 00:00:00 UTC 1974 --- EU/Dub:Tue Jan 01 00:00:00 UTC 1974
UTC:Wed Jan 01 00:00:00 UTC 1975 --- EU/Dub:Wed Jan 01 00:00:00 UTC 1975
Strange - ehh? 1969->1971 all have issues with the Jan 1st date!!!!
In fact theres issues for every day that DST is not in operation on these years... (BUG????)
I'm part of a project that will be handling data from all Timezones and as such we have chosen
to use UTC as our server time. We are now quite concerned what other bugs/strange behaviours
lurk beneath the surface of the java implementation.
Note we have tested various JDK's and they seem to be consistently inconsistent!
If anyone can confrim this bug/issue or shed any light it would be most appreciated,
G.

miniman wrote:
As there is no offset from GMT I can only think that DST is being handled incorrectly around the epoch. (even though it is not in DST on Jan 1st)Well, in the UK, DST was in effect on 1970 Jan 01. I wouldn't be surprised to find that the same applied in Ireland.

Similar Messages

  • Is it a Bug on java.util.Calendar or is expected?

    When I try to set the DAY OF MONTH to another value then the actual and then set the DAY OF WEEK, if I do not call a 'get(anything)' or 'c.setTime(c.getTime())' beetwin the call to set the DAY OF MONTH and the DAY OF WEEK, when I call 'getTime()', it brings the closest day of week I've set to the actual day of month, and not the closest to the day of month I've setted.
    Example:
    Obs.: today is 05/14/2002
    Scenario 1.:
    Calendar c = Calendar.getInstance();
    c.set(Calendar.DAY_OF_MONTH, 29);
    c.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
    System.out.println(c.getTime());
    --> PRINTS OUT: Mon May 13 17:36:23 BRT 2002
    Scenario 2.:
    Calendar c = Calendar.getInstance();
    c.set(Calendar.DAY_OF_MONTH, 29);
    c.setTime(c.getTime()); // or c.get(Calendar.HOUR);
    c.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
    System.out.println(c.getTime());
    --> PRINTS OUT: Mon May 27 17:31:25 BRT 2002
    is it a bug or not?

    The API documentation for the Calendar class says this:
    "set(f, value) changes field f to value. In addition, it sets an internal member variable to indicate that field f has been changed. Although field f is changed immediately, the calendar's milliseconds is not recomputed until the next call to get(), getTime(), or getTimeInMillis() is made."
    And:
    "If fields conflict, the calendar will give preference to fields set more recently."
    Which is what your tests show to be the case. So it is expected. Not a bug.

  • Is there any bug in java.lang.String literal implementation

    Consider the following program:
    class StringTest
         public static void main(String[] args)
              long freeMemInitially=Runtime.getRuntime().freeMemory();
              String s="Amarnath";
              //char data[] = {'A', 'm', 'a','r','n','a','t','h'};
         //String s = new String(data);
              long usedMemAfterFirstString=freeMemInitially-Runtime.getRuntime().freeMemory();
              System.out.println("usedMemAfterFirstString:= "+usedMemAfterFirstString);
    Run the program it will return 0. But why? As the java docs and java specification says that string litterals is the reference to the instance of java.lang.String object.Then where does this string have been saved except the java runtime heap?
    Message was edited by:
    Amarnath_Bhattacharya

    basically, the simple explanation is this:
    the string literal "usedMemAfterFirstString" and the string literal "Amarnath" are both instantiated BEFORE the main method is called.
    hence, no object creation is done between the first and second invocations of Runtime.getRuntime().freeMemory().
    If you take a closer look at the spec, it will confirm this.
    - Adam

  • Java.sql.Date vs java.util.Date vs. java.util.Calendar

    All I want to do is create a java.sql.Date subclass which has the Date(String) constructor, some checks for values and a few other additional methods and that avoids deprecation warnings/errors.
    I am trying to write a wrapper for the java.sql.Date class that would allow a user to create a Date object using the methods:
    Date date1 = new Date(2003, 10, 7);ORDate date2 = new Date("2003-10-07");I am creating classes that mimic MySQL (and eventually other databases) column types in order to allow for data checking since MySQL does not force checks or throw errors as, say, Oracle can be set up to do. All the types EXCEPT the Date, Datetime, Timestamp and Time types for MySQL map nicely to and from java.sql.* objects through wrappers of one sort or another.
    Unfortunately, java.sql.Date, java.sql.Timestamp, java.sql.Time are not so friendly and very confusing.
    One of my problems is that new java.sql.Date(int,int,int); and new java.util.Date(int,int,int); are both deprecated, so if I use them, I get deprecation warnings (errors) on compile.
    Example:
    public class Date extends java.sql.Date implements RangedColumn {
      public static final String RANGE = "FROM '1000-01-01' to '8099-12-31'";
      public static final String TYPE = "DATE";
       * Minimum date allowed by <strong>MySQL</strong>. NOTE: This is a MySQL
       * limitation. Java allows dates from '0000-01-01' while MySQL only supports
       * dates from '1000-01-01'.
      public static final Date MIN_DATE = new Date(1000 + 1900,1,1);
       * Maximum date allowed by <strong>Java</strong>. NOTE: This is a Java limitation, not a MySQL
       * limitation. MySQL allows dates up to '9999-12-31' while Java only supports
       * dates to '8099-12-31'.
      public static final Date MAX_DATE = new Date(8099 + 1900,12,31);
      protected int _precision = 0;
      private java.sql.Date _date = null;
      public Date(int year, int month, int date) {
        // Deprecated, so I get deprecation warnings from the next line:
        super(year,month,date);
        if(! isWithinRange(this))
          throw new ValueOutOfRangeException((RangedColumn)this, "" + this);
      public Date(String s) {
        super(0l);
        // Start Cut-and-paste from java.sql.Date.valueOf(String s)
        int year;
        int month;
        int day;
        int firstDash;
        int secondDash;
        if (s == null) throw new java.lang.IllegalArgumentException();
        firstDash = s.indexOf('-');
        secondDash = s.indexOf('-', firstDash+1);
        if ((firstDash > 0) & (secondDash > 0) & (secondDash < s.length()-1)) {
          year = Integer.parseInt(s.substring(0, firstDash)) - 1900;
          month = Integer.parseInt(s.substring(firstDash+1, secondDash)) - 1;
          day = Integer.parseInt(s.substring(secondDash+1));
        } else {
          throw new java.lang.IllegalArgumentException();
        // End Cut-and-paste from java.sql.Date.valueOf(String s)
        // Next three lines are deprecated, causing warnings.
        this.setYear(year);
        this.setMonth(month);
        this.setDate(day);
        if(! isWithinRange(this))
          throw new ValueOutOfRangeException((RangedColumn)this, "" + this);
      public static boolean isWithinRange(Date date) {
        if(date.before(MIN_DATE))
          return false;
        if(date.after(MAX_DATE))
          return false;
        return true;
      public String getRange() { return RANGE; }
      public int getPrecision() { return _precision; }
      public String getType() { return TYPE; }
    }This works well, but it's deprecated. I don't see how I can use a java.util.Calendar object in stead without either essentially re-writing java.sql.Date almost entirely or losing the ability to be able to use java.sql.PreparedStatement.get[set]Date(int pos, java.sql.Date date);
    So at this point, I am at a loss.
    The deprecation documentation for constructor new Date(int,int,int)says "instead use the constructor Date(long date)", which I can't do unless I do a bunch of expensive String -> [Calendar/Date] -> Milliseconds conversions, and then I can't use "super()", so I'm back to re-writing the class again.
    I can't use setters like java.sql.Date.setYear(int) or java.util.setMonth(int) because they are deprecated too: "replaced by Calendar.set(Calendar.DAY_OF_MONTH, int date)". Well GREAT, I can't go from a Date object to a Calendar object, so how am I supposed to use the "Calendar.set(...)" method!?!? From where I'm sitting, this whole Date deprecation thing seems like a step backward not forward, especially in the java.sql.* realm.
    To prove my point, the non-deprecated method java.sql.Date.valueOf(String) USES the DEPRECATED constructor java.util.Date(int,int,int).
    So, how do I create a java.sql.Date subclass which has the Date(String) constructor that avoids deprecation warnings/errors?
    That's all I really want.
    HELP!

    I appreciate your help, but what I was hoping to accomplish was to have two constructors for my java.sql.Date subclass, one that took (int,int,int) and one that took ("yyyy-MM-dd"). From what I gather from your answers, you don't think it's possible. I would have to have a static instantiator method like:public static java.sql.Date createDate (int year, int month, int date) { ... } OR public static java.sql.Date createDate (String dateString) { ... }Is that correct?
    If it is, I have to go back to the drawing board since it breaks my constructor paradigm for all of my 20 or so other MySQL column objects and, well, that's not acceptable, so I might just keep my deprecations for now.
    -G

  • How to do sorting/filtering on custom java data source implementation

    Hi,
    I have an entity driven view object whose data should be retrieved and populated using custom java data source implementation. I've done the same as said in document. I understand that Query mode should be the default one (i.e. database tables) and createRowFromResultSet will be called as many times as it needs based on the no. of data retrieved from service, provided we should write the logic for hasNextForCollection(). Implementation sample code is given below.
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams) {      
    Iterator datumItr = retrieveDataFromService(qc, params);
    setUserDataForCollection(qc, datumItr);
    hasNextForCollection(qc);
    super.executeQueryForCollection(qc, params, noUserParams);
    protected boolean hasNextForCollection(Object qc) {
    Iterator datumItr = (Iterator) getUserDataForCollection(qc);
    if (datumItr != null && datumItr.hasNext()){
    return true;
    setCallService(false);
    setFetchCompleteForCollection(qc, true);
    return false;
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet resultSet) {
    Iterator datumItr = (Iterator) getUserDataForCollection(qc);
    Object datumObj = datumItr.next();
    ViewRowImpl r = createNewRowForCollection(qc);
    return r;
    Everything is working fine include table sorting/filtering. Then i noticed that everytime when user perform sorting/filtering, executeQueryForCollection is called, which in turn calls my service. It is a performance issue. I want to avoid. So i did some modification in the implementation in such a way that, service call will happen only if the callService flag is set to true, followed by executeQuery(). Code is given below.
    private boolean callService = false;
    public void setCallService(boolean callService){
    this.callService = callService;
    public boolean isCallService(){
    return callService;
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams){
    if (callService)
    Iterator datumItr = retrieveDataFromService(qc, params);
    setUserDataForCollection(qc, datumItr);
    hasNextForCollection(qc);
    super.executeQueryForCollection(qc, params, noUserParams);
    Issue i have:
    When user attempts to use table sort/filter, since i skipped the service call and set null as userDataCollection, createRowFromResultSet is not called and data which i retrieved and populated to view object is totally got vanished!!. I've already retrived data and created row from result set. Why it should get vanished? Don't know why.
    Tried solution:
    I came to know that query mode should be set to Scan_Entity_Cache for filtering and Scan_View_Rows for sorting. I din't disturb the implementation (i.e. skipping service call) but overrided the executeQuery and did like the following code.
    @Override
    public void executeQuery(){
    setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
    super.executeQuery();
    By doing this, i could able to do table filtering but when i try to use table sorting or programmatic sorting, sorting is not at all applied.
    I changed the code like beolw*
    @Override
    public void executeQuery(){
    setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
    super.executeQuery();
    Now sorting is working fine but filtering is not working in an expected way because Scan_View_rows will do further filtering of view rows.
    Question:
    I don't know how to achieve both filtering and sorting as well as skipping of service call too.
    Can anyone help on this?? Thanks in advance.
    Raguraman

    Hi,
    I have an entity driven view object whose data should be retrieved and populated using custom java data source implementation. I've done the same as said in document. I understand that Query mode should be the default one (i.e. database tables) and createRowFromResultSet will be called as many times as it needs based on the no. of data retrieved from service, provided we should write the logic for hasNextForCollection(). Implementation sample code is given below.
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams) {
      Iterator datumItr = retrieveDataFromService(qc, params);
      setUserDataForCollection(qc, datumItr);
      hasNextForCollection(qc);
      super.executeQueryForCollection(qc, params, noUserParams);
    protected boolean hasNextForCollection(Object qc) {
      Iterator datumItr = (Iterator) getUserDataForCollection(qc);
      if (datumItr != null && datumItr.hasNext()){
        return true;
      setFetchCompleteForCollection(qc, true);
      return false;
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet resultSet) {
      Iterator datumItr = (Iterator) getUserDataForCollection(qc);
      Object datumObj = datumItr.next();
      ViewRowImpl r = createNewRowForCollection(qc);
      return r;
    }Everything is working fine include table sorting/filtering. Then i noticed that everytime when user perform sorting/filtering, executeQueryForCollection is called, which in turn calls my service. It is a performance issue. I want to avoid. So i did some modification in the implementation in such a way that, service call will happen only if the callService flag is set to true, followed by executeQuery(). Code is given below.
    private boolean callService = false;
    public void setCallService(boolean callService){
      this.callService = callService;
    public boolean isCallService(){
      return callService;
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams){
      if (callService) {
        Iterator datumItr = retrieveDataFromService(qc, params);
        setUserDataForCollection(qc, datumItr);
      hasNextForCollection(qc);
      super.executeQueryForCollection(qc, params, noUserParams);
    }Issue i have:
    When user attempts to use table sort/filter, since i skipped the service call and storing of userDataCollection, createRowFromResultSet is not called and data which i retrieved and populated to view object is totally got vanished!!. I've already retrived data and created row from result set. Why it should get vanished? Don't know why.
    Tried solution:
    I came to know that query mode should be set to Scan_Entity_Cache for filtering and Scan_View_Rows for sorting. I din't disturb the implementation (i.e. skipping service call) but overrided the executeQuery and did like the following code.
    @Override
    public void executeQuery(){
      setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
      super.executeQuery();
    }By doing this, i could able to do table filtering but when i try to use table sorting or programmatic sorting, sorting is not at all getting applied.
    I changed the code like below one (i.e. changed to ViewObject.QUERY_MODE_SCAN_VIEW_ROWS instead of ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS)
    @Override
    public void executeQuery(){
      setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
      super.executeQuery();
    }Now sorting is working fine but filtering is not working in an expected way because Scan_View_rows will do further filtering of view rows.
    If i OR'ed the Query Mode as given below, i am getting duplicate rows. (vewObject.QUERY_MODE_SCAN_ENTITY_ROWS | ViewObject.QUERY_MODE_SCAN_VIEW_ROWS) Question:
    I don't know how to achieve both filtering and sorting as well as skipping of service call too.
    Can anyone help on this?? Thanks in advance.
    Raguraman
    Edited by: Raguraman on Apr 12, 2011 6:53 AM

  • Why not Deprecate java.util.Date and java.util.Calendar

    With the introduction of java.time, why did you not flag java.util.Date and java.util.Calendar. These classes have been a bane to every Java developer and should never be used again with the introduction of Java 1.8.

    Adding the @Deprecated annotation would only just provide a warning about an old API and recommendation to the developer(s) to no longer use it. Doing so would not break any existing library out there; in fact quite a number of constructors and methods on the Date class have already been flagged deprecated.
    The new java.time package is far superior to Date/Calendar.

  • A possible *bug* in java jcombobox

    Hi all,
    I think i found a possible bug in java jcombobox .. i am sure some of you must have already experienced it..
    supposedly you put a jcombobox in a jpanel
    returned the panel from a method to a calling method..
    and that method adds it to another panel that it had created to a frame..
    and if this happens dynamicaly at runtime, as only after u click a button..
    meaning : without adding the combobox or the immediate parent panelto the contentpane .. directly..
    Then,
    your combox's keylistener may not catch events fired.
    .. this has happened to me many times.. and always i could only find a way out
    .. by adding the combobox to panel that is loaded during startup itself and is
    .. not returned through a method call.
    Your opinions please ?
    'Harish.

    All components in a UI are created at run-time.
    When you create your JFrame you call pack() to align and resize the UI. This validates all the components, and sets the default focus on what ever component should have the focus at start up.
    When you create components and add them as children of another component you have to validate the child and parent. This can be done by calling JComponent.validate()
    As for keylisteners not getting called, this might be fixed if you call grabFocus on the new combobox. I can't see a reason why any listener would stop working.
    For me to really understand what your talking about. I'd need to see source code reproducing this problem.

  • Java.util.Calendar calculates wrong date when any duration is added

    Hi friends,
    I am trying to calculate the date through java.util.Calendar object and getting wrong value. Let me explain the scenario -
    Scenario1:
    I have taken start date and added some duration to that and expecting a new date which should be calculated as (start date+ duration). The value is as below -
    start date = 2012-01-09 (9 January 2012 )
    duration = 1year, 1month, 20 days
    new date = 2013-02-28 ( 28 February 2013)
    *Here new date I am expecting is 2013-03-01 (1 March 2013).
    Scenario2:
    I have taken another set of values as below -
    start date = 2011-02-15 (15 February 2011)
    duration = 1year, 1month, 15days
    new date = 2012-03-30 (30 March 2012)
    *Here new date is as expected.
    Scenario1 data is giving me wrong result. Please let me know if any more information is required. Any help will be appriciated. Thanks in advance.
    Edited by: user560316 on ९ जनवरी, २०१२ ६:२३ अपराह्न
    Edited by: user560316 on ९ जनवरी, २०१२ ६:२४ अपराह्न

    It all looks pretty straightforward to me. Try running the following code:
    public class TestCalendar {
        public static void main(String[] args) {
            java.util.Calendar myDate = java.util.Calendar.getInstance();
            java.text.DateFormat df = new java.text.SimpleDateFormat("dd MMMM yyyy");
            myDate.set(2012, java.util.Calendar.JANUARY, 9);
            System.out.println("Start date = " + df.format(myDate.getTime()));
            myDate.add(java.util.Calendar.YEAR, 1);
            myDate.add(java.util.Calendar.MONTH, 1);
            myDate.add(java.util.Calendar.DAY_OF_MONTH, 20);
            System.out.println("End date = " + df.format(myDate.getTime()));
    }This gives the following result:
    Start date = 09 January 2012
    End date = 01 March 2013

  • Calendar, date and timezone

    Hi everybody,
    I'm using the CLLocation class and I cannot find any documentation on it in google. DO you know where it is ?
    I know how to get the timestamp for the date, but here are some questions about it :
    -Does this date include the timezone value so I know from my position what is the timezone ?
    -How to convert the timestamp (NSDate instance I think) into a NSCalendar with which I could get the timezone information ?
    Thank you

    Because the Timezone isn't part of the timestamp for a date.
    This is one thing that Java got right. Think of it this way. There is no such thing as just 9.am. It's 9am in a specific place (timezone) on the Earth. Because at the same time it's 9am in one timezone it's 1pm in another timezone and 11:30 am in another timezone. etc. But all these representations of the time actually hold the exact same long millisecond value.
    So you never hold the timezone as part of the date. Timezones are only used for display or for parsing a value in.

  • Unfortunately Java Dates

    I am new to Java, I took one class last semester using Eclipse. I have a program that is driven off an access data base. In the data base the dates are a date/time type formatted mm/dd/yy. We did not work with dates as a rule but I used them so would get the experience. How do I change the format in my GUIs so the date is not yyyyMMdd, but the same as the data base.

    Still here and still somewhat confused. I have the sdf so I can format the dates the way I want but have no idea what t do with them now. One is a birthdate that belongs to the Problem Domain Class Players. The other I want to be a serial date set to 08/01/current year. This is what I have so far:
    package Main;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.TimeZone;
    * @author barker44
    public class DateTest {
         public static void main(String[] args) {
              Calendar aCalendar = Calendar.getInstance(TimeZone.getDefault());
              java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("MM/dd/yyyy");
              String strThisSeason = sdf.format(aCalendar.getTime());
              Date datThisSeason = null;
              // This is a format for jtxtCurrentSeason in the clsPlayersGUI
              // It is separate from the the player class and is only used in the GUI
              // It will be a serial date automatically set to Aug 1 of the current season
              // If I can figure out how to set it in the GUI
              String strCurrentSeason = "08012006";
              SimpleDateFormat sdf1 = new SimpleDateFormat("MMddyyyy");
              SimpleDateFormat sdf2 = new SimpleDateFormat("MM/dd/yyyy");
              Date datCurrentSeason = null;
              // This is a format for jtxtDOB in the clsPlayersGUI
              // Have to figure out where it should be implemented
              // In the PDC or in the GUI
              String strDateOfBirth = "12011995";
              SimpleDateFormat sdf3 = new SimpleDateFormat("MMddyyyy");
              SimpleDateFormat sdf4 = new SimpleDateFormat("MM/dd/yyyy");
              Date datDOB = null;
              try {
                   datThisSeason = sdf.parse(strThisSeason);
                   datCurrentSeason = sdf1.parse(strCurrentSeason);
                   datDOB = sdf3.parse(strDateOfBirth);
              } catch (ParseException e) {
                   e.printStackTrace();
              System.out.println("This Season = " + sdf.format(datThisSeason));
              System.out.println("Current Season = " + sdf2.format(datCurrentSeason));
              System.out.println("Date of Birth = " + sdf4.format(datDOB));
         }The first is not what I want because it sets the current month, day, year. But the others are formatted like I want I just don't know what to do with them. In my GUI I created a setCurrentDate method to set the text box to the current date but it doesn't work. Like I said I have this in VBA but can't figure out what to do with it here.
    This is what happns when a 48 year old ex-carpenter goes back to school to learn coding. In case you are wondering I am a student at Morrisville State College in central NY and I am working on my bachelors in Application Software, the semester is over and I am just trying to improve on what I learned this past semester.
    So any additional help would be greatly appreciated.
    Thanks.

  • Simple java date related question

    Hi Friends,
    I have written this custom date class that compares two dates. The user can enter any number of days,and it should calculate the next date,is that possible???
    public class Date implements Comparable {
         private int month, day, year;
         public Date(int m, int d, int y) {
              month = m;
              day = d;
              year = y;
         public int compareTo(Object o) {
              Date a = this;
              Date b = (Date) o;
              if (a.year < b.year) return -1;
              if (a.year > b.year) return 1;
              if (a.month < b.month) return -1;
              if (a.month > b.month) return 1;
              if (a.day < b.day) return -1;
              if (a.day > b.day) return 1;
              return 0;
         public String toString() {
              return month + "/" + day + "/" + year;
         public static void main(String[] args) {
              Date d1 = new Date(21, 03, 2007);
              int days = Integer.parseInt(args[0]);
              System.out.println("New date is:"); // Need to print new date
    Expected output:
    java Date 30
    New date is: 04/20/2007If this is not possible with this class,how can we do this, any ideas.
    Your help would be appreciated.
    Thanks

    Hi,
    Try this code out:
    import java.text.DateFormat;
    import java.util.*;
    import javax.swing.JOptionPane;
    public class SimpleDate {
         private int month, day, year;
         public SimpleDate() {
              Date date = new Date();
             String myString = DateFormat.getDateInstance().format(date);
             StringTokenizer tokens = new StringTokenizer(myString, "/");
             day = Integer.parseInt(tokens.nextToken());
             month = Integer.parseInt(tokens.nextToken());
             year = Integer.parseInt(tokens.nextToken());
         public SimpleDate(String stdate) {
              try {
                   StringTokenizer tokens = new StringTokenizer(stdate, "/");
                   day = Integer.parseInt(tokens.nextToken());
                   month = Integer.parseInt(tokens.nextToken());
                   year = Integer.parseInt(tokens.nextToken());
              catch(Exception e) {
                   Date date = new Date();
                  String myString = DateFormat.getDateInstance().format(date);
                  StringTokenizer tokens = new StringTokenizer(myString, "/");
                  day = Integer.parseInt(tokens.nextToken());
                  month = Integer.parseInt(tokens.nextToken());
                  year = Integer.parseInt(tokens.nextToken());
                   JOptionPane.showMessageDialog(null, "Invalid String,\nDate set to current", "Invalid String", JOptionPane.ERROR_MESSAGE);
         public SimpleDate(int d, int m, int y) {
              month = m;
              day = d;
              year = y;
         public int compareTo(Object o) {
              SimpleDate a = this;
              SimpleDate b = (SimpleDate) o;
              if (a.year < b.year) return -1;
              if (a.year > b.year) return 1;
              if (a.month < b.month) return -1;
              if (a.month > b.month) return 1;
              if (a.day < b.day) return -1;
              if (a.day > b.day) return 1;
              return 0;
         private int getNumOfDaysInMonth() {
              boolean leap = false;
              int days = 30;
              if (year % 4 == 0) leap = true;
              if ((month == 1) | (month == 3) | (month == 5) | (month == 7) |
                        (month == 8) | (month == 10) | (month == 12)) {
                   days = 31;
              if ((month == 4) | (month == 6) | (month == 9) | (month == 11)) {
                   days = 30;
              if (month == 2) {
                   if (leap) {
                        days = 29;
                   else days = 28;
              return days;
         public void addDays(int nums) {
              while (nums > getNumOfDaysInMonth()) {
                   nums = nums - getNumOfDaysInMonth();
                   addMonths(1);
              day = day + nums;
              while (day > getNumOfDaysInMonth()) {
                   day = day - getNumOfDaysInMonth();
                   addMonths(1);
         public void addMonths(int nums) {
              while (nums > 12) {
                   nums = nums - 12;
                   addYears(1);
              month = month + nums;
              while (month > 12) {
                   month = month - 12;
                   addYears(1);
         public void addYears(int nums) {
              year = year + 1;
         public int getDay() {
              return day;
         public int getMonth() {
              return month;
         public int getYear() {
              return year;
         public String toString() {
              return day + "/" + month + "/" + year;
    }I have swapped the day and month around from mm/dd/yyyy to dd/mm/yyyy
    but otherwise its still the same basic code

  • How to display Date Calendar in Oracle BI Answers Prompts (parameter)

    I'm still new to OBIEE.
    How to display Date Calendar in Oracle BI Answers Prompts (parameter)?
    Thanks.

    Hi,
    While creating Dash Board prompt choose the control to 'Calendar'.
    I think it is not possible to provide 'Calendar' control using Prompts tab while creating request.
    It is possible to write Java Script for a Column of data type 'char'. So, cast the date data type to char.
    Go to: Column Properties --> Data Format
    Choose override default data format to view the available options in the drop down list.
    I would be very happy if anybody acknowledge me that I am wrong.
    -Vency

  • Compare Date with Timezone

    Hi,
    I have a Date which is stored in the Database with the timezone like GMT, I have a java.util.Date which is selected in my UI from a Customized Calendar, I am converting this Date with timezone and want to compare this date with the date with timezone stored in the DB? How to accomplish this, please shed some light into this?
    Thanks.

    797836 wrote:
    I have a Date which is stored in the Database with the timezone like GMT, I have a java.util.Date which is selected in my UI from a Customized Calendar, I am converting this Date with timezone and want to compare this date with the date with timezone stored in the DB?As Parul said, Date does not involve a timezone. I think you need to clarify what you mean by "I am converting this Date with timezone", because it doesn't make much sense to me.
    BTW: If the date in your database is a standard SQL Date, then it will be converted to a java.sql.Date when you read it into Java with JDBC. And java.sql.Date is directly comparable with java.util.Date (in fact, it's a subclass).
    Winston

  • TimeStamp with time zone vs java Date

    In the developer's preview release notes, I read about the extended support on Oracle TimeStamp. We are currently planning to migrate current TIMESTAMP columns to TIMESTAMP WITH TIMEZONE to keep the user time zone with the typed date. Here is my question: Which time zone is persisted using a direct to field mapping between a java.util.Date and a TIMESTAMPTZ column? As the java.util.Date contains no time zone (in opposition to java.util.Calendar), does TopLink uses the JVM time zone? WHat is the best to data structure to keep date/time & time zone in our entities? Thanks, Yannick.

    I believe it would be the local timezone of the session. If you map a Date to the TIMESTAMP TZ then the SQL written out will not include a TZ value.
    Typically if you wish to map to a TIMESTAMPTZ field you would want to use an object in the model that can hold both the Timestamp and TZ values. This is most commonly a Calendar.
    Doug

  • Anyone built date/calendar popup??

    I have a third party calendar popup set of classes that I wish to use in a JTable.
    The JTable editor/renderer does not seem to work with this class. (Third party components fault)
    Has anyone developed their own calendar popup that can be used within a JTable to set dates.
    I'm working with JDK1.3, therefore cannot use JFormattedTextField, mores the pity!!!
    Any help/tips appreciated.
    Thanks,
    Rachel

    I did this about a year ago. I used Claude Dugay's JMaskField instead of JFormattedTextField. It's easy to find, but it needs to have some patches for a few quirks. You will probably recognize a lot of the code. I tried to make it handle a variety of Object types (Date, String, Calendar). I also needed an extra value (N/A for example). Here's the main class.import com.bbritta.jmaskfield.JMaskField;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.Border;
    import javax.swing.border.EmptyBorder;
    import javax.swing.border.EtchedBorder;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import javax.swing.plaf.basic.ComboPopup;
    import javax.swing.plaf.ComboBoxUI;
    import javax.swing.plaf.basic.BasicComboBoxEditor;
    import javax.swing.plaf.metal.MetalComboBoxUI;
    import com.sun.java.swing.plaf.motif.MotifComboBoxUI;
    import com.sun.java.swing.plaf.windows.WindowsComboBoxUI;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.GregorianCalendar;
    import java.util.Vector;
    import java.util.EventListener;
    public class DateComboBox extends JComboBox {
        private final static SimpleDateFormat defaultSDF = new SimpleDateFormat("MM/dd/yyyy");
        SimpleDateFormat sdf;
        Class returnClass=null;
        FormattedCalendar fc = new FormattedCalendar(sdf);
        Object alternate=null;
        MyComboBoxEditor mcbe;
        KeyAdapter ka = new KeyAdapter() {
         public void keyReleased(KeyEvent ke) {
             JTextField jtf = (JTextField)ke.getSource();
             switch (ke.getKeyCode()) {
              case KeyEvent.VK_ESCAPE:
                  jtf.setText(fc.toString());
                  break;
              case KeyEvent.VK_ENTER:
                  setValue(jtf.getText());
                  javax.swing.FocusManager.getCurrentManager().focusNextComponent(jtf);
                  break;
        JMaskField jmf = null;
        JTextField editorComponent;
        boolean blockItemStateEvent=false, blockActionEvent=false;
        private DatePopup datePopup;
        public DateComboBox(JMaskField JMF, SimpleDateFormat SDF) {
         this(SDF);
         setEditor(mcbe = new MyComboBoxEditor(jmf=JMF));
         ((JTextField)getEditor().getEditorComponent()).addKeyListener(ka);
        public DateComboBox(JMaskField JMF) { this(JMF, defaultSDF); }
        public DateComboBox(SimpleDateFormat SDF) {
         setFormat(sdf=SDF);
         editorComponent = (JTextField)getEditor().getEditorComponent();
         addItem(fc);
         editorComponent.addKeyListener(ka);
        public DateComboBox() {
         this(defaultSDF);
        // JComboBox source code sez not to override this, but waddahell
        public void actionPerformed(ActionEvent ae) {
         setValue(getEditor().getItem());
        public void setReturnClass(Class aClass) {
         if (aClass==null || aClass==String.class || aClass==Date.class ||
                       aClass.isAssignableFrom(Calendar.class)) {
             returnClass=aClass;
         } else throw new IllegalArgumentException("Invalid return class");
        public Class getReturnClass() { return returnClass; }
        public void setSelectedItem(Object item) { setValue(item); }
        public void setValue(Object value) {
         ((JTextField)getEditor().getEditorComponent()).setEditable(true);
         Object oldSelectedItem = super.getSelectedItem();
         blockActionEvent=true;
         blockItemStateEvent=true;
         dataModel.setSelectedItem(null);
         blockActionEvent=false;
         blockItemStateEvent=false;
         if (value instanceof Date) {
             if (jmf!=null) jmf.setMaskDocument();
             fc.setTime((Date)value);
             super.setSelectedItem(fc);
         } else if (value instanceof Calendar) {
             if (jmf!=null) jmf.setMaskDocument();
             fc.setTime(((Calendar)value).getTime());
             super.setSelectedItem(fc);
         } else if (alternate!=null && alternate.toString().equalsIgnoreCase(value.toString())) {
             if (jmf!=null) jmf.setOrigDocument();
             super.setSelectedItem(alternate);
             ((JTextField)getEditor().getEditorComponent()).setEditable(false);
         } else if (value instanceof String) {
             try {
              fc.setTime((String)value);
              super.setSelectedItem(fc);
              if (jmf!=null) jmf.setMaskDocument();
             catch (ParseException pe) {
              if (jmf!=null) jmf.setMaskDocument();
              super.setSelectedItem(value);
              fireInvalidDate(new InvalidDateEvent(this, value));
         } else {
             if (jmf!=null) jmf.setMaskDocument();
             fireInvalidDate(new InvalidDateEvent(this, value));
        public void addInvalidDateListener(InvalidDateListener l) {
         listenerList.add(InvalidDateListener.class, l);
        public void removeInvalidDateListener(InvalidDateListener l) {
         listenerList.remove(InvalidDateListener.class, l);
        protected void fireInvalidDate(final InvalidDateEvent e) {
         final Object[] listeners = listenerList.getListenerList();
    //     System.out.println("SI="+super.getSelectedIndex()+", lc="+listeners.length);
         SwingUtilities.invokeLater(new Runnable() { public void run() {
             for (int i=listeners.length-2; i>=0; i-=2 ) {
              if (listeners==InvalidDateListener.class ) {
              ((InvalidDateListener)listeners[i+1]).invalidDate(e);
    protected void fireActionEvent() {
         if (!blockActionEvent) super.fireActionEvent();
    protected void fireItemStateChanged(ItemEvent e) {
         if (!blockItemStateEvent) super.fireItemStateChanged(e);
    public Object getValue() {
         Object selectedItem = super.getSelectedItem();
         if (selectedItem==fc) {
         if (jmf != null) jmf.setMaskDocument();
         if (returnClass==null || returnClass==Calendar.class) return fc;
         if (returnClass==Date.class) return fc.getTime();
         if (returnClass==String.class) return fc.toString();
         } else if (selectedItem==alternate) if (jmf!=null) jmf.setOrigDocument();
         else if (jmf!=null) jmf.setMaskDocument();
         return selectedItem;
    public void setAlternate(Object Alternate) {
         if (alternate != null) super.removeItem(alternate);
         datePopup.setAlternate(Alternate);
         alternate = Alternate;
         super.addItem(alternate);
    public Object getAlternate() { return alternate; }
    public void updateUI() {
         ComboBoxUI cui = (ComboBoxUI) UIManager.getUI(this);
         if (cui instanceof MetalComboBoxUI) { cui = new MetalDateComboBoxUI(); }
         else if (cui instanceof MotifComboBoxUI) { cui = new MotifDateComboBoxUI(); }
         else if (cui instanceof WindowsComboBoxUI) { cui = new WindowsDateComboBoxUI(); }
         setUI(cui);
    class MetalDateComboBoxUI extends MetalComboBoxUI {
         protected ComboPopup createPopup() { return datePopup = new DatePopup(comboBox, sdf); }
    class WindowsDateComboBoxUI extends WindowsComboBoxUI {
         protected ComboPopup createPopup() { return datePopup = new DatePopup(comboBox, sdf); }
    class MotifDateComboBoxUI extends MotifComboBoxUI {
         protected ComboPopup createPopup() { return datePopup = new DatePopup(comboBox, sdf); }
    public void setFormat(SimpleDateFormat SDF) {
         datePopup.setFormat(SDF);
         fc.setFormat(SDF);
    public SimpleDateFormat getFormat() { return sdf; }
    class DatePopup implements ComboPopup, MouseMotionListener, MouseListener,
                   KeyListener, PopupMenuListener, ActionListener {
    private static final SimpleDateFormat defaultSDF = new SimpleDateFormat("MM/dd/yy");
    // protected SimpleDateFormat dateFormat = new SimpleDateFormat("MMM d, yyyy");
    protected SimpleDateFormat dateFormat;// = new SimpleDateFormat("MM/dd/yy");
    protected DateComboBox comboBox;
    protected Calendar calendar;
    protected JPopupMenu popup;
    protected JLabel monthLabel;
    protected JPanel days = null, alternatePanel = new JPanel(new FlowLayout());
    protected JButton alternateButton = new JButton();
    protected Vector listenerComponents = new Vector();
    protected SimpleDateFormat monthFormat = new SimpleDateFormat("MMM yyyy");
    protected void setFormat(SimpleDateFormat SDF) { dateFormat=SDF; }
    protected Color selectedBackground, selectedForeground,
                   background, foreground;
    public DatePopup(JComboBox comboBox) {
         this(comboBox, defaultSDF);
    public DatePopup(JComboBox comboBox, SimpleDateFormat SDF) {
         dateFormat = SDF;
         this.comboBox = (DateComboBox)comboBox;
         calendar = Calendar.getInstance();
         // check Look and Feel
         background = UIManager.getColor("ComboBox.background");
         foreground = UIManager.getColor("ComboBox.foreground");
         selectedBackground = UIManager.getColor("ComboBox.selectionBackground");
         selectedForeground = UIManager.getColor("ComboBox.selectionForeground");
         alternatePanel.setBackground(background);
         alternatePanel.setOpaque(true);
         alternateButton.setBorder(BorderFactory.createRaisedBevelBorder());
         alternatePanel.add(alternateButton);
         alternateButton.addActionListener(this);
         initializePopup();
    //========================================
    // begin ComboPopup method implementations
    public void show() {
         try {
         // if setSelectedItem() was called with a valid date, adjust the calendar
         calendar.setTime( dateFormat.parse( comboBox.getSelectedItem().toString() ) );
         } catch (Exception e) {}
         updatePopup();
         popup.show(comboBox, 0, comboBox.getHeight());
    public void hide() {
         for (int i=0; i<listenerComponents.size(); i++) {
         Component c = (Component)listenerComponents.get(i);
         EventListener[] l = c.getListeners(MouseListener.class);
         for (int j=0; j<l.length; j++) c.removeMouseListener((MouseListener)l[j]);
         listenerComponents.removeAllElements();
         popup.removePopupMenuListener(this);
         popup.setVisible(false);
    protected JList list = new JList();
    public JList getList() { return list; }
    public MouseListener getMouseListener() { return this; }
    public MouseMotionListener getMouseMotionListener() { return this; }
    public KeyListener getKeyListener() { return this; }
    public boolean isVisible() { return popup.isVisible(); }
    public void uninstallingUI() { popup.removePopupMenuListener(this); }
    // end ComboPopup method implementations
    //======================================
    //===================================================================
    // begin Event Listeners
    // MouseListener
    public void mousePressed( MouseEvent e ) {}
    public void mouseReleased( MouseEvent e ) {}
    // something else registered for MousePressed
    public void mouseClicked(MouseEvent e) {
         if ( !SwingUtilities.isLeftMouseButton(e) ) return;
         if ( !comboBox.isEnabled() ) return;
         if ( comboBox.isEditable() ) {
         comboBox.getEditor().getEditorComponent().requestFocus();
         } else comboBox.requestFocus();
         togglePopup();
    protected boolean mouseInside = false;
    public void mouseEntered(MouseEvent e) { mouseInside = true; }
    public void mouseExited(MouseEvent e) { mouseInside = false; }
    // MouseMotionListener
    public void mouseDragged(MouseEvent e) {}
    public void mouseMoved(MouseEvent e) {}
    // KeyListener
    public void keyPressed(KeyEvent e) {}
    public void keyTyped(KeyEvent e) {}
    public void keyReleased( KeyEvent e ) {
         if ( e.getKeyCode() == KeyEvent.VK_SPACE ||
         e.getKeyCode() == KeyEvent.VK_ENTER ) {
         togglePopup();
    * Variables hideNext and mouseInside are used to
    * hide the popupMenu by clicking the mouse in the JComboBox
    public void popupMenuCanceled(PopupMenuEvent e) {}
    protected boolean hideNext = false;
    public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
         hideNext = mouseInside;
    public void popupMenuWillBecomeVisible(PopupMenuEvent e) {}
    // end Event Listeners
    //=================================================================
    //===================================================================
    // begin Utility methods
    protected void togglePopup() {
         if ( isVisible() || hideNext ) hide();
         else show();
         hideNext = false;
    // end Utility methods
    //=================================================================
    // Note *** did not use JButton because Popup closes when pressed
    protected JLabel createUpdateButton(final int field, final int amount) {
         final JLabel label = new JLabel();
         final Border selectedBorder = new EtchedBorder();
         final Border unselectedBorder = new EmptyBorder(selectedBorder.getBorderInsets(new JLabel()));
         label.setBorder(unselectedBorder);
         label.setForeground(foreground);
         label.addMouseListener(new MouseAdapter() {
              public void mouseReleased(MouseEvent e) {
              calendar.add(field, amount);
              updatePopup();
              public void mouseEntered(MouseEvent e) {
              label.setBorder(selectedBorder);
              public void mouseExited(MouseEvent e) {
              label.setBorder(unselectedBorder);
         return label;
    protected void setAlternate(Object Alternate) {
         if (Alternate != null) {
         alternateButton.setText(Alternate.toString());
         if (alternatePanel.getParent()!=popup) popup.add(alternatePanel, BorderLayout.SOUTH);
         } else popup.remove(alternatePanel);
    protected void initializePopup() {
         JPanel header = new JPanel(); // used Box, but it wasn't Opaque
         header.setLayout(new BoxLayout(header, BoxLayout.X_AXIS));
         header.setBackground(background);
         header.setOpaque(true);
         JLabel label;
         label = createUpdateButton(Calendar.YEAR, -1);
         label.setText("<<");
         label.setToolTipText("Previous Year");
         header.add(Box.createHorizontalStrut(12));
         header.add(label);
         header.add(Box.createHorizontalStrut(12));
         label = createUpdateButton(Calendar.MONTH, -1);
         label.setText("<");
         label.setToolTipText("Previous Month");
         header.add(label);
         monthLabel = new JLabel("", JLabel.CENTER);
         monthLabel.setForeground(foreground);
         header.add(Box.createHorizontalGlue());
         header.add(monthLabel);
         header.add(Box.createHorizontalGlue());
         label = createUpdateButton(Calendar.MONTH, 1);
         label.setText(">");
         label.setToolTipText("Next Month");
         header.add(label);
         label = createUpdateButton(Calendar.YEAR, 1);
         label.setText(">>");
         label.setToolTipText("Next Year");
         header.add(Box.createHorizontalStrut(12));
         header.add(label);
         header.add(Box.createHorizontalStrut(12));
         popup = new JPopupMenu();
         popup.setBorder(BorderFactory.createLineBorder(Color.black));
         popup.setLayout(new BorderLayout());
         popup.setBackground(background);
         popup.addPopupMenuListener(this);
         popup.add(BorderLayout.NORTH, header);
    private SimpleDateFormat dowSDF = new SimpleDateFormat("EEE");
    public void actionPerformed(ActionEvent ae) {
         comboBox.setSelectedItem(comboBox.getAlternate());
         hide();
    // update the Popup when either the month or the year of the calendar has been changed
    protected void updatePopup() {
         monthLabel.setText( monthFormat.format(calendar.getTime()) );
         if (days != null) {
         popup.remove(days);
         days = new JPanel(new GridLayout(0, 7));
         days.setBackground(background);
         days.setOpaque(true);
         Calendar setupCalendar = (Calendar) calendar.clone();
         setupCalendar.set(Calendar.DAY_OF_WEEK, setupCalendar.getFirstDayOfWeek());
         for (int i = 0; i < 7; i++) {
         int dayInt = setupCalendar.get(Calendar.DAY_OF_WEEK);
         JLabel label = new JLabel(dowSDF.format(setupCalendar.getTime()));
         label.setHorizontalAlignment(JLabel.CENTER);
         label.setForeground(foreground);
         days.add(label);
         setupCalendar.roll(Calendar.DAY_OF_WEEK, true);
         setupCalendar = (Calendar) calendar.clone();
         setupCalendar.set(Calendar.DAY_OF_MONTH, 1);
         int first = setupCalendar.get(Calendar.DAY_OF_WEEK);
         for (int i = 0; i < (first - 1); i++) days.add(new JLabel(""));
         for (int i = 1; i <= setupCalendar.getActualMaximum(Calendar.DAY_OF_MONTH); i++) {
         final int day = i;
         final JLabel label = new JLabel(String.valueOf(day));
         label.setHorizontalAlignment(JLabel.CENTER);
         label.setForeground(foreground);
         listenerComponents.add(label);
         label.addMouseListener(new MouseAdapter() {
              public void mouseReleased(MouseEvent e) {
                   label.setOpaque(false);
                   label.setBackground(background);
                   label.setForeground(foreground);
                   calendar.set(Calendar.DAY_OF_MONTH, day);
                   comboBox.setSelectedItem(calendar);
                   hide();
                   comboBox.requestFocus();
              public void mouseEntered(MouseEvent e) {
                   label.setOpaque(true);
                   label.setBackground(selectedBackground);
                   label.setForeground(selectedForeground);
              public void mouseExited(MouseEvent e) {
                   label.setOpaque(false);
                   label.setBackground(background);
                   label.setForeground(foreground);
         days.add(label);
         popup.add(BorderLayout.CENTER, days);
         popup.pack();
    class MyComboBoxEditor extends BasicComboBoxEditor {
    public MyComboBoxEditor() {}
    public MyComboBoxEditor(JMaskField JMF) {
         super.editor = JMF;

Maybe you are looking for

  • System copy post DB refresh error

    Hi, I am doing a post db refresh (Oracle/Solaris) and while creating control file getting error SQL> CREATE CONTROLFILE SET DATABASE "XXX" RESETLOGS ARCHIVELOG; CREATE CONTROLFILE SET DATABASE "XXX" RESETLOGS ARCHIVELOG ERROR at line 1: ORA-01503: CR

  • Bi content is not showing statistics data while running the report in porta

    hi friends, I  installed the BI Admin Cockpit to collect the statistical information. I can see the statistics informatio in portal only when i run the query in bex. if i run the report in portal it's not showing any statistics. could you guide me th

  • Blaster WEBCAM GO

    When i wanted install the Webcan GO into my new OS Windows XP-SP2 i'dont install because de program instalation said: "Only for Windows 98". Answer: Exist driver or any way for install this camera in this Os Windows XP-SP2 ? Tanks Ramon my e-mail: [e

  • Deleteing Rows in a block

    I am using Forms 6i. I have a data block that automatically generates values for certain items. It will create insert the items into the rows of the canvas. The user can then enter the date in any number of the existing colums. This is my pl/sql for

  • Specific rights on source-system connection?

    Hi all, we are up to connect our Solution Manager BW system to our "standard" BW system. But due to security reasons, we only want to allow access to specific datasources from the SolMan BW system. We tried to set up the rights for the BATCH/backgrou