JSpinner model problem

Hello,
I have an application which let you insert data of a music album. All this data goes into a database. One of the possible fields is the length of the album.
I thought about using a JSpinner and using a SpinnerDateModel but this gives me some problems.
To make it easy for the user i would like to enter the time in following format: mm:ss. But the problem here is that the minutes only goes to 59. But it should not be limited to 59, to make it the same as the time indicated on your music player. For example: 75minutes:24seconds.
Is this possible with a SpinnerDateModel? Or should I use something else?
Thx

If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

Similar Messages

  • Jspinner weird problem

    Hi all,
    I have this weird problem with Jspinners when I try to run this code. When I run it, the second spinner shows the date (while the first one only shows the time) and they are both larger than they are supposed to be (try resizing after it shows up)
    Any help would be greatly appreciated.
    // CODE STARTS HERE ////////////////////////////////
    import javax.swing.*;
    import java.util.*;
    import java.awt.*;
    public class Test {
         public static void main(String args[]) {
              TimeSpinner spin1 = new TimeSpinner();
              TimeSpinner spin2 = new TimeSpinner();
              JFrame frame = new JFrame();
                   frame.getContentPane().setLayout(new FlowLayout());
                   frame.getContentPane().add(spin1);
                   frame.getContentPane().add(spin2);
                   frame.setSize(300,300);
                   frame.show();
    class TimeSpinner extends JSpinner {
         public TimeSpinner() {
              super();
              // spinner date model
              SpinnerDateModel sdm = new SpinnerDateModel();
              sdm.setCalendarField(Calendar.MINUTE);
              this.setModel(sdm);
              try {
                   this.commitEdit();
              } catch (Exception e) {
                   e.printStackTrace();
              JSpinner.DateEditor de = (JSpinner.DateEditor)this.getEditor();
              de.getFormat().applyPattern("hh:mm a");
         public void setFixedSize(int width, int height) {
              Dimension fixedDimension = new Dimension(width, height);
              this.setMinimumSize(fixedDimension);
              this.setMaximumSize(fixedDimension);
              this.setPreferredSize(fixedDimension);

    The problem is in the format. The format supplied by the standard API does exactly what you described. The alternative is to create your own format or (better) your own formatter.
    I ended up creating my own DateSpinner which is not too difficult.
    Cheers,
    Didier

  • Data Modeler: Problems with importin from DDL and Designer

    I have a few problems with importing models from Designer and DDL:
    1. Can I import spatial indexes from Designer or DDL file? An index does appear in the model but it doesn’t seem to be a spatial index. When trying to import from database, the index doesn’t appear in the model at all.
    2. Is it possible to import sdo_geometry data types from DDL file? I haven’t succeeded with it, instead the column's data type appears unknown.
    3. Sometimes import from DDL files (that are generated with DM) failed with nothing appearing to the model. I haven’t figured out why that happens. I didn’t receive any error message, the model just opened empty.
    4. DM doesn’t seem to recognize public synonym creation from DDL. View log gives the following message:
    <<<<< Not Recognized >>>>>
    CREATE PUBLIC SYNONYM TABLE1
    FOR TABLE1
    5. Sequences lose their properties when importing from Designer. They only have a name but but start with, increment by and min/max values are empty in DM. Importin from DDL works fine.
    I’m using data modeler version 2.0.0 build 584

    Hi Alex,
    There is newer version of Data Modeler (3.0 EA2) and it is free
    You can download it from here
    http://www.oracle.com/technetwork/developer-tools/datamodeler/ea2-downloads-185792.html
    Regards
    Edited by: Dimitar Slavov on Dec 9, 2010 2:15 AM

  • Web Service Model problem

    I've imported the web service model by an online wsdl provided in the tutorial of sdn. What should I configure in the proxy host and ip so as to make it work? I've tried "proxy", the name of was server, everything, included Stateless and Http cookie based connections, do I need something else or I've made a mistake??
    Thank you very much,

    Hi,
    The problem could be because you unchecked the proxy settings in the Model.
    Go to WebDynproProject> -expand the Model ->Select Logical Ports and open.
    Now on the rightside you can see the "use HTTP proxy" checkbox.Please check the checkbox and redeploy the application.
    for testing just i have used the following code and its working fine for me.
    try{
        Request_SendEmailPortType_sendEmail mail=new Request_SendEmailPortType_sendEmail ();
        mail.setFrom( "Anilkumar");
        mail.setFromAddress("[email protected]" );
        mail.setTo("Vippagunta");
        mail.setToAddress( "[email protected]");
        mail.setMsgBody( "TEst");
        mail.setSubject("TestMail");
        wdContext.nodeSendMail() .bind( mail);
        wdContext.currentSendMailElement() .modelObject() .execute() ;
       catch(Exception e)
    Regards, Anilkumar

  • Custom JSpinner Model / Editor

    Hello,
    This question may have been answered in the past but I could not find anything. I am trying to use a JSpinner for cycling through pages of information. I would like the display to show current page of total number of pages, i.e. 1 of 10. I would also like the user to be able to enter a number and have the spinner display that number in the same format. I am not quite sure if I need to create a custom model and editor or expand the SpinnerNumberModel. Any guidance is much appreciated.

    this might be one way for the '1 of 10', for entering a number, just add a keyListener,
    and modify the methods accordingly
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Testing
      JSpinner spinner;
      JTextField tf;
      final int TOTAL_PAGES = 10;
      int currentPage;
      public void buildGUI()
        tf = new JTextField(10);
        tf.setHorizontalAlignment(JTextField.RIGHT);
        tf.setEditable(false);
        tf.setBackground(Color.WHITE);
        spinner = new JSpinner();
        spinner.setUI(new MyUI());
        spinner.setEditor(tf);
        changeValue(1);
        JFrame f = new JFrame();
        f.getContentPane().add(spinner);
        f.pack();
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
      public void changeValue(int amount)
        try
          int newPageNumber = currentPage+amount;
          if(newPageNumber < 1 || newPageNumber > TOTAL_PAGES)
            java.awt.Toolkit.getDefaultToolkit().beep();
            return;
          tf.setText(newPageNumber+" of "+TOTAL_PAGES);
          currentPage = newPageNumber;
        catch(Exception e){e.printStackTrace();}
      class MyUI extends javax.swing.plaf.basic.BasicSpinnerUI
        protected Component createNextButton()
          JButton btnNext = (JButton)super.createNextButton();
          btnNext.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent ae){
              changeValue(1);}});
          return btnNext;
        protected Component createPreviousButton()
          JButton btnPrevious = (JButton)super.createPreviousButton();
          btnPrevious.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent ae){
              changeValue(-1);}});
          return btnPrevious;
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }

  • Model Problem In webdynpro java

    Hi all,
    I am facing a differnent problem with model classes in my webdynpro application.
    I have a componenet where in i am using standard BAPIs.The problem here is i am getting the latest data from the bapi only when the application is loded first.
    If i add a new record and want to know the size of output node it is not giving the latest one.It is showing the size it has when the application is loded,But in the backend it is getting updated everytime.
    What might me the problem for this??Is it that the model proxy classes that are loded when the application is loded is not getting refreshed??
    Edited by: chandrashekar chandrashekar on Dec 10, 2008 7:30 AM

    Hi,
    This is the code i am using...
    My problem in brief is if i try to add a record it is getting updated in SAP but if i try to display the output node it is giving the size it has when the application is loded.
    If i restart the application it is giving the updated sise of the output node
    Bapi_Class_Getdetail_Input inputGetDetail = null;
    inputGetDetail = new Bapi_Class_Getdetail_Input();
    wdContext.nodeBapi_Class_Getdetail_Input().bind(inputGetDetail);
    inputGetDetail.setClassnum(className);
    inputGetDetail.setClasstype("300");
         try
              executeBapi_Class_GetDetail();
         catch(WDDynamicRFCExecuteException ex)
              return false;
    executeBapi_Class_GetDetail()
    try
    wdContext.currentBapi_Class_Getdetail_InputElement().modelObject().execute();
    wdContext.nodeOutput().invalidate();
    catch(WDDynamicRFCExecuteException ex)
         ex.printStackTrace();

  • Active data model problem

    Hi all!
    I have a problem working with ADF BC, i think it's caused by the Active Data Model.
    I have a jspx with an adf:table based on a a ViewObject ( with an underlaying EntityObject ) that queries for all employees that matches: attributeName = '0' .
    Then I navigate to another jspx where I can create employees. So I create a new employee with a value on that attribute different from '0', for example '1'.
    Finally I navigate to the first page and... THE NEW EMPLOYEE APPEARS IN THE ADF:TABLE!!! Aulthogh his attribute value is not 0!!!
    Any suggestions? Is it a problem related to de active data model?
    Thanks in advance!

    Hi,
    the filter is applied to the query, so you will have to re-execute the query to not see the new enetered value. The query filter is not applied to new records added to the current collection.
    So add the user, commit it and re-query the VO
    Frank

  • Three phase AC motor model problem...

    Hello, is there a way to use the 3PH_Motor from the family OUTPUT_DEVICES located in the group Electro_Mechanical but with a modified Spice model that uses only the data printed on the nameplate? I ask this question because I have to simulate power factor correction using a field of 10 motors rated at 110 kW each for my thesis, but I need the R and L of the windings in order to use the default model and I cannot find these values in catalogues.
    Thank you in advance and I hope there is a way to solve this problem...
    Multisim 12.0.0
    Solved!
    Go to Solution.

    I am assuming you're looking for an induction motor.
    It would be an oversimplification to model an induction motor using a fixed R,L load (In V12 of Multisim, we actually removed the 3PH_Motor and instead added a more realistic dynamic model based on a more realistic parameter set). An induction motor is in many ways like a transformer. Therefore you need the magnetising inductance, rotor and stator leakage inductances, and rotor and stator resistances. You may be able to contact the manufacturer to obtain, but I doubt you can accurately deduce them just from the name plate.
    This link goes over a simple steady-state model: http://www.scribd.com/doc/13311930/Induction-Motor-Modeling-steady-State
    Thanks,
    Max
    National Instruments

  • CCExtension HTMLPanel AngularJS ng-model problem

    Hi,
    I have a problem with AngularJS (1.2.13) in HTML Panels. Changes input fields variables are not being updated in the model. The following code show the problem.
    <body ng-controller="basicCtrl">
         <div>
         <label>URL:</label>
         </div>
         <div>
         <input type="text" ng-model="settings.hostURL" name="hostURL">
         </div>
         <div>
         <button ng-click="saveSettings()">Save</button>    
         </div>
         <pre ng-bind="settings | json"></pre>
    </body>
    If I open the panel in a browser, the <pre> element reflects any change I make to the settings object. When I load it in an HTML Panel, the <pre> element is not updated to reflect changes. However if I push the delete key to remove a character the <pre> element gets updated.
    Is there a trick I can use to get changes in the elements back into the model ?
    -- Thomas

  • Oracle BI EE "complex" model problem

    Problem - we have 3 tables (star schema) - Sales_fact, Customer and Product - Sales_fact are divided by organizations and contains sales to organization external customers and sales between organisations. In Customer (divided by organization code) table exists column (0/1 values) that's tell us if customer is internal (intersales) or external. We need
    to create a model which always show only external sales, however we can't build logical join between customer and sales_fact with additional condition on customer flag ( customer.customerid=sales_fact.customerid and customer.external=1). We can filter Customer table by this column but we gets bad values when user take analysis only on Article and Sales_fact table
    Can anyone help us ??

    Try putting a security filter on the user or group that adds the customer.external=1 condition to every query against the Sales_fact table. You might want to have two security groups, external and internal or external and everyone.

  • Design breaks - box model problem

    Hello all, again
    I've got an additional problem in that my CSS design breaks
    in IE6 but is
    okay in FF. I know it's got to be something to do with the
    box model but I
    can't for the life of me figure out what's wrong.
    My numbers add up - the main container is 819px, there are 4
    divs, the first
    is 610 px wide (top left), the second 209 (top right), the
    third 610 (bottom
    left) and the fourth 206 (bottom right) - this one smaller
    for aesthetic
    reasons.
    The first div, has a 10px margin on the left but I've taken
    this off the
    total div width so the div width is 600px + 10px margin-left.
    This is where
    the problem is - when I reduce the div width to 590px, it
    displays fine in
    IE6 but is slightly out of whack in FF. I hope this is making
    sense....
    There's no doubt some glaring error here - I just can't see
    it.
    URL: www.patriotsarms.co.uk/headerMain.php
    Thanks again
    Judi

    Thanks all
    Murray: Your solution worked perfectly. So quick and simple.
    Oh dear.
    >The solution is to make each such element display:inline.
    Nadia: You must get some pretty interesting colour
    combinations.....
    Thanks for pointing that out.
    >I just wanted to point out that you need to declare a
    background color to
    >your pages - I'm seeing my
    browsers' hotpink background instead of your intended white
    Excavatorak: Thanks for your suggestions - would have worked
    as well, I am
    sure.
    Cheers
    Judi
    "Murray *ACE*" <[email protected]> wrote
    in message
    news:[email protected]...
    > Here's the problem in IE -
    >
    > DIV.headLogo_ {
    > MARGIN-TOP: 8px;
    > FLOAT: left;
    > MARGIN-LEFT: 10px;
    >
    >
    > Any time you have a margin on the same side as the
    float, IE doubles the
    > margin. The solution is to make each such element
    display:inline. It
    > will have no effect on other browsers, since it's a
    floated element
    > anyhow, but it keeps IE from doing its nasty deed.
    >
    > --
    > Murray --- ICQ 71997575
    > Adobe Community Expert
    > (If you *MUST* email me, don't LAUGH when you do so!)
    > ==================
    >
    http://www.dreamweavermx-templates.com
    - Template Triage!
    >
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    > ==================
    >
    >
    > "Excavatorak" <[email protected]> wrote in
    message
    > news:[email protected]...
    >> #table_01 is 819px wide
    >>
    >> headlogo is 600px with 10px marginleft ... headlinks
    is 209px wide
    >>
    >> That adds up to 819 which is fine for most browsers
    but IE6 adds an extra
    >> 3px
    >> (only 3??? Pretty sure...) to each float...
    >> Try this CSS and see if it works for you:
    >>
    >>
    >>
    >> div.Table_01 {
    >> width:819px;
    >> height:287px;
    >> }
    >>
    >> div.headLogo_ {
    >> width:500px;
    >> height:44px;
    >> margin-left:10px;
    >> margin-top:8px;
    >> float: left;
    >> }
    >>
    >> div.headLinks_ {
    >> float:right;
    >> width:209px;
    >> height:52px;
    >> text-align:center;
    >>
    >> }
    >>
    >
    >

  • JUTableSortModel class model problem?

    Hi, I somtimes get empty lines and other anomaly when scrolling down in a JTable, after rows sorting performance. I fix this problems in the my UI model. I increase Iterator's RangeSize, but this is not good idea.
    I using Oracle jDeveloper Version 10.1.2.0.0 .
    Anybody heard of this before?
    Regards
    Desislav

    Hi Frank,
    sorry but I havn't HR schema, otherwise I reproducable this testcase.
    Desislav

  • Hammerstein identification model problem

    Hi, I have a problem with system identification. I am using User-defined model an Hammerstein Model Simulation for identifying "unknown" system. I used LabVIEW example that works fine and I copy it to my VI. System identification is wrong but I don't know why. I can post a an image of VI or eaven VI itself if the problem could be solved. I must also mention that for data acquisition I use OPC client.
    Thank you.

    Hi andy22,
    If I understood your post, you are using example code that identifies your system correctly.  However, once it is integrated into other code the results are wrong.  Are you using the same data in both programs?  You mentioned that the data is from an OPC client.  How is that being read in LabVIEW?  Have you verified that those values are correct? 
    If you could provide a few more details, possibly with code or screenshots, that would help as well.   
    Jennifer R.
    National Instruments
    Applications Engineer

  • Rdf model problem

    When I have create the RDF netwok correctly,I inpue"execute sdo_rdf.create_rdf_model('family', 'family_rdf_data', 'triple');".
    the message is:
    ORA-13199: Model error occurred
    ORA-06512: 在 "MDSYS.MD", line 1723
    ORA-06512: 在 "MDSYS.MDERR", line 17
    ORA-06512: 在 "MDSYS.SDO_RDF_INTERNAL", line 1779
    ORA-06512: 在 "MDSYS.SDO_RDF", line 117
    ORA-06512: 在 line 1
    My system is microsoft windows,and I install 10.2.01 for microsoft windows.
    I want to know the reason and the method.
    thankyou!

    Prateek.
    I am playing as well. I had the same problem when I was trying to create the model as sys. When I tried it as a user with DBA privilege, it worked ok.
    SQL*Plus: Release 10.2.0.1.0 - Production on Thu Feb 22 23:34:55 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> grant dba to sys;
    Grant succeeded.
    SQL> execute sdo_rdf.create_rdf_model('IT_INVENTORY', 'IT_inventory_rdf_data', 'triple');
    BEGIN sdo_rdf.create_rdf_model('IT_INVENTORY', 'IT_inventory_rdf_data', 'triple'); END;
    ERROR at line 1:
    ORA-13199: Model error occurred
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 17
    ORA-06512: at "MDSYS.SDO_RDF_INTERNAL", line 1779
    ORA-06512: at "MDSYS.SDO_RDF", line 117
    ORA-06512: at line 1
    SQL> grant dba to ming;
    Grant succeeded.
    SQL> drop table IT_inventory_rdf_data;
    Table dropped.
    SQL> connect ming/ming@ming
    Connected.
    SQL> create table it_inventory_rdf_data (id number, triple sdo_rdf_triple_s);
    Table created.
    SQL> execute sdo_rdf.create_rdf_model('it_inventory', 'it_inventory_rdf_data', 'triple');
    PL/SQL procedure successfully completed.
    SQL>

  • EF4 Model Problems by using Oracle Views

    Hi,
    for some views in the EF-Model, I get the message "The table/view does not have a primary key defined and no valid primary key could be inferred. This table/view has been excluded. To use the entity, you will need to review your schema, add the correct keys, and uncomment it", but not for all views. Why?
    I add a PK for the view like '("Id" PRIMARY KEY DISABLE NOVALIDATE, ...'--> then I get another Message, because the PK Field iin the view isn't NOT NULL, but "Id" has the value of the row number. What can I do now?
    Frank

    Hello
    To shutdown the Database is no problem. When i first make the shutdown of the DB and then shutdown the server, there is no problem. Just when i wan't to shutdown the server without shutting down DB the error is here.
    No entry in Eventlog about oracle......
    Thank's

Maybe you are looking for

  • How to change default alerts in iCal?

    Hello. Every time you add a new event in iCal, the Info panel of the event contains a series of default alerts that you may want to add to it. However, all of them are useless to me (e.g.: "Send email to <my address> 4 days after), so I need to manua

  • Is it possible to upgrade the GPU in this laptop HP DV7-2043cl

    I've been searching all over the net, and I am getting mixed answers.  I just got an extra laptop through a craigslist deal, and was wondering what, if any upgrades I could do for it. I have done a little bit of research, and if i could upgrade it se

  • XML in Java

    Is there an API to create xml document content or may be the xml format? I can do the same by using a StringBuffer and embedding my content between the custom tags. If possible I am looking for an elegant way to do the same, may be adding nodes to a

  • VAT exempt company being made to pay VAT. Anyone have any advice how to get around this?

    Hello all, I am sure I acan't be the first to have hit his barrier but when enrolling as a developer and going through to the checkout there is a mandatory charge of VAT on the subscription. All very well if I am a UK business but in this case I am w

  • Bug: Count Tool does not allow you to move counted item (Mac OS 10.7.3)

    After placing a number using the count tool I was unable to move the number. I hovered over the number and the cursor changed but when I attempted to drag the number nothing occured and the cursor changed back to a "+" cursor. Thank you Hardware Over