Need code for this checkbox validation

There are 3 checkboxes on my form cb1,cb2,cb3.I need the code for the below validations..
if I check the checkbox cb1 then cb2,cb3 should be disabled(grayed, should not allow to
check). when i unchecked cb1 all 3 boxes should be enabled and then if i check cb2
then cb1,cb3 should be disabled.
At any point of time only one checkbox should be checked and
remaining 2 will be disabled/grayed.
hope its clear.
thanks in advance
Devender

Hello,
You can enable/disable your check box items with the:
Set_Item_Property( 'item_name', ENABLED, PROPERTY_TRUE | PROPERTY_FALSE ) Built-in.
If Checkbox_Checked( 'chk1' ) Then
   Set_Item_Property( 'chk2', ENABLED, PROPERTY_FALSE ) ;
   Set_Item_Property( 'chk3', ENABLED, PROPERTY_FALSE ) ;
End if ;
...Francois

Similar Messages

  • Need code for this Small validation on when-validate-item

    Hi All,
    I have a text item(date datatype) in forms 4.5 I need to do a small validation want to write on when-validate-item. When I enter a date in that text item (Ex 10-JUN-2005) it has to check
    1) It Cannot be "blank"
    2) It cannot be "Not older than today"
    can you please put me code for this small validation. I am new to Forms.
    Thanks in Advance,
    Reddy

    I always put code in the when-validate-RECORD trigger to ensure fields are entered, rather than setting the property. That way, the user can enter other fields within the record, and then gets a message that the field is required only when leaving the record.
    ...of course, if the date item is the only field in the block, then the when-validate triggers will not run unless the user at least types a space in the date. In that case, you need to check in the key-commit trigger.

  • Need code for this checkbox trigger...please

    Hi All,
    I have a checkbox in detail block where block is having No. of records displayed is 3(Three) so Checkbox and all other items are displaying thrice. I am inserting the records 1 by 1 using the following code
    Declare
    Begin
         Loop
              First_Record;
              Insert into Veri_Test values(:PNo,:c1);
              Exit When :System.Last_Record='TRUE';
              Next_Record;
         End Loop;
         COMMIT;
    End;
    Its inserting properly. no problem. But what I want is
    when i checked on 1st row of checkbox remaining two(2nd,3rd row) checkboxes should be disabled. If i uncheck 1st row checkbox then
    remaining two should be enabled. As same way
    If i click on 3rd row of checkbox remaining two(1,2) should be disabled. If i uncheck 3rd row checkbox then remaining two(1,2) should be enabled.
    Hope its clear. is it possible ? if yes can anyboxy give the code for this checkbox trigger ?
    Thanks in Advacne
    Devender

    Hello,
    Apply this in a When-Checkbox-Changed trigger:
    Declare
       -- Record being modified --
       LN$CurRec pls_integer := :system.cursor_record ;
       LN$Rec    pls_integer := 1 ;
    Begin
       If :BLOC.CB1 = 'O' Then
          -- Goto first record --
          First_record ;
          Loop
             If LN$Rec <> LN$CurRec Then
                -- record <> current record --
                :BLOC.CB1 := 'N' ;
             End if ; 
             If :system.last_record = 'TRUE' Then
                Exit ;
             End if ;
             -- Goto next record --
             Next_record ;
             LN$Rec := LN$Rec + 1 ;
          End loop ;
          -- Jump to current record --                
          Go_Record( LN$CurRec );
       End if ;
    End ;Francois

  • Need code for this program in pl/sql

    Hi,
    was looking for a pl/sql code for the following case
    If there are two employees from the EMP table. i want all the names of the managers common to the two employees....
    to explain in detail : if employee1 and employee2 have the same manager mgr1....mgr1 should be displayed.
    else if employee 1 and employee2 have no immediate manager in common...meaning team leader of employee 1 and employee2 are different but the project managers for both the employee is same..in this case the project manager's name should be displayed......
    else in worst case when there are no managers common between these two employees.........the CEO who is at the highest level is common....then display CEO's name
    it's hierchiacal structure......
    thanks,
    Preethi

    Why PL/SQL? Why not look at if this can be done using SQL firstly? SQL is the preferred language for crunching Oracle data. Not PL/SQL.
    Think data sets.
    One method to do this in SQL would be to build a hierarchical list of managers for each employee. E.g.
    LEVEL MANAGER
    1     Jack
    2     John
    10     Dan the CEOOnce you have such a list for each employee, you can join these two lists on matching names. Then you simply need to find the matching join that has the lowest level.
    I'm sure there are other approaches. But unless you put together some test data, put together some SQLs and play around with this problem, you are not going to learn anything.
    And no, copying and pasting an answer that someone is inevitable to post in response is NOT learning anything new.
    So why not try and solve this problem yourself? Gain some new knowledge. That will only do your career well as your employer is after all expecting you to write the code to solve this problem - and not for members of this forum to supply the code for you.

  • Need Code for this requirement for generating report

    1) Creating interactive reports for sales orders, vendors, customers, and stock available  In each type for a particular material, list of purchase documents and vendor performance report that lists vendor name, materials Supplied and actual delivery times, payments terms and prices.
    2) Classical Report to display a list of Purchase
      Requisitions with details like MRP controller, release date, unit to
      Measure along with the standard details, Table used EBAN.
    3) Create a list of customer number, Credit limit
      To the given Customer. Tables used KNA1, KNKKF1 (Customer Credit table)
    Plz help me i need it very urgently....

    I always put code in the when-validate-RECORD trigger to ensure fields are entered, rather than setting the property. That way, the user can enter other fields within the record, and then gets a message that the field is required only when leaving the record.
    ...of course, if the date item is the only field in the block, then the when-validate triggers will not run unless the user at least types a space in the date. In that case, you need to check in the key-commit trigger.

  • Need Code For This Scenerio

    Good Evening,
    i am Srinivas V,
    My actual requirement is that in a JSP Page I had a Link when i click the link in the new page A Text Box to be there if the word pre defined entered the web page content to be viewed else nothing should be displayed .
    Can anyone suggest me regarding this.
    Regards
    Srinivas V

    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <html>
    <head>
    <title>Validator</title>
    <script language="javascript">
         function test(){
              var value=document.getElementById('t').value;
              if(value=="Hello")
                   getFile();
              else
                   document.getElementById('t').focus();     
         function getFile(){
              var req;
              if (window.XMLHttpRequest){
              req = new XMLHttpRequest();
              }else if (window.ActiveXObject) {
              req = new ActiveXObject("Microsoft.XMLHTTP");
         req.onreadystatechange = function(){
         if (req.readyState == 4){     
         if (req.status == 200){
                        document.getElementById('t').style.display='none';
                        document.getElementById('displayDiv').innerText=req.responseText;
    req.open("POST", "http://localhost:8080/heloapp/fileupload.html", true);
    req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
         req.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
    req.send(null);
    function f()
         document.f1.t1.focus();
    </script>
    </head>
    <body onLoad="f()">
    <form name=f1>
         <input type="text" onblur="test()" name=t1 id='t' />
         <Div id='displayDiv'></Div>
    </form>
    </body>
    </html>
    this is working BUT not executing the .jsp but just opening the file

  • I need code for this requirement

    Hi,
    I want to write a program to get personal data and employee address of an employee between two dates.
    on selectionscreen i want to display personal number,from date,to date. 
    Early reply is highly appreciable.
    Thanks,
    ram.
    <LOCKED BY MODERATOR - USE APPROPRIATE TITLES>
    Edited by: Alvaro Tejada Galindo on Aug 18, 2008 1:04 PM

    by default  those buttons will come disable mode .....
    u can check any ALV grid programs.....those buttons r in disable mode...
    if d user is asking u to enable, then convey him(by showing some existing Grid reports)  it is not possible, and show outout by clicking  print privew button -> then the output will come in list display,,,those buttons in enable mode...
    Note: those buttons r come default enable mode for ALV -LIST display, & diable mode for ALV -GRID display.
    ok
    Ramesh.

  • Need exact code for this

    In the transformation between 0FIGL_O02(table1) and ZSPM_D01(table2), delete records in 0FIGL_O02(table1), if 0AC_DOC_NO AND 0FISCPER AND 0COMP_CODE do not exists in 0FIAP_O03(table 3).
    need code for this...i have to implement it in BW.pls give me necessary code.
    Moderator message: please do more research before asking, show what you have done when posting, use meaningful titles when posting, read the rules of engagement.
    Edited by: Thomas Zloch on Feb 24, 2012

    Hai Pavan
    Check the following Code
    tables : mara.
    data : begin of itab occurs 0,
           matnr like mara-matnr,
           mbrsh like mara-mbrsh,
           mtart like mara-mtart,
           meins like mara-meins,
           end of itab.
    select-options : S_matnr for mara-matnr.
    initialization.
    clear s_matnr.
    refresh : s_matnr.
    s_matnr-low    = '0001'.
    s_matnr-high   = '0010'.
    s_matnr-Sign   = 'I'.
    s_matnr-Option = 'BT'.
    append s_matnr.
    start-of-selection.
    select matnr
           mbrsh
           mtart
           meins
           from mara
           into table itab
           where matnr in s_matnr.
    if sy-subrc = 0.
       sort itab by matnr.
    endif.
    if not itab[] is initial.
      loop at itab.
          if itab-matnr NOT  BETWEEN s_matnr-high AND s_matnr-low.
         if sy-subrc = 0.
           write :/ 'OK'.
         else.
           write :/ 'Not OK'.
         endif.
       endif.
      endloop.
    endif.
    Thanks & regards
    Sreenivasulu P
    Message was edited by: Sreenivasulu Ponnadi

  • Need PL/SQL code for this

    Hi,
    I need a PL/SQL code for this one...
    Let me know if something is not clear...
    1) The table CLOB_CLOBJECT_CDA has the columns described below...
    Explaining only those fields which are important in this context
    -- CDA_STEP_ID : Basically a Sequence
    -- CLOBJECT_SOURCE1_ID : Every id has got a set of records
    -- CLOBJECT_SOURCE2_ID : Every id has got a set of records
    -- LVL : There are total 8 levels..
    This is the main aim :
    1) There are total 16 million rows..(limited to 10 rows here)
    2) We need to go through level by level (LVL column) & insert the intersection records (CLOBJECT_SOURCE1_ID intersect CLOBJECT_SOURCE2_ID)
    into another table...but this is how it goes..
    Level (LVL column) 3's basically have CLOBJECT_SOURCE1_ID as level (LVL column) 2 CDA_STEP_ID's..
    (consider the statement --** where CLOBJECT_SOURCE1_ID = 285 which is same as 1st insert statement step id)..
    The above process goes for next levels until 8..(so have to use loops)
    So for ex :
    We go through the first insert statement and insert the insertion records only when both CLOBJECT_SOURCE1_ID & CLOBJECT_SOURCE2_ID has got records ..
    If we don't find any records for both of them we should skip the corresponding step id when we go to the next levels...
    Let's go through the 1st insert statement...
    -- We have CDA_STEP_ID = 285 & two sources CLOBJECT_SOURCE1_ID as 19 & CLOBJECT_SOURCE2_ID as 74...
    -- We see the table CLOBJECT_COUNTS & check whether we have counts for both 19 & 74 ..(In fact we insert counts into this table only if they have records)
    -- If so, we insert the intersection records into CDA_MRN_RESULTS ( we do have counts for both of them..) with CDA_STEP_ID 285...
    -- Then we insert the step id which is 285 along with the count into CLOBJECT_COUNTS..
    Let's go through another insert statement...
    -- Consider CDA_STEP_ID = 288 which has two sources CLOBJECT_SOURCE1_ID as 19 & CLOBJECT_SOURCE2_ID as 92...
    -- We see the table CLOBJECT_COUNTS & check whether we have counts for both 19 & 92 ..(we have records for 19 but not for 92)
    -- So we should not proceed with this..& also skip all those records (future records with increasing levels..basically level 3's) which have got 288 as CLOBJECT_SOURCE1_ID..
    (As said earlier that the present CDA_STEP_ID will always be CLOBJECT_SOURCE1_ID in the next level)...
    I wrote the following code which is after the statement...
    Let me have the create & insert statements here..
    create table CLOB_CLOBJECT_CDA
        CDA_STEP_ID           NUMBER,
        CDA_ID                NUMBER,
        CDA_SEQ_NUMBER        NUMBER,
        CLOBJECT_SOURCE1_TYPE VARCHAR2(3000),
        CLOBJECT_SOURCE1_ID   NUMBER,
        CLOBJECT_OPERATOR     VARCHAR2(3000),
        CLOBJECT_SOURCE2_TYPE VARCHAR2(3000),
        CLOBJECT_SOURCE2_ID   NUMBER,
        LVL                   NUMBER
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (285, 285, 1, 'CLOBJECT', 19, 'INTERSECT', 'CLOBJECT', 74, 2);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (286, 286, 1, 'CLOBJECT', 19, 'INTERSECT', 'CLOBJECT', 75, 2);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (287, 287, 1, 'CLOBJECT', 19, 'INTERSECT', 'CLOBJECT', 91, 2);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (288, 288, 1, 'CLOBJECT', 19, 'INTERSECT', 'CLOBJECT', 92, 2);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4869, 4869, 1, 'CDA_STEP', 285, 'INTERSECT', 'CLOBJECT', 91, 3);  -- **
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4870, 4870, 1, 'CDA_STEP', 285, 'INTERSECT', 'CLOBJECT', 92, 3);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4871, 4871, 1, 'CDA_STEP', 285, 'INTERSECT', 'CLOBJECT', 93, 3);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4880, 4880, 1, 'CDA_STEP', 286, 'INTERSECT', 'CLOBJECT', 91, 3);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4881, 4881, 1, 'CDA_STEP', 286, 'INTERSECT', 'CLOBJECT', 92, 3);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4882, 4882, 1, 'CDA_STEP', 286, 'INTERSECT', 'CLOBJECT', 93, 3);
    create table CDA_MRN_RESULTS
       CDA_STEP_ID      NUMBER,
      MRN              NUMBER,
      INSERT_DATE_TIME DATE
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (19, 1, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (19,  2, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (19,  3, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (74,  1, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (74,  2, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (74,  4, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (75,  1, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (75,  2, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (75,  6, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (91,  2, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (91,  3, to_date('19-10-2011', 'dd-mm-yyyy'));
    create table CLOBJECT_COUNTS
      CDA_STEP_ID    NUMBER,
      CLOBJECT_COUNT NUMBER,
      DATE_TIME      DATE
    Insert into CLOBJECT_COUNTS values (19,3, to_date('19-10-2011', 'dd-mm-yyyy'));
    Insert into CLOBJECT_COUNTS values (74,3, to_date('19-10-2011', 'dd-mm-yyyy'));
    Insert into CLOBJECT_COUNTS values (75,3, to_date('19-10-2011', 'dd-mm-yyyy'));
    Insert into CLOBJECT_COUNTS values (91,2, to_date('19-10-2011', 'dd-mm-yyyy'));The output goes into two tables...
    CDA_MRN_RESULTS : O/p of intersection records between source1 & source2 id
    CLOBJECT_COUNTS : Step id with counts ...(useful for skipping next level step id's if either of source id has "0" counts)
    Any help is appreciated..
    Thanks..

    I tried to code this..but looping takes a lot of time..I want to skip certain rows where source1_step_id & source_2_step_id are not in clobject_counts table as we proceed to the next levels..Not sure how to skip the rows..
    declare
    cursor c1 (p_level varchar2 ) is
      Select * from clob_clobject_cda
        where lvl = p_level    ;
       TYPE V_TT IS TABLE OF C1%ROWTYPE INDEX BY PLS_INTEGER;
        L_TT V_TT;
        v1 number;
        v2 number;
        v_step_id number;
        v_operator varchar2(100) := '';
    begin
    for i in 2..8 loop
      open c1(i);
      LOOP
           FETCH C1 BULK COLLECT INTO L_TT LIMIT 500;
            FOR indx IN 1 .. L_TT.COUNT
             LOOP
               v1 := L_TT(indx).clobject_source1_id;
               v2 := L_TT(indx).clobject_source2_id;
               v_step_id := L_TT(indx).cda_step_id;
               v_operator := L_TT(indx).clobject_operator;
      Execute Immediate ('Insert into cda_mrn_results Select --+ parallel (cm 128)
                                                      distinct ' || v_step_id || ', mrn, trunc(sysdate) dt from cda_mrn_results  cm
                        where cda_step_id = ' || v1 || '
                        and   cda_step_id in (Select cda_step_id from clobject_counts) ' ||
         v_operator ||
                    '  Select --+ parallel (cm 128)
                                                      distinct ' || v_step_id || ', mrn, trunc(sysdate) dt from cda_mrn_results  cm
                        where cda_step_id = ' || v2 || '
                        and   cda_step_id in (Select cda_step_id from clobject_counts)  ' );
    Insert --+ Append
           into clobject_counts Select cda_step_id, count(distinct mrn),
                       insert_date_time dt from cda_mrn_results  where cda_step_id =  v_step_id   group by cda_step_id,insert_date_time;
       COMMIT;                    
             END LOOP;
           EXIT WHEN L_TT.COUNT = 0;
         END LOOP;
      CLOSE C1;
    End Loop;    
    Commit;
    End;

  • WHY? 3 out of 4 of my vimeo videos coming up with 'oops the embed code for this video isn't valid'!

    I have inserted my showreel, its working fine, but now I have tried to embed 3 others videos, they all come up with 'oops the embed code for this video isn't working'
    I really don't understand why?
    Holly

    Hello,
    How are you trying to preview the page ? "Preview"tab in Muse or Preview Page in Browser.
    Do you have any URL for us to see ? Please share the codes that you are using to embed the video.
    Regards
    Vivek

  • Need code for sql update

    HI All,
    i have table with data like this
    select '[email protected]' mgr, null mgr1,null mgr2,null mgr3,'[email protected]:[email protected]:[email protected]'mgrfull from dual;
    1)mgrfull column have with : sepreated email ,here last email split and update to mgr1 column and like this mgr2, mgr3.. Finaly need updated date
    required like this see below
    ----------------------FINAL OUTPUT REQUIRED----------
    select '[email protected]' mgr, '[email protected]' mgr1,'[email protected]' mgr2,'[email protected]' mgr3,'[email protected]:[email protected]:[email protected]' mgrfull from dual;
    Please give me the code for this...

    set linesize 200;
    with tab as
    select '[email protected]' mgr, null mgr1,null mgr2,null mgr3,'[email protected]:[email protected]:[email protected]'mgrfull from dual
    select mgr,
             regexp_substr(mgrfull,'[^:]+', 1, 3) mgr1, 
             regexp_substr(mgrfull,'[^:]+', 1, 2) mgr2, 
             regexp_substr(mgrfull,'[^:]+', 1, 1) mgr3,
             mgrfull
    from tab;
    MGR             MGR1                                          MGR2                                          MGR3                                          MGRFULL                                     
    [email protected] [email protected]                               [email protected]                                [email protected]                                [email protected]:[email protected]:[email protected]
    1 row selected.
    update table_name
    set mgr1 = regexp_substr(mgrfull,'[^:]+', 1, 3), 
         mgr2 = regexp_substr(mgrfull,'[^:]+', 1, 2),
         mgr3 = regexp_substr(mgrfull,'[^:]+', 1, 1);

  • Need code for restarting my system

    hello every body i need code for restarting system
    this code does not work
    try {
    Runtime.getRuntime().exec("shutdown -s -t01") // stop
    }catch(...
    or
    try {
    Runtime.getRuntime().exec("shutdown -r -t01") // reboot
    }catch(...
    or
    try {
    Runtime.getRuntime().exec("shutdown -l -t01") // logout
    }catch(...

    write a jni function that calls this method : ExitWindowsEx()
    check the documentation

  • Need code for the problem

    have to create a instance of class if that is the first instance ... successive call to create the instance should return the first instance of the class....i need the code for this pls help me .... even if the code is in C++ its ok

    abhinay.is2006 wrote:
    actually this was the question asked for me in a interview .... i am just a beginner to java and i am not able to get the solution ..My reply actually was a hint: google for "singleton" and you know all.
    kind regards,
    Jos

  • Need code for ITC502

    I need code for gpib to ITC 502.
    Need to set temperature and threshold,
    thankx

    The instruction manual for this instrument is available from Oxford
    Instruments at no charge- they sent me a copy by email as a PDF file. I
    don't have it to hand at the moment so can't dig out the relevant info but
    it would be worth having the full manual, I think. There's a bit more to a
    decent driver than simply setting the temperature, and I'm not sure what you
    mean by "threshold".
    "mdeleon" wrote in message
    news:[email protected]..
    > I need code for gpib to ITC 502.
    > Need to set temperature and threshold,
    > thankx

  • Need code for padding (spacing) 5 navigation links in my #topnavbar internal style

    need code for padding (spacing) 5 navigation links in my #topnavbar internal style

    I'm new at this and the below code is regarding the navigation bar and links
    I started using a template to create the first html page and made copies of it to create the other four.
    All the links work but I wanted to space them apart further.
    They look basically like this horizontally: Home About Us Photo Gallery Services Contact Us
    #topnavbar {
    text-align:center;
    #topnavbar a:link a:visited{
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 100%;
    font-weight: bold;
    color: #039;
    text-decoration: none;
    margin: 0 25px:
    #topnavbar a:hover a:active {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 100%;
    font-weight: bold;
    color: #039;
    text-decoration: none;
          <div id="topnavbar">
          <nav>
          <p><a href="index.html">Home</a>  
             <a href="aboutus.html">About Us</a>  
             <a href="photogallery.html">Photo Gallery</a>
             <a href="services.html">Services</a>
             <a href="contactus.html">Contact Us</a></p>  
          </nav>
           </div>

Maybe you are looking for