Disabling\enabling up/down spinners button

Hi
I have a spinner which I want to limit when its reach a condition. For example, I have two spinners representing a range of dates, when the spinner reach the maximum date I want to disable the up arrow button of the JSpinner. How can I do it?
Thanks
D

you would be calling a method on click of a button and once you reach the max date you can disable the UP arrow button this way...
    jSpinner1.getComponent(0).setEnabled(false);and pass 1 instead of 0 to disable the down arrow!
Cheers...
Asim

Similar Messages

  • ListSelectionEvent and Up/Down arrow buttons

    Hi,
    I am using JDK 1.3.1 and having a wierd problem with changing list selection using the Up and Down arrow buttons.
    Normally, when changing a list or table selection using the mouse, two events will be fired in sequence. The first one is the deselect event of the old selection and the second one will be the select event of the new selection. But when I change the selection using the Up and Down arrow buttons, only the second event is fired.
    I installed an extend ListSelectionListener on my DefaultListSelectionModel as following:
    public void valueChanged(ListSelectionEvent e){
    if (e.getValueIsAdjusting()) {
    // Do something to the old selection when leaving it
    else {
    //Do something to the new selection
    As described earlier, when changing seleciton with the mouse, the valueChanged() method will be invoked twice with the e.getValueIsAdjusting() returning true then false. But when changing the selection with a Up or Down key, the method will only be invoked once with the e.getValueIsAdjusting() returning false.
    Did anyone have this problem too? Is this a JDK specific problem? Your help will be really appreciated.
    Thanks very much.

    If this behavior is expected for the JList, I am wondering if there is anyway that I could disable the Up/Down arrow buttons in the list box.
    Thanks.

  • Sort up and sort Down push buttons in module pool with table control wizard

    hi,
    i have created 2 buttons for Sort up and sort Down push buttons in module pool with table control wizard
    please any one can help me.
    regards

    Hi
    Following code is to enable and disable the tbl control using two buttons. Just alter the code and for each button write the sort code.
    REPORT  YJAN27_SCREEN                                               .
    TABLES: SFLIGHT, YFLIGHT_28.
    TYPES: BEGIN OF struct1,
          carrid like sflight-carrid,
          connid like sflight-connid,
          fldate like sflight-fldate,
           END OF struct1.
    CONTROLS TBL1 TYPE TABLEVIEW USING SCREEN 2700.
    DATA: OK_CODE LIKE SY-UCOMM,
          CARRID LIKE SFLIGHT-CARRID,                                    "cols in tbl ctrl
          CONNID LIKE SFLIGHT-CONNID,
          FLDATE LIKE SFLIGHT-FLDATE,
          itab TYPE TABLE OF STRUCT1 WITH HEADER LINE,
          cols like line of TBL1-COLS,
          FLAG TYPE I.
    FLAG = 1.
    CALL SCREEN 2700.
    *&      Module  STATUS_2700  OUTPUT
    *       text
    MODULE STATUS_2700 OUTPUT.
      SET PF-STATUS 'BACK'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_2700  OUTPUT
    *&      Module  USER_COMMAND_2700  INPUT
    *       text
    MODULE USER_COMMAND_2700 INPUT.
    OK_CODE = SY-UCOMM.
    CASE OK_CODE.
      WHEN 'BACK'.
        LEAVE PROGRAM.
      WHEN 'DIS'.                                                         "write code for sort up
        loop AT TBL1-COLS INTO COLS.
           COLS-SCREEN-INPUT = 0.
            MODIFY TBL1-COLS FROM COLS.
        ENDLOOP.
        FLAG = 2.
      WHEN 'ENA'.                                                       "write code for sort down
        loop AT TBL1-COLS INTO COLS.
            COLS-SCREEN-INPUT = 1.
            MODIFY TBL1-COLS FROM COLS.
        ENDLOOP.
        FLAG = 1.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_2700  INPUT
    *&      Module  GET_DATA  OUTPUT
    *       text
    MODULE GET_DATA OUTPUT.
      select carrid connid fldate from SFLIGHT into table itab.
    ENDMODULE.                 " GET_DATA  OUTPUT
    *&      Module  POPULATE_TBL  OUTPUT
    *       text
    MODULE POPULATE_TBL OUTPUT.
        MOVE-CORRESPONDING ITAB TO SFLIGHT.
    ENDMODULE.                 " POPULATE_TBL  OUTPUT
    *&      Module  CHANGE_SCREEN  OUTPUT
    *       text
    MODULE CHANGE_SCREEN OUTPUT.    " use this module if you want to hide the other button
    CASE FLAG.
      WHEN 1.
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'B_ENA'.
            SCREEN-INVISIBLE = 1.
             MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'B_DIS'.
            SCREEN-INVISIBLE = 0.
             MODIFY SCREEN.
          ENDIF.
       ENDLOOP.
      WHEN 2.
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'B_DIS'.
            SCREEN-INVISIBLE = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'B_ENA'.
            SCREEN-INVISIBLE = 0.
             MODIFY SCREEN.
          ENDIF.
       ENDLOOP.
    ENDCASE.
    ENDMODULE.                 " CHANGE_SCREEN  OUTPUT
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_2700.
    MODULE CHANGE_SCREEN.     " use this if you want to display one button at a time
    MODULE GET_DATA.
    loop at itab WITH control TBL1.
        MODULE POPULATE_TBL.       " populate tbl ctrl
    endloop.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_2700.    " do the sort operations
    loop at itab.
      endloop.
    Hope this helps
    Regards,
    Jayanthi.K

  • How do you grey out/disable fields under a radio button if another radio button is selected in Adobe Acrobat XI Pro?

    How do you grey out/disable fields under a radio button if another radio button is selected in Adobe Acrobat XI Pro?
    I’m creating a form where the user has three options to make a payment.
    1. charge to my credit card
    2. charge associated costs to bank account
    3. By cheque or money order
    My Problem is, under each option, there are required fields that has to be filled out. So if the user picks the first option, charge to my credit card, they would fill out the required fields (credit card number, expiration date etc.). But when they click submit button to submit the form, it won’t let them, because there are required fields under the second option. Also, I have the radio buttons for the three options setup so that if the user holds the shift key and clicks a radio button, it unchecks it. So what I'm trying to do is this: If the user selects the radio button for option 1, the other two options are greyed out/disabled. And if the user holds down the shift key and clicks radio button for option one again, it unchecks the radio button and the other two options are available again. Is there a way to grey out or disable the two other payment options when the other one is picked. I’m assuming I will have to use javascript, but what would the coding be and which field do I write it under?
    Thanks in advance guys

    You will have to use custom JavaScript to access the various properties of the field object.
    The radio button group has a value. When no button is selected that value is "Off". When an individual button has been selected the value for the group will be the option or export value for that individual button.
    Once you have determined the button selected, then you will know the form fields that need to be made required. You use JavaScript to access those fields and change the "read only" property to false, and set the "required" property to true. For the fields associated with the other options, those fields should be reset, made read only, and have the "required" property set to false.
    Disabling (graying-out) Form Fields
    >> Also, I have the radio buttons for the three options setup so that if the user holds the shift key and clicks a radio button, it unchecks it.
    Radio button in a PDF do not work that way. Only check boxes can be unchecked by clicking on one that has been checked.
    If you plan the coding for the Mouse UP action to test for all possible options and code for each of those options you should have what you want.
    If you want actual code you need to provide a lot more details.
    It is even possible to perform some credit card and bank routing number validations with JavaScript and some check digit formulas.

  • Why does pressing the down arrow button result in going to the bottom of the page and being nunable to go up or down one line at a time?

    i dont know what to say in way of clarification. when looking at a page i am forced to use the "slide" on the margin which is very sensitive on very long documents instead of the down arrow to move one line. pressing the arrow results in going to the bottom and you cant return using the arrow.

    The arrow to open the tab history of the Back and Forward buttons has been removed in Firefox 4 and later.
    Use one of these methods to open the tab history list:
    * Right click on the Back or Forward button
    * Hold down the left mouse button on the enabled Back or Forward button until the list opens
    You can look at this extension:
    * Backward Forward History Dropdown: https://addons.mozilla.org/firefox/addon/backforedrop/

  • Ok my Ipod touch 5th generation will not turn on, and i have tried other steps i have seen like holding down different buttons and try to restore but it will not restore and no matter how long i hold down a button it wont turn on

    My ipod tocuh 5th generation battery died so i went to charge it and i would not charge so i did some reasearch and tried many steps such as hold down the buttons for a long time but nothing happened then i tried to restore it and it wont let it, it just comes up with error 1602 and ims cared i dont know what to do please HELP.

    Error 1604
    This error is often related to USB timing. Try changing USB ports, using a different dock connector to USB cable, and other available USB troubleshooting steps (troubleshooting USB connections. If you are using a dock, bypass it and connect directly to the white Apple USB dock connector cable. If the issue persists on a known-good computer, the device may need service.
    If the issue is not resolved by USB isolation troubleshooting, and another computer is not available, try these steps to resolve the issue:
    Connect the device to iTunes, confirm that the device is in Recovery Mode. If it's not in Recovery Mode,put it into Recovery Mode.
    Restore and wait for the error.
    When prompted, click OK.
    Close and reopen iTunes while the device remains connected.
    The device should now be recognized in Recovery Mode again.
    Try to restore again.
    If the steps above do not resolve the issue, try restoring using a known-good USB cable, computer, and network connection.
    Error 1600, 1601, 1602
    Follow the steps listed above for Error 1604. This error may also be resolved by disabling, deactivating, or uninstalling third-party security, antivirus, and firewall software. See steps in this article for details on troubleshooting security software.

  • How to make disable/enable single item recovery effectively Immediately?

    for the following command , "it may take up to one hour to disable single item recovery",my question is how to make the disable/enable  single item recovery
    effectively Immediately by some command?
    SingleItemRecoveryEnabled $false/true
    http://technet.microsoft.com/en-us/library/ff678798(v=exchg.141).aspx
    Please click the Mark as Answer button if a post solves your problem!

    other options:
    Move the mailbox to another DB or if in a DAG, activate the DB on another server. ( the activating seems to work as far as I have seen at least).
    Twitter!: Please Note: My Posts are provided “AS IS” without warranty of any kind, either expressed or implied.

  • Java Script Disable/Enable Items Problem

    Hi,
    I followed the directions to disable/enable items from http://www.oracle.com/technology/products/database/htmldb/howtos/htmldb_javascript_howto2.html#disable.
    And I'm getting an error.
    I have fields like :
    Issue Summary
    Issue Description
    Identified By
    Identified Date
    Status (Values: Open, On-Hold, In-Process, Closed)
    Priority
    Target Resolution Date
    Whenever the Status changes to 'In-Process' I would like to disable 'Issue Summary and Issue Description'.
    Both the fields (Issue Summary and Issue Description) are being disabled when the Status changed to 'In-Process'
    but when I click the 'Apply Changes' button I'm getting the error: 'Issue summary cannot be null.'
    I do have a Not Null validation on Issue Summary field, but I'm only updating the Status field.
    Following is the JavaScript:
    In the Page Attribute (HTML Header)
    <script language="JavaScript" type="text/javascript">
    <!--
    //htmldb_delete_message='"DELETE_CONFIRM_MSG"';
    //-->
    // This function takes in:
    // 1. A string expression to evaluate. For example:
    // 'document.getElementById(\'P125_STATUS\').value=InProcess'
    // Notice the quotes are escaped using a "\"
    // 2. One or more arguments which are item ID's as strings. For example:
    // ...,'P1_ENAME','P1_SAL'...);
    // Notice the ID's are the item names, NOT item labels
    function disFormItems(testString,P125_ISSUE_SUMMARY,P125_ISSUE_DESCRIPTION){
    theTest = eval(testString);
    if(theTest){
    for(var i=1;i<4;i++){
    if (arguments){
    disItem = document.getElementById(arguments[i]);
    // disItem.style.background = '#cccccc';
    disItem.disabled = true;
    else{
    for(var i=1;i<4;i++){
    if (arguments[i]){
    disItem = document.getElementById(arguments[i]);
    disItem.disabled = false;
    // disItem.style.background = '#ffffff';
    //-->
    </script>
    In the Footer:
    <script language="JavaScript1.1" type="text/javascript">
    disFormItems('document.getElementById(\'P125_STATUS\').value==\'In-Process\'','P125_ISSUE_SUMMARY','P125_ISSUE_DESCRIPTION');
    </script>
    In the Status field HTML Form Element Attributes:
    onChange="javascript:disFormItems('document.getElementById(\'P125_STATUS\').value == \'In-Process\'','P125_ISSUE_SUMMARY','P125_ISSUE_DESCRIPTION');"
    Can somebody let me know what's wrong?
    Any help is greatly appreciated.
    Thanks in advance

    FYI: I used the following JavaScript to make it work:
    In the Header Text
    function SetReadOnly()
    var status = document.forms[0].p_t09.value;
    if(status == 'In-Process')
    document.forms[0].p_t02.readOnly = true;
    document.forms[0].p_t03.readOnly = true;
    //-->
    In the Footer
    <script language="JavaScript1.1" type="text/javascript">
    SetReadOnly();
    </script>
    In the HTML Form Element Attributes
    onChange="javascript:SetReadOnly();"
    Thank you very much for your suggestion

  • Feature Request: a way to retrieve accurate plugin disable/enable state

    As it stands, LrEnablePlugin file is executed when plugin goes from disabled to enabled, and LrDisablePlugin is executed when plugin goes from enabled to disabled. Unfortunately its really hard to glean useful information because:
    plugin will go from enabled to disabled then back to enabled when new metadata is added and such stuff, and there is no way to tell whether plugin is enabled or disabled after a reload, since neither module is executed unless there is a change.
    It would be useful to me to be able to simply read an accurate status: enabled or disabled.
    Also, if Lr needs to disable for a moment to add metadata, I'd rather have the state not reflect the temporary disablement, unless reenabling fails and it becomes permanently disabled, or better still, have it reflect the temporary-ness of the disabled state, so maybe these states:
    disabled permanently
    disabled temporarily (e.g. to add metadata)
    enabled permanently
    enabled temporarily - for case when user attempts to enable but catalog neds updating, in which case if update fails it will be re-disabled.
    If this is too much, at least a minimal improvement could be had by simply having LrEnablePlugin and LrDisablePlugin not be called when Lightroom disables/enables for the sake of metadata / catalog updating, so they're only called when user clicks the buttons. This would not be as useful as accurate live status, but at least would eliminate disable / enable actions that assume the user did something he/she did not...

    HI Matt,
    Sorry - it was late...
    Anyway, I think you've got the jest of it. To help clarify further:
    There are two issues with the way things are enable/disable-wise:
    1.  there is no way for a plugin to tell if it is enabled or disabled.
    Here's a cut from the framework:
    --- Determine if plugin is enabled.
    --  @usage      Note: do not depend on this reporting correctly, since default value for 'enabled' is true
    --              even when plugin is disabled. Its only correct after plugin goes from enabled to disabled or vice versa after init...
    function App:isPluginEnabled()
        local ena = rawget( _G, 'enabled' )
        assert( ena ~= nil, "no ena" )
        return ena
    end
    2. The enabled / disabled modules are executed upon temporary disablement / reenablement as well as the more permanent flavor, so they cant really be used to prompt the user, or multiple confusing prompts get issued when the state is bouncing around...
    As usual, I'd like to see this improved in the next version, but I'm also open to suggestions for working around it in the mean time...
    PS - I just thought of a work-around for the first issue (which primarily arises in plugins that access plugin metadata) - just try and get a known-to-be-defined metadata item - iff successful, then the plugin is enabled.
    So, a possible solution:
    1. Have a readable (and preferrably writable too) enable/disable state that accurately reflects right-now enable / disable state - even if temporary.
    2. The ability to determine root cause of disablement, e.g. "temp-for-catalog-update", "permanent-since-catalog-update-failed", "user-initiated", ... I can imagine root cause for enablement to be useful too...
    *** UPDATE: Modified method:
    --- Determine if metadata-supporting plugin is enabled.
    --  @param      name (string, default dummy_) name of alternative plugin metadata item (property) to be used.
    --  @param      photo (lr-photo, default 1st photo of all) photo to use to check.
    --  @usage      This method presently only works when a metadata item is defined. Maybe one day it will also work even with no plugin metadata defined.
    --  @usage      Only works from an async task.
    --  @return     enabled (boolean) true iff enabled. Throws error if not called from async task.
    function App:isPluginEnabled( name, photo )
        assert( catalog, "No catalog." )
        name = name or 'dummy_' -- cant start with underscore.
        photo = photo or catalog:getAllPhotos()[1] -- getting all-photos takes ~16msec.
        assert( photo, "No photo." )
        local _dummy, msg = photo:getPropertyForPlugin( _PLUGIN, name, nil, true ) -- nil version, no-throw.
        if msg == nil then -- msg is nil if property defined and plugin enabled, even if property value is nil.
            return true
        else
            return false, msg
        end
        --local ena = rawget( _G, 'enabled' )
        --assert( ena ~= nil, "no ena" )
        --return ena
    end
    Rob

  • How to Enable Drill Down in WebI through Infoview

    Hello Experts,
    I have WebI report, I am running through Infoview and I see drill down option is disabled, can anybody help me how to enable drill down option.
    Thank you
    Ravi

    HI Ravi,
    Log on to CMC -> Application -> Right Click on Web Intelligence Rich Client -> Select your user -> Assign Security -> Advanced tab -> Select "Unassigned Rights" in Common Filter Settings -> Select Enable Drill Mode in Rights Name Column -> And assigned grant level to it.
    Hope this help.
    Regards,
    Rishit

  • There's no "close,Restore Down,minimize"button on the top of the FF4 ,My system is win7 how can i do with it

    there's no "close,Restore Down,minimize"button on the top of the FF4 ,My system is win7 how can i do with it
    == This happened ==
    Every time Firefox opened
    == i have installed the FF4

    Here is how to go to the default theme in case you don't know how to.
    1. Press '''ALT''' to reveal the menu bar
    2. Go to '''Addons, Themes''' and enable '''Default Theme''' to reveal your Buttons.
    (IF you are using Menu bar then just go to '''Tools--Addons--Themes'''

  • SW-Enumerated device requires reset after disable / enable

    Hi All.  I'm trying to figure out a way to get our our SW-enumerated kmdf driver to not require a reboot upon devcon (device manager) disable/enable.  In the driver's EVT_WDF_DRIVER_UNLOAD DriverUnload()
    callback, the PointerCount member of the PDO's OBJECT_HEADER  is 1.  If I stop windbg and look at loaded modules, the driver remains loaded long after the DriverUnload() callback has fired called, making suspect a reference issue.
     I've read the articles and have set a ba w4 <pdo_object_hdr> "dd
    <pdo_object_hdr> L1;k;g"  breakpoint on the PointerCount member (offset 0) and can see its going up and down as the debugger stops at ObfDereferenceObject(), ObfReferenceObject(), IoQueueWorkItem()
    and IopProcessWorkItem().
    Is it likely that this has anything to do with why the driver would require a reboot after a devcon (or device manager) disable / enable cycle?
    Thanks!

    this is the reason why the reboot is required. you have a leaked Ob reference somewhere. in your unload routine you should also dump the WDF object tree for your WDFDRIVER and see what remains, perhaps you have leaked an object (and perhaps through a dangling
    Wdf reference call)
    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

  • Programaticaly remove(disable/enable) origin server from WebCache Cluster

    Hi.
    Can I programaticaly disable/enable origin server (OAS) from WebCache Cluster for safe node Up/Down ?
    Thanks.

    I found only one way - simulate HTTP request from web console by wget.
    wc_balance.bat (windows script):
    @rem Using a script: parameter ON - enable node, OFF - disable node
    @rem server env
    set HOST=class4.tst.lan:4000
    set AUTH=ias_admin:system
    @rem req env
    set u_host=class4.tst.lan
    set u_port=7888
    set u_capacity=100
    set u_numRetry=5
    set u_url=/
    set u_interval=10
    @rem !!! line number server in the Origin Server !!!
    set u_id=h2
    set U1="hostname=%u_host%&port=%u_port%&routing=%1&capacity=%u_capacity%&numRetry=%u_numRetry%&URL=%u_url%&interval=%u_interval%&SSL_TYPE=NONE&ACTION=Submit&id=%u_id%&SCREEN_ID=CGA.Site.OriginServers_Edit"
    set U2="webcacheadmin?SCREEN_ID=CGA.ConfigTree&ACTION=Apply+Changes"
    @rem set new status
    wget http://%AUTH%@%HOST%/webcacheadmin?%U1%
    @rem commit changes
    wget http://%AUTH%@%HOST%/webcacheadmin?%U2%
    Message was edited by:
    sisaev

  • How to enable the print & archive button that appear in the smartform outpu

    How to enable the print & archive button that appear in the smartform output.....

    Hi,
    I agree with the details which has been given above, but still if you want to default option 3 "Print & Archive" in drop down, it is possible.
    All you need to do is to set the value of output_options structure field "TDARMOD" as "3" while passing the parameters to dynamic function module of smartform.
    That will select "Print and Archive" in background and display to user.
    Sumit

  • Disable / Enable Swing Objects

    Hello,
    I have a JFrame with objects on it,
    like several JTextField, JComboBox, JFormattedTextField, JCheckBox, JButton.
    - User set some parameters on the GUI
    - When user press the "export" button, an export function starts as Thread.
    During the export process, how can I prevent that user changes the settings or press the export button again?
    I am thinking about ...
    When user press the export button, then
    - export runs
    - all objects are disabled
    When export is done, then
    - all objects are enabled
    Is there a smart way of disabling / enabling all objects at once, without explicitly referencing each one of them like field1.disbabled(), ...
    I am open also for other approaches.
    Thanks,A.

    Hi Kayaman,
    the approach with progress bar with modal dialog fits best to my need.
    I re-used the code from the following website ...
    http://www.java2s.com/Code/Java/Swing-JFC/Creatingamodalprogressdialog.htm
    Thanks, A.

Maybe you are looking for

  • New ipod nano and error in updating itunes and quicktime (error 1905)

    this is really annoying me, i have itunes 6.0 or 6.1 or something, and i recently purchased an ipod nano.it said the new nano was only compatable with itunes 7.1, so i went to apple.com and downloaded it. it took two hours to download the set-up for

  • IMovie exports audio but only blank/black video???

    I cannot find any resolution to this and did not have this problem until I upgraded to iMovie '09. This is really annoying and I am not having it on any of my other Macs. Any suggestions??

  • Webservice invoke call doesn't work

    I'm invoking a webservice with axis, and it isn't working ok. It seems as if it's making something, but at the end it doesn't return anything. After executing all necessary methods (addParameter, setReturnType,setOperationName...) i execute invoke me

  • Photoshop Elements 10 Trial wont get past "accept license" screen.

    Hi On a Mac. OS: 10.6.8 Have downloaded a trial version of Photoshop Elements 10. Tried launching it. Get a window asking me to accept the license for Elements Organizer. Click accept. Window disappears. Window reappears - again asking me to accept l

  • KM Respository Manager Error

    I have upgrade by BW3.1 to Bw3.5 and Installed EP 6.0, Collaboration, TREX and other think shown in SAPINST. Is it possible that I have to install the KM separatly or it is a part of Collaboration option in SAPINST. when I click on any link on my KM