Selection screen dynamic enable and disable

HI all,
I have one requirement like
on selection of redio button my selection screen hould be enable and disable
Like if i select rediobutton  tfile then my selection screen block B2 should enable and Block B3 hould be disable
If redio button selscr is selected then my block B3 should be enable and Block B2 should disable
my selection screen code is below
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-005.
PARAMETERS: tfile  RADIOBUTTON GROUP g1 DEFAULT 'X'.
PARAMETERS: selscr RADIOBUTTON GROUP g1.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_matnr FOR marc-matnr,
                             s_fkdat FOR vbrk-fkdat OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-002.
PARAMETERS : filename TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK b3.
How to do that.
Help me here its urgent tnx in advance.

Hi Lalit,
Check the below code.
TABLES: marc, vbrk.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-005.
PARAMETERS: tfile RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND rusr.
PARAMETERS: selscr RADIOBUTTON GROUP g1.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_matnr FOR marc-matnr  MODIF ID abc,
                 s_fkdat FOR vbrk-fkdat  MODIF ID abc.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-002.
PARAMETERS : filename TYPE rlgrap-filename MODIF ID def.
SELECTION-SCREEN END OF BLOCK b3.
AT SELECTION-SCREEN OUTPUT.
*Note: To disable the fields use the below one.
  LOOP AT SCREEN.
    IF screen-group1 = 'DEF'. "Name field
      IF selscr = 'X'.
        screen-input = 1.
      ELSE.
        screen-input = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDIF.
     IF screen-group1 = 'ABC'. "Name field
      IF selscr = 'X'.
        screen-input = 0.
      ELSE.
        screen-input = 1.
      ENDIF.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.
*Note: To hide the screen use the below one.
LOOP AT SCREEN.
   IF screen-group1 = 'DEF'. "Name field
     IF selscr = 'X'.
       screen-active = 1.
     ELSE.
      screen-active = 0.
     ENDIF.
     MODIFY SCREEN.
  ENDIF.
   IF screen-group1 = 'ABC'. "Name field
     IF  tfile = 'X'.
       screen-active = 1.
     ELSE.
      screen-active = 0.
    ENDIF.
     MODIFY SCREEN.
  ENDIF.
ENDLOOP.

Similar Messages

  • Selection screen, dynamic enable and disable of blocks

    Hi,
    i have several parameters in different blocks.i want to enable one block and disable other blocks depending on the radio button selection. could some one help me on this.
    for eg.
    radiobutton1.  under this text entries for date, time etc.
    radiobutton 2. under this text entries for location from, location 2,phone etc.
    so, if i select radio button 1 all the remaining text entries under other radio buttons should be disabled. how to do this.
    your help would be appreciated.
    Thanks,
    kranthi.

    Hi Kranthi,
    I am not sure what you meant by disabling all the selection screen fields. Are you saying ALL the selection screen fields or all fields that don't belong to the selected radio-button.
    Anyway, here is a sample code how you manipulate the selection screen. The key options to use are 'modif id', 'at selection-screen output' and 'loop at screen'.
    *------------------------ Selection Screen ---------------------------*
    SELECTION-SCREEN BEGIN OF BLOCK selscr WITH FRAME TITLE text-000.
    PARAMETERS: p_rad1   RADIOBUTTON GROUP rad1 USER-COMMAND a DEFAULT 'X',
                p_rad2   RADIOBUTTON GROUP rad1,
                p_rad3   RADIOBUTTON GROUP rad1.
    *-- Selection Screen for radio button 1
    SELECTION-SCREEN BEGIN OF BLOCK rad1 WITH FRAME TITLE text-001.
    PARAMETERS:     p_date   LIKE sy-datum DEFAULT sy-datum MODIF ID one.
    SELECT-OPTIONS: s_uzeit  FOR  sy-uzeit MODIF ID one.
    SELECTION-SCREEN END OF BLOCK rad1.
    *-- Selection Screen for radio button 2
    SELECTION-SCREEN BEGIN OF BLOCK rad2 WITH FRAME TITLE text-002.
    PARAMETERS: p_werks   LIKE t001w-werks MODIF ID two.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(6) text-003 MODIF ID two.
    SELECTION-SCREEN POSITION 8.
    PARAMETERS: p_chk  AS CHECKBOX DEFAULT 'X' MODIF ID two.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK rad2.
    *-- Selection Screen for radio button 3
    SELECTION-SCREEN BEGIN OF BLOCK rad3 WITH FRAME TITLE text-004.
    PARAMETERS: p_matnr   LIKE mkal-matnr MODIF ID tri,
                p_verid LIKE mkal-verid MODIF ID tri.
    SELECTION-SCREEN END OF BLOCK rad3.
    SELECTION-SCREEN END OF BLOCK selscr.
    AT SELECTION-SCREEN OUTPUT.
      IF p_rad1 = 'X'.
        LOOP AT SCREEN.
          IF  screen-group1 = 'TWO' OR
              screen-group1 = 'TRI'.
            screen-input = 0.
            screen-invisible = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSEIF p_rad2 = 'X'.
        LOOP AT SCREEN.
          IF screen-group1 = 'ONE' OR
             screen-group1 = 'TRI'.
            screen-input = 0.
            screen-invisible = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSEIF p_rad3 = 'X'.
        LOOP AT SCREEN.
          IF screen-group1 = 'ONE' OR
             screen-group1 = 'TWO'.
            screen-input = 0.
            screen-invisible = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    If you want to hide all the, I mean all except the radio-buttons, then simply loop at screen and modify every entry except the radio-button entries to screen-active 0. Something like this.
    LOOP AT SCREEN.
      IF SCREEN-NAME = 'RAD1' OR
         SCREEN-NAME = 'RAD2 OR
         SCREEN-NAME = 'RAD3'.
      ELSE.
        SCREEN-ACTIVE = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
    Srinivas

  • Enable and Disable the file paths

    Hai i have two file paths one logical file path and other is physical file path.
    I took two radio buttons.
    How can i enable and disable the file paths by using these radio buttons.
    When i select the 1st radio button then 1st file path is in enable and second file path in disable mode similarly for the second radio button also.
    It is very urgent .
    With Regards,
    Prasad.Tallapudi.

    i answered in your other post....here is the code again....
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS: logfile type string default 'Z_DATALOAD',
    FILE(128) TYPE C DEFAULT 'nittest.txt' LOWER CASE.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
    PARAMETERS: P_LFILE RADIOBUTTON GROUP G1 USER-COMMAND C1 DEFAULT 'X',
    P_PFILE RADIOBUTTON GROUP G1.
    SELECTION-SCREEN END OF BLOCK B2.
    at selection-screen output.
      if p_lfile eq 'X'.
        loop at screen.
          if screen-name = 'LOGFILE'.
            screen-input = '1'.
            endif.
            if screen-name = 'FILE'.
              screen-input = '0'.
              endif.
              modify screen.
          endloop.
        endif.
        if p_pfile eq 'X'.
          loop at screen.
          if screen-name = 'LOGFILE'.
            screen-input = '0'.
            endif.
            if screen-name = 'FILE'.
              screen-input = '1'.
              endif.
              modify screen.
          endloop.
          endif.
    if the problem gets solved...please close both the posts

  • On basis of drop down by key values i want to enable and disable ui elements is wda

    How to enable and disable ui elements on basis of drop down by key values as i show in screen shot i have 3 values in drop down by key on basis of those values i need to enable and disable ui elements in webdynpro abap kindly reply back

    Hi Sreedhara,
    There are many tutorials on SCN for learning Web Dynpro ABAP. If the following steps don't make sense to you, please do a search for some tutorials and read through the tutorial materials. Hopefully the tutorials will help you to become familiar with some of the basics of Web Dynpro ABAP.
    Here is how to enable or disable a UI element upon selection from a DropDownByKey.
    In your view context, create a context attribute of type wdy_boolean. For now, let's call this attribute IS_ENABLED
    In your view layout, bind the enabled property of the UI element to the context attribute IS_ENABLED.
    In your view actions, create an action-- let's call it SET_ENABLED-- and bind this action to the DropDownByKey element's onSelect event in the view layout.
    In the event handler method for the SET_ENABLED action, use the Code Wizard to read the value of the DropDownByKey selected value, then use the Code Wizard again to set the value of context attribute IS_ENABLED to either true or false.
    Now when a value is selected from the DropDownByKey, the SET_ENABLED action will be triggered and the IS_ENABLED context attribute will be set to either true or false. Since your UI element's enabled property is bound to this true or false value via the context binding, the UI element will change to enabled or disabled.
    Good luck!
    Cheers,
    Amy

  • How to create the selection screen dynamically

    Hi,
    I have a requirement to create the selection screen Dynamically. All the fields that should appear on the selection screen will be available in a custom table. So, based on the entries available in the Z tables, the selection screen should be built. Eg. If there are 10 records available in the Z table, the selection screen should consist of 10 fields. If there are 100 entries, the Selection screen should contain 100 fields. and the logic to build this selection screen should be carried out dynamically in the program.
    Could anyone of you please share the valuable inputs on this. If anyone has the sample code to do this, please share.
    Thanks in advance.
    Regards,
    Paddu.

    Hi,
    Kindly go through this sample program below:
    DEMO_LIST_FORMAT_INPUT *and
    check this function module:
    FREE_SELECTIONS_DIALOG *.
    Hope it helps
    Regards
    Mansi

  • Modifying Selection screen dynamically

    Hi guyz
    herez another question
    Can we modify selection-screen dynamically  as we do in case of screen
    What i want to do is
    I want to display one parameter as  checkbox and when user ticks this box I want to display another one
    If we are defining two checkboxes earlier and making one invisible than can we modify selection screen to display another check box
    Thanks in advance

    Take a look at this example.
    REPORT EVENT_DEMO.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
      PARAMETERS: R1 RADIOBUTTON GROUP RAD1 DEFAULT 'X',
                  R2 RADIOBUTTON GROUP RAD1,
                  R3 RADIOBUTTON GROUP RAD1.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.
      PARAMETERS: R4 RADIOBUTTON GROUP RAD2 DEFAULT 'X',
                  R5 RADIOBUTTON GROUP RAD2,
                  R6 RADIOBUTTON GROUP RAD2.
    SELECTION-SCREEN END OF BLOCK B2.
    AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD1.
      IF R1 = 'X'.
        MESSAGE W040(HB).
      ENDIF.
    AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD2.
      IF R4 = 'X'.
        MESSAGE W040(HB).
      ENDIF.

  • Selection-screen dynamic selections for dtab

    Hey experts,
    when I add this to my code
    selection-screen dynamic selections for zbr_t_autori
    and I want activate it, it writes out an error
    The addition "DYNAMIC_SELECTIONS" is only allowed in INCLUDE DB__SSEL.
    and I don't know how to solve it, what is that include db__ssel?
    Can anybody help me.
    Regards,
    Robert

    Check this:
    Structure of Logical Databases - ABAP Programming (BC-ABA) - SAP Library
    Where are you using this code?
    selection-screen dynamic selections for zbr_t_autori
    It should be in the include reserved for your LDB selection:

  • Can you enable and disable windows task bar

    I there a dynamic way to enable and disable the windows task bar?

    I am not clear on a way to do this, but if it were possible, you would have to make calls to Windows SDK. You would use the Call Library Function Node to access one of the Windows System DLLs to do this. I would suggest checking http://msdn.microsoft.com. This is a great resource for SDK related issues.
    J.R. Allen

  • Making a field on screen input enabled or disabled

    Dear Friends,
    Please suggest how can I make a field on my dialog-program screen input enabled or disabled through coding. I understand that the same can be done by setting screen parameters but i wish to do that through programming only.
    Regards,
    Alok.

    Hi Alok,
           A field can Enabled or Disabled by setting its attributes.
    As it is a element placed on screen and modify the screen  you need to modify the screen table.
    loop at screen.
    screen-group1 = 'SC1'.
    Enable:
    if screen-name = 'PA_MATNR':
      screen-input = '1'.
      screen-output = '0'.
    modify screen.
    endif.
    DISABLE:
    if screen-name = 'PA_MATNR':
      screen-input = '0'.
      screen-output = '1'.
    modify screen.
    endif.
    endloop.   
    Some more Info :
    1  --- Active
    1 --- Input
    1 --- Output
    0 --- Invisible
    Screen field is displayed, even if Invisible is set statically.
    Field contents are displayed.
    Ready for input, even if Input is not set statically. However, not ready for input if the Output only is set statically.
    1
    1
    0
    0
    Screen field is displayed, even if Invisible is set statically, except when Output only is set statically.
    Field contents are not displayed.
    Ready for input, even if Input is not set statically.
    1
    0
    1
    0
    Screen field is displayed, even if Invisible is set statically.
    Field contents are displayed.
    Not ready for input, even if Input is set statically.
    1
    0
    0
    0
    Screen field is displayed, even if Invisible is set statically, except when Output only is set statically.
    Field contents are not displayed.
    Not ready for input, even if Input is set statically.
    1
    1
    1
    1
    Screen field is displayed, even if Invisible is set statically, except when Output only is set statically.
    Field contents are not displayed.
    Ready for input, even if Input is not set statically. User input is masked by asterisks (*).
    1
    1
    0
    1
    Screen field is displayed, even if Invisible is set statically, except when Output only is set statically.
    Output is masked by asterisks (*).
    Ready for input, even if Input is not set statically. User input is masked by asterisks (*).
    1
    0
    1
    1
    Screen field inactive.
    Screen field is not displayed, regardless of the static attributes.
    0
    0
    0
    1
    Screen field inactive.
    Screen field is not displayed, regardless of the static attributes.
    Br,
    Laxmi

  • EBS-UM Enable and Disable

    Hi all,
    We have enable and disable tasks in EBS-UM.Can anyone say me how to check the enable and disable user in target?
    I wanted to know fnd_user is the table where we can check in target??

    Hi Skud,
    Indeed Jeff's answer is correct and handles the problem. I would like to mention another way,
    Edit the desired button >> Navigate to Conditions >> Pick ( Exists SQL query returns at least one row) >> In Expression 1 box, type code similar to this :
    select UPPER (:app_user) from dual where UPPER(:app_user) in ( 'FATEH', 'MARY')Best Wishes,
    Fateh

  • Delegation to allow HelpDesk users to Enable and Disable accounts

    We currently have a HelpDeskAdmins group that these users are allowed to perform certain functions within Active Directory. I need to add the ability to Enable and Disable user accounts.
    I have been looking through the Delegation of Control settings but do not know which ones to add to enable this...
    Has anyone setup accounts to perform this before?

    You need to create a delegation for the attribute userAccountControl. So run the delegation wizard as usual, but select "Create a custom task to delegate", then pick up "User objects", then "Property-specific" and select the
    "Read and Write userAccountInformation".
    So, you can do it directly on the attribute, or you can do it using the property set User-Account-Restrictions (this last one actually give you a little bit more permission, see
    here).
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • Validating enabled and disabled menu bar in JInternalFrame

    hi,
    everybody.
    i have created a main window using JInternalFrame and JDesktopPane. The window has a menu bar in which document menu is used for closing the main window, while employee menu is used for adding new frame for the employee. while the login frame is displayed when the application is executed.
    my problem is, i want to validate that before login process, employee menu should be disabled, and after login is performed employee menu is enabled.
    the following is my code.
    please reply me as i am stucked with it.
    waiting for the reply
    thanks in advance.
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.io.*;
    import java.util.*;
    public class InternalFrameDemo extends JFrame implements ActionListener
    JDesktopPane desktop;
    public InternalFrameDemo()
    super("InternalFrameDemo");
    int inset = 50;
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    setBounds(inset, inset, screenSize.width - inset*2, screenSize.height - inset*2);
    desktop = new JDesktopPane();
    setContentPane(desktop);
    desktop.setBackground(Color.white);
    setJMenuBar(createMenuBar());
    desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
    createLogin();
    public JMenuBar createMenuBar()
    JMenuBar menuBar = new JMenuBar();
    JMenu menu = new JMenu("Document");
    menu.setMnemonic(KeyEvent.VK_D);
    menuBar.add(menu);
    JMenuItem menuItem = new JMenuItem("Quit");
    menuItem.setMnemonic(KeyEvent.VK_Q);
    menuItem.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_Q, ActionEvent.ALT_MASK));
    menuItem.setActionCommand("quit");
    menuItem.addActionListener(this);
    menu.add(menuItem);
    JMenu employee = new JMenu("Employee");
    employee.setMnemonic(KeyEvent.VK_E);
    employee.setActionCommand("employee");
    menuBar.add(employee);
    JMenuItem additem = new JMenuItem("Add");
    additem.setMnemonic(KeyEvent.VK_A);
    additem.setActionCommand("add");
    additem.addActionListener(this);
    employee.add(additem);
    return menuBar;
    public void actionPerformed(ActionEvent ae)
    String str = ae.getActionCommand();
    if(str.equals("add"))
    System.out.println("Employee Form Invoked");
    createEmployee();
    else if(str.equals("quit"))
    quit();
    public void createEmployee()
    MyEmployeeFrame employeeframe = new MyEmployeeFrame();
    employeeframe.setVisible(true);
    desktop.add(employeeframe);
    try
    employeeframe.setSelected(true);
    catch(Exception e)
    public void createLogin()
    MyLogin loginframe = new MyLogin();
    loginframe.setVisible(true);
    desktop.add(loginframe);
    try
    loginframe.setSelected(true);
    catch(Exception e){}
    public void quit()
    System.exit(0);
    private static void createAndShowGUI()
    JFrame.setDefaultLookAndFeelDecorated(true);
    InternalFrameDemo frame = new InternalFrameDemo();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(800,600);
    frame.setVisible(true);
    public static void main(String a[])
    createAndShowGUI();
    class MyEmployeeFrame extends JInternalFrame implements ActionListener
    JFrame employeeframe;
    JLabel labelfirstname;
    JLabel labellastname;
    JLabel labelage;
    JLabel labeladdress;
    JLabel labelcity;
    JLabel labelstate;
    JTextField textfirstname;
    JTextField textlastname;
    JTextField textage;
    JTextField textaddress;
    JTextField textcity;
    JTextField textstate;
    JButton buttonsave;
    FileOutputStream out;
    PrintStream p;
    String strfirstname,strlastname,strage,straddress,strcity,strstate;
    GridBagLayout gl;
    GridBagConstraints gbc;
    public MyEmployeeFrame()
    super("Employee Details",true,true,true,true);
    setSize(500,400);
    labelfirstname = new JLabel("First Name");
    labellastname = new JLabel("Last Name");
    labelage = new JLabel("Age");
    labeladdress = new JLabel("Address");
    labelcity = new JLabel("City");
    labelstate = new JLabel("State");
    textfirstname = new JTextField(10);
    textlastname = new JTextField(10);
    textage = new JTextField(5);
    textaddress = new JTextField(15);
    textcity = new JTextField(10);
    textstate = new JTextField(10);
    buttonsave = new JButton("Save");
    gl = new GridBagLayout();
    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 1;
    gbc.gridy = 3;
    gl.setConstraints(labelfirstname,gbc);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 3;
    gbc.gridy = 3;
    gl.setConstraints(textfirstname,gbc);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 1;
    gbc.gridy = 5;
    gl.setConstraints(labellastname,gbc);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 3;
    gbc.gridy = 5;
    gl.setConstraints(textlastname,gbc);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 1;
    gbc.gridy = 7;
    gl.setConstraints(labelage,gbc);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 3;
    gbc.gridy = 7;
    gl.setConstraints(textage,gbc);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 1;
    gbc.gridy = 9;
    gl.setConstraints(labeladdress,gbc);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 3;
    gbc.gridy = 9;
    gl.setConstraints(textaddress,gbc);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 1;
    gbc.gridy = 11;
    gl.setConstraints(labelcity,gbc);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 3;
    gbc.gridy = 11;
    gl.setConstraints(textcity,gbc);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 1;
    gbc.gridy = 13;
    gl.setConstraints(labelstate,gbc);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 3;
    gbc.gridy = 13;
    gl.setConstraints(textstate,gbc);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 3;
    gbc.gridy = 17;
    gl.setConstraints(buttonsave,gbc);
    Container contentpane = getContentPane();
    contentpane.setLayout(gl);
    contentpane.add(labelfirstname);
    contentpane.add(textfirstname);
    contentpane.add(labellastname);
    contentpane.add(textlastname);
    contentpane.add(labelage);
    contentpane.add(textage);
    contentpane.add(labeladdress);
    contentpane.add(textaddress);
    contentpane.add(labelcity);
    contentpane.add(textcity);
    contentpane.add(labelstate);
    contentpane.add(textstate);
    contentpane.add(buttonsave);
    buttonsave.addActionListener(this);
    public void reset()
    textfirstname.setText("");
    textlastname.setText("");
    textage.setText("");
    textaddress.setText("");
    textcity.setText("");
    textstate.setText("");
    public void actionPerformed(ActionEvent ae)
    String str = ae.getActionCommand();
    System.out.println(str);
    if(str.equalsIgnoreCase("Save"))
    try
    out = new FileOutputStream("myfile.txt",true);
    p = new PrintStream( out );
    strfirstname = textfirstname.getText();
    strlastname = textlastname.getText();
    strage = textage.getText();
    straddress = textaddress.getText();
    strcity = textcity.getText();
    strstate = textstate.getText();
    p.print(strfirstname+"|");
    p.print(strlastname+"|");
    p.print(strage+"|");
    p.print(straddress+"|");
    p.print(strcity+"|");
    p.println(strstate);
    System.out.println("Record Saved");
    reset();
    p.close();
    catch (Exception e)
    System.err.println ("Error writing to file");
    class MyLogin extends JInternalFrame implements ActionListener
    JFrame loginframe;
    JLabel labelname;
    JLabel labelpassword;
    JTextField textname;
    JPasswordField textpassword;
    JButton okbutton;
    String name = "";
    FileOutputStream out;
    PrintStream p;
    Date date;
    GregorianCalendar gcal;
    GridBagLayout gl;
    GridBagConstraints gbc;
    public MyLogin()
    super("Login",true,true,true,true);
    setSize(400,300);
    gl = new GridBagLayout();
    gbc = new GridBagConstraints();
    labelname = new JLabel("User");
    labelpassword = new JLabel("Password");
    textname = new JTextField("",9);
    textpassword = new JPasswordField(5);
    okbutton = new JButton("OK");
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 1;
    gbc.gridy = 5;
    gl.setConstraints(labelname,gbc);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 2;
    gbc.gridy = 5;
    gl.setConstraints(textname,gbc);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 1;
    gbc.gridy = 10;
    gl.setConstraints(labelpassword,gbc);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 2;
    gbc.gridy = 10;
    gl.setConstraints(textpassword,gbc);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridx = 1;
    gbc.gridy = 15;
    gl.setConstraints(okbutton,gbc);
    Container contentpane = getContentPane();
    contentpane.setLayout(gl);
    contentpane.add(labelname);
    contentpane.add(labelpassword);
    contentpane.add(textname);
    contentpane.add(textpassword);
    contentpane.add(okbutton);
    okbutton.addActionListener(this);
    public void reset()
    textname.setText("");
    textpassword.setText("");
    public void run()
    try
    String text = textname.getText();
    String blank="";
    if(text.equals(blank))
    System.out.println("First Enter a UserName");
    else
    if(text != blank)
    date = new Date();
    gcal = new GregorianCalendar();
    gcal.setTime(date);
    out = new FileOutputStream("log.txt",true);
    p = new PrintStream( out );
    name = textname.getText();
    String entry = "UserName:- " + name + " Logged in:- " + gcal.get(Calendar.HOUR) + ":" + gcal.get(Calendar.MINUTE) + " Date:- " + gcal.get(Calendar.DATE) + "/" + gcal.get(Calendar.MONTH) + "/" + gcal.get(Calendar.YEAR);
    p.println(entry);
    System.out.println("Record Saved");
    reset();
    p.close();
    catch (IOException e)
    System.err.println("Error writing to file");
    public void actionPerformed(ActionEvent ae)
    String str = ae.getActionCommand();
    if(str.equals("OK"))
    run();
    loginframe.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    }

    I realize this post is from a few days ago, but if you're still looking for help:
    This is my first thought on how to do this. Unfortunately, it's a bit messy. JMenuItems can be enabled and disabled but JMenus don't have this option...
    public class InternalFrameDemo extends JFrame implements ActionListener
        JDesktopPane desktop;
        JMenuBar menuBar;
        public InternalFrameDemo()
         setJMenuBar(createMenuBar());
         desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
         createLogin();
        public JMenuBar createMenuBar()
         menuBar = new JMenuBar();
         JMenu menu = new JMenu("Document");
         menu.setMnemonic(KeyEvent.VK_D);
         menuBar.add(menu);
         JMenuItem menuItem = new JMenuItem("Quit");
         menuItem.setMnemonic(KeyEvent.VK_Q);
         menuItem.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_Q, ActionEvent.ALT_MASK));
         menuItem.setActionCommand("quit");
         menuItem.addActionListener(this);
         menu.add(menuItem);
         JMenuItem additem = new JMenuItem("Add");
         additem.setMnemonic(KeyEvent.VK_A);
         additem.setActionCommand("add");
         additem.addActionListener(this);
         employee.add(additem);
         return menuBar;
        public void createLogin()
         MyLogin loginframe = new MyLogin( menuBar );
         loginframe.setVisible(true);
         desktop.add(loginframe);
         try
             loginframe.setSelected(true);
         catch(Exception e)
    class MyLogin extends JInternalFrame implements ActionListener
        JMenuBar menuBar;
        public MyLogin( JMenuBar menuBar1 )
         super("Login",true,true,true,true);
         menuBar = menuBar1;
        public void actionPerformed(ActionEvent ae)
         String str = ae.getActionCommand();
         if(str.equals("OK"))
             run();
             JMenu employee = new JMenu("Employee");
             employee.setMnemonic(KeyEvent.VK_E);
             employee.setActionCommand("employee");
             menuBar.add(employee);
             loginframe.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    }

  • Can i export a list of all the webpages in my site, enabled and disabled?

    Hey Guys,
    Can i export a list of all the webpages in my site, enabled and disabled?
    I saw you could view all pages in the advanced view - but i am not sure if you can then export that as an excel file.

    hey Liam -
    but ftp doesnt show you what is enabled and disabled.
    also I don't think you can export an excel file from this?
    Pretty much i want this list - in an excel format!

  • How to distinguish between enabled and disabled tasks in SSDT-BI 2012

    Hi,
    I've got SSDT-BI 2012 together with VS2012 installed. Simple questions: What is the difference between enabled and disabled tasks in control flow from the design/color point of view? I do see that the disabled tasks changes to grey (omg are you really kidding
    me????) from black. This could be a bad joke or dream however is not.
    So I'm kindly asking you to help me solve this problem. How can I change the color difference between these two options (enabled task vs disabled task)? I do not care whether the one will be yellow or pink, simply just need to be recognizable at first
    look and not under long and painful examination.
    Thanks for your reply. Hopefully it will be useful.
    Karol.

    Hi Karol,
    It’s true that it only changes the font color of the task name text to grey after disabling a task in SSDT 2012. In SSDT 2010, the whole task control including icon will turn grey after it is disabled; in BIDS, the background color of the task control will
    turn grey after it is disabled. These behaviors are by design. Personally, I agree with you that this behavior in SSDT 2012 is not very readable.
    If you have concerns, I would suggest you submitting a wish at
    https://connect.microsoft.com/sql.
    Connect site is a connection point between you and Microsoft, and ultimately the larger community. Your feedback enables Microsoft to make software and services the best that they can be, and you can learn about and contribute to exciting projects.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • How I can delete add-in in windows 8.1 ,I see only enable and disable function but I don't see any add-in delete function

    hi,
    how I can delete  add-in applications in add-in applications section ,  I try to delete one but I don't see any delete function, I see only enable and disable function in the manage add-in applications wizard.
    thanks
    johan
    h.david

    Hi,
    If you want to remove the add-ins of Office 2010 programs, you need to remove it from control panel.
    For example, if you use Excel, please try to follow the link to delete the add-ins:
    http://office.microsoft.com/en-us/excel-help/add-or-remove-add-ins-HP010342658.aspx
    If I misunderstand something, please let me know.
    Regards,
    George Zhao
    TechNet Community Support

Maybe you are looking for

  • IMovie HD (6) will not capture video taken from HV20 in PF24 mode

    The preview window shows the video just fine. iMovie complains that Quicktime doesn't have the ability (codec/plugin) to edit or playback my video. I find it ironic that software claiming to support HD and HDV can't read the video. It says to re-inst

  • Error Code: DW050

    I am trying to download the free trail of the Creative Cloud & whenever I try to download Photoshop I keep getting Error DW050. I dont know if this might be a factor in it or not, But I would like to mention that I am still running on Snow Leopard &

  • What is the newest version of Adobe camera raw for PSE 11?

    Wat is de nieuwste versie van Adobe Camera Raw voor PSE 11? What is the newest version of Adobe Camera Raw for PSE 11?

  • How do i unluck my macbookpro from Icloud?

    I got my macbook pro stolen yesterday, and my first reaction was to lock it on Icloud.  I didn't read the instructions before doing so but now that I read them I noticed that by locking it I won't be able to find it or wipe it.  How do I unlock it?

  • How do I get PC suite to sync locations from Outlo...

    Sorry if this has already been asked. While i can sync my calendar to my E71 it doesn't show the location for the event, just useless things like time slots (everything is set to all day event in Outlook). Can I at least get the Location to show up i