Problem in validating menu item

hi,
everybody.
i have created a main window using JInternalFrame. 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 that i want to validate that before login 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.
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);
}

hai!.
i am happy to help you.Below is the modified code of ur program.if u still have problem please post.
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
public class MainFrame extends JFrame implements ActionListener
     JDesktopPane desktop;
     JMenuBar menubar;
     JMenu menu,menuemployee;
     public JMenuItem menuitemlogin;
     JMenuItem menuitemquit,itememployee;
     public MainFrame()
          super("MainFrame");
          int inset = 50;
          Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          setBounds(inset,inset,screenSize.width - inset*2,screenSize.height - inset*2);
          desktop = new JDesktopPane();
          desktop.setBackground(Color.white);
          setContentPane(desktop);
          desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
          setJMenuBar(createMenuBar());
          //createLogin();
     public JMenuBar createMenuBar()
          menubar = new JMenuBar();
          menu = new JMenu("Document");
          menu.setMnemonic(KeyEvent.VK_D);
          menuitemlogin = new JMenuItem("Login");
          menuitemlogin.setMnemonic(KeyEvent.VK_L);
          menuitemlogin.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, ActionEvent.ALT_MASK));
          menuitemlogin.setActionCommand("login");
          menuitemlogin.addActionListener(this);
          menuitemquit = new JMenuItem("Quit");
          menuitemquit.setMnemonic(KeyEvent.VK_Q);
          menuitemquit.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_Q, ActionEvent.ALT_MASK));
          menuitemquit.setActionCommand("quit");
          menuitemquit.addActionListener(this);
          menubar.add(menu);
          menu.add(menuitemlogin);
          menu.add(menuitemquit);
          itememployee = new JMenu("Employee");
          itememployee.setMnemonic(KeyEvent.VK_E);
          itememployee.setActionCommand("employee");
//added this line to disable the itememployee item button     
          itememployee.setEnabled(false);
//use above the displaying menus all are "JAbstractButton" itememployee.disable();
          menubar.add(itememployee);
          JMenuItem additem = new JMenuItem("Add");
          additem.setMnemonic(KeyEvent.VK_A);
          additem.setActionCommand("add");
          additem.addActionListener(this);
          itememployee.add(additem);
          return menubar;
     public void actionPerformed(ActionEvent ae)
          String str = ae.getActionCommand();
          if(str.equals("login"))
//added this line to disable login menu:
menuitemlogin.setEnabled(false);
               createLogin();
          else if(str.equals("quit"))
               System.exit(0);
          else if(str.equals("add"))
               System.out.println("Employee Form Invoked");
               createEmployee();
     private static void createAndShowGUI()
          JFrame.setDefaultLookAndFeelDecorated(true);
          MainFrame frame = new MainFrame();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setSize(800,600);
          frame.setVisible(true);
     public static void main(String a[])
          createAndShowGUI();
     public void createLogin()
          Login loginobj = new Login();
          loginobj.setVisible(true);
          //itememployee.enable();
          desktop.add(loginobj);
     public void createEmployee()
          Employee employeeobj = new Employee();
          employeeobj.setVisible(true);
          desktop.add(employeeobj);
class Employee 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 Employee()
          super("Employee Details",true,true,true,true);
          setSize(400,300);
          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 Login extends JInternalFrame implements ActionListener,InternalFrameListener
     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;
     MainFrame obj = new MainFrame();
     public Login()
          super("Login",true,true,true,true);
          setSize(300,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");
          okbutton.setMnemonic(KeyEvent.VK_O);
          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);
          this.addInternalFrameListener(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");
          JOptionPane.showMessageDialog(loginframe,"Enter UserName","Alert",JOptionPane.WARNING_MESSAGE);
               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();
                         System.out.println("Enabling itememployee");
                         obj.itememployee.enable();
//hai boy add this line to enable itememployee menu:
itememployee.setEnabled(true);
// i added this line to close/dispose the internal login frame after ok button is pressed
this.dispose();
          catch (IOException e)
               System.err.println("Error writing to file");
     public void actionPerformed(ActionEvent ae)
          String str = ae.getActionCommand();
          if(str.equalsIgnoreCase("OK"))
               try
                    run();
                    loginframe.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
               catch(Exception e)
public void internalFrameClosing(InternalFrameEvent e){
//added this line to again enable login menu if the user closed the login window
               menuitemlogin.setEnabled(true);
public void internalFrameOpened(InternalFrameEvent e) {  }
public void internalFrameIconified(InternalFrameEvent e) {    }
public void internalFrameDeiconified(InternalFrameEvent e) {   }
public void internalFrameActivated(InternalFrameEvent e) {    }
public void internalFrameDeactivated(InternalFrameEvent e) {    }
public void internalFrameClosed(InternalFrameEvent e) {   }
}

Similar Messages

  • Repainting problems of the Menu items in Oracle Help Navigator

    All,
    I am facing a strange problem when using Oracle Help for my application which is developed in Java,Swings.
    Whenever, I open Help for any component through my application, the menu items in the Help screen are not visible. They are not getting repainted. Only when user drags the mouse over the items, they are getting repainted and visible to the user. This has been raised as a bug by our testing people. I couldn't get any help in aspects of any errors/exceptions being logged when the action takes place.
    Where can I have the log files for Help window?
    Can anyone help me and guide me to the right solution in this regards.
    My environ is like this:
    Windows NT, JRE1.4, Oracle Help - ohj-jewt-4_1_16.jar,
    Thanks in advance for all.
    regards,
    Kishore.

    iweb2 navbar is rendered by javascript widget, therefore you can change navbar font style with javascript; this is an efficient way to change navbar font style.
    Copy and paste the following into your pages using HTML Snippet:
    <script type = 'text/javascript'>
    function changeNavbar() {
    navCSS = parent.document.getElementById('widget0-navbar');
    navCSS.style.fontSize = '0.75em'; // font size, change to less than 1em to change font smaller;
    navCSSbg = parent.document.getElementById('widget0-bg');
    navCSSbg.style.textAlign = 'center'; // navbar list alignment;
    clearInterval(chkNavbar);
    chkNavbar = setInterval('changeNavbar()', 500);
    note: You won't see the changes in iweb, but you will see the change when view the pages online - after publishing.

  • Problem while migrating Menu Items to APEX

    Hi,
    I have Migrated a form consisting of some menu items and created an application of the same.
    I am not able to view the page of menu item migrated in my application. Please help me in this and even how to create a menu item in APEX.
    Greetings,
    Ankit

    reproduced and see exception in console, bug logged.
    Edited by: Jade Zhong on Feb 1, 2010 6:10 PM

  • [JS CS3] Why is menu item greyed out?

    Hello,
    I have the following script that works fine on both my Mac and PC. However, I have sent it two other people and both report the same problem that the menu item shows up in the menus but all the options are greyed out.
    I thought it might be a problem of the path but when I deliberately make a wrong path on my computer I get an error message telling me the path does not exist. The two other people get no such message so there may be another problem.
    Tom
    #targetengine session
    if(File.fs == "Windows"){
        var englishCheck = new File( "~/AppData/Roaming/Adobe/InDesign/Version%205.0/Scripts/Scripts%20Panel/Format/formatChec kEnglish.jsx");
        }//end if
    else{
        var englishCheck = new File( "~/Library/Preferences/Adobe%20InDesign/Version%205.0/Scripts/Scripts%20Panel/Format/form atCheckEnglish.jsx");   
    }//end else
    var englishCheckMenu = app.scriptMenuActions.add("Main-English");
    englishCheckMenu.eventListeners.add("onInvoke", englishCheck, false);
    var frenchCheckMenu = app.scriptMenuActions.add("Main-French");
    frenchCheckMenu.eventListeners.add("onInvoke", underConstruct, false);
    var spanishCheckMenu = app.scriptMenuActions.add("Main-Spanish");
    spanishCheckMenu.eventListeners.add("onInvoke", underConstruct, false);
    //following creates menu if it does not exist
    try{
        var scriptMenu = app.menus.item("$ID/Main").submenus.item("PPcheck");
        scriptMenu.title;
    catch (e){
        var scriptMenu = app.menus.item("$ID/Main").submenus.add("PPcheck");
    //following adds sub menu items
    scriptMenu.menuItems.add(englishCheckMenu);
    scriptMenu.menuItems.add(frenchCheckMenu);
    scriptMenu.menuItems.add(spanishCheckMenu);
    //****functions******
    function underConstruct(){
        alert("The French and Spanish semi-automatic checkers are still under construction.");

    sorry for the late reply.. just saw your qn in 2 years time.. ;p
    you need to set "Enable Attached Scripts" to check in the Edit>Preferences>General.
    hope that helps 

  • Setting default browser for Mail's contextual menu items

    I use Firefox as my default browser. In "Safari>General>Default Web Browser" I have it set to Firefox and URL links within Mail trigger Firefox as expected.
    However, if I right-click within an email message on some text and select 'Search in Google' it opens in Safari regardless of the default browser indicated in the Safari preferences.
    Anybody know how to fix this? It's very annoying.
    Dual 2.0 GHz G5   Mac OS X (10.4.8)  

    Hello,
    I have been searching for the cause of this failure, but have not found much. It may relate to some problems with Contextual Menu Items, discussed within the article at the link below, but I do not know for sure:
    http://www.macdevcenter.com/pub/a/mac/2004/05/28/cm_pt1.html
    and may relate to some incompleteness in Firefox, rather than OSX, per se. The contextual menu items are separate from the default preferences, I believe.
    Btw, while I like some aspects of a Google search with Firefox, the fact that PDF links are downloaded, rather than opened in the browser, make me prefer Safari for searches. Perhaps there is a preference to cure this problem, but I have not looked very hard for it.
    Ernie

  • Why does form validation take effect when navigating menu items?

    I am using JDev 10.1.3.3.
    I have a data entry form where all the af:inputField's are set to Required=true. I expected that the mandatory fields should only be enforced if I click the form 's submit button.
    However, when I navigate to another menu item from my menu bar without filling in the fields, the mandatory fields also get enforced (e.g. Required Messages on fields appear and I am forced to have to enter some data on the field before I am able to navigate to another menu item. ) Navigating menu items should imply I am not proceeding with the data entry and should allow me to navigate instantly, even if there are blank fields.
    I notice the SRDemo also had this same behavior. Under "New Service Request", if you don't fill in a description and navigate to another menu item from the menu bar, it will complain and ask you to enter a problem description before switching tabs.
    This is obviosly not the intended behavior. How do I change this behavior so that when I switch menu items, data validation will not take place?

    Hi
    it happens cause the entire page is one form when you try to navigate out what it does is that it submits the form.
    To avoid validation for particular links or buttons set their property immediate to "true"
    hope this helps

  • Problem when trying to add a link to the left menu item!!!!

    Hi everyone,
    I am trying to put a new menu group on the left menu,with a link in that group for every one.On checking with the customization guide this is what i did
    for one link i did add the following lines in each of the files
    1)xlWebAdmin.properties
    - menuGroup.Misc-Menu=Misc Menu
    - menuItem.Misc-Menu.My-Nomination=My Nomination
    2) xlDefaultAdmin.properties
    - menuItem.Misc-Menu.My-Nomination.link=mynomineefrm?showfrm
    3) repacked the war and the ear
    4) Restarted my server
    When I login into the administration(xelsysadm) page I didnt see any menu item with name "My Nomination" which i am supposed to see.
    secondly it shows the menu item when ever i select some group and click on assign menu item.
    Moreover, when I try to assign this menu item to all users group it gives me this error
    On browser it prints
    Permission Denied to Assign Selected Menu Items
    You do not have the permissions to assign one or more selected menu items.
    on console it prints
    ERROR [SERVER] Class/Method: tcDataObj/eventPreInsert Error :Insert
    permission is denied
    ERROR [APIS] Class/Method: tcGroupOperationsBean/addMenuItems encou
    nter some problems: maoRejections:You do not have permission to insert this obje
    ct.
    ERROR [APIS] Class/Method: tcGroupOperationsBean/addMenuItems encou
    nter some problems: Error occurred while adding menu items.
    ERROR [WEBAPP] Class/Method: UserGroupMenuItemsAction/commitGroupAs
    signMenuItems encounter some problems: {1}
    Thor.API.Exceptions.tcBulkException
    This problem eat my happy sunday :-(, any one has solution for this problem?
    - Also if some one can help on how to link jsp to the new link will be helpful for me!
    Thanks,
    doki

    Design Console > Form Information > add new
    Class Name Organizations.Merge
    Description Move users from one organization to another
    Type menuitem
    Add following to xlWebAdmin.properties, xlWebAdmin_en_US.properties
    Organizations.Merge=mergeOrgs.do?Display
    menuItem.Organizations.Merge.link=mergeOrgs.do?MergeOrganizations
    menuItem.Organizations.Merge=Merge
    mergeOrgs.button.display=Merge Organizations
    Even you have to assign first to System Administrator group
    First go to Manage Group
    Select System Administrator Group
    Select Menu Item
    Click Assign and select newly craeted Menu Item and click Confirm
    These are the steps to see the new menu item. To make this menu item working:
    you'll have to write action class, form bean class and you'll have to create JSPs and make their entry in struts-config as welll as in Tiles-def.xml
    Then your menu item will work.

  • Menu Item to run trusted JavaScript problem

    I am trying to add a menu item that runs a script. I converted the script from a batch process and found that I have to make the addWatermarkFromFile a trusted function. I am having problems though. It errors with an internal error has occured. This is what I have:
    app.addSubMenu({ cName: "Specials", cParent:"Tools"});
    app.addMenuItem({ cName: "Convert to CCR", cParent:"Specials", cExec:" ConvertToCCR()"});
    function ConvertToCCR() {var size = this.getPageBox("Media"); if ((size[0] == 0) & (size[1] == 396) & (size[2] == 612) & (size[3] == 0))
    { this.setPageBoxes({cBox: "Media",rBox: [-90,-108,702,504]}); this.setPageBoxes({cBox: "Crop",rBox: [-90,-108,702,504]});
    trustedAddWatermark ({bOnTop:false, cDIPath:"/Macintosh HD/Users/ben/Desktop/Acrobat Reference PDF's/Copy Change Request Half.pdf"});
    var inch = 72;
    for (var p = 0; p < this.numPages; p++) {
    // position rectangle
    var aRect = this.getPageBox( {nPage: p} );
    aRect[0] += 7.08*inch; // from upper left hand corner of page.
    aRect[2] = aRect[0]+1.18*inch; // Make it 1.38 inch wide
    aRect[1] = 1.05*inch;
    aRect[3] = aRect[1] - 24; // and 25 points high
    // now construct text field
    var f = this.addField("Month 1", "text", p, aRect )
    f.borderStyle = border.s;
    f.alignment = "center";
    f.textSize = 14;
    f.textColor = color.black;
    var cRect = this.getPageBox( {nPage: p} );
    cRect[0] += 7.08*inch; // from upper left hand corner of page.
    cRect[2] = cRect[0]+1.18*inch; // Make it 1.38 inch wide
    cRect[1] = .72*inch;
    cRect[3] = aRect[1] - 46; // and 45 points high
    // now construct text field
    var f = this.addField("Month 1 Exp", "text", p, cRect )
    f.borderStyle = border.s;
    f.alignment = "center";
    f.textSize = 14;
    f.textColor = color.black;
    var f = this.getField("Month 1"); // get the Field Object
    var myRect = f.rect; // and get its rectangle
    // make needed coordinate adjustments for new field
    myRect[0] = f.rect[2]+.32*inch; // the ulx for new = lrx for old
    myRect[2] = myRect[0]+1.18*inch; // move two inches for lry
    f = this.addField("Month 2", "text", p, myRect);
    f.borderStyle = border.s;
    f.alignment = "center";
    f.textSize = 14;
    f.textColor = color.black;
    var f = this.getField("Month 1 Exp"); // get the Field Object
    var myRect = f.rect; // and get its rectangle
    // make needed coordinate adjustments for new field
    myRect[0] = f.rect[2]+.32*inch; // the ulx for new = lrx for old
    myRect[2] = myRect[0]+1.18*inch; // move two inches for lry
    f = this.addField("Month 2 Exp", "text", p, myRect);
    f.borderStyle = border.s;
    f.alignment = "center";
    f.textSize = 14;
    f.textColor = color.black;
    var bRect = this.getPageBox( {nPage: p} );
    bRect[0] += 6.08*inch; // from upper left hand corner of page.
    bRect[2] = bRect[0]+.69*inch; // Make it .68 inch wide
    bRect[1] = .72*inch;
    bRect[3] = cRect[1] - 22; // and 22 points high
    // now construct text field
    var f = this.addField("Rep", "text", p, bRect )
    f.borderStyle = border.s;
    f.alignment = "center";
    f.textSize = 14;
    f.textColor = color.black;}
    Then I also have another file called "trustedAddWatermark"
    trustedAddWatermark = app.trustedFunction( function (bOnTop, cDIPath) {
    app.beginPriv();
    this.addWatermarkFromFile ({bOnTop: false, cDIPath: "/Macintosh HD/Users/ben/Desktop/Acrobat Reference PDF's/Copy Change Request Half.pdf"});
    app.endPriv();
    Then I get the error in the JS console when it is run:
    TypeError: this.addWatermarkFromFile is not a function
    3:Folder-Level:User:trustedAddWatermark.js
    The thing that I don't get is if I put the 1st script in a button using the Form tools it works fine but I can't get it to work as a menu item. Where am I going wrong???

    The first example I found was Ted Padova's goNext function:
    function goNext(oItem, oEvent, cName) {
    try{ // error catcher
    AFNumber_Keystroke(0, 0, 0, 0, "",true);
    if (oEvent.rc && AFMergeChange(oEvent).length == oEvent.target.charLimit)
    oItem.getField(cName).setFocus();
    } catch(eMsg) { // trap error display error message, field in and next field
    app.beep(3); // beep
    console.println("Error: " + eMsg + "\nField: " + oEvent.target.name + "\nNext Field: " + cName);
    } finally { // always run
    return; }
    } //end // goNext
    // call the goNext function in the field's format custom keystroke
    goNext(this, event,"NextField");

  • Javascript menu items problem.

    Hi,
    We have created a cutom iview which logs the user into a PHP web application. The login works fine. If we make the iview to appear in a new window, i can see all the menu items (coded in javscript) along with the other information on the webpage. On the other hand if we make the iview to appear in the content area of the portal, we see everything except the menu items.
    can anyone tell me what could be the problem. we have tried a lot of options but the result is still the same.
    Thanks in advance.
    Regards
    Hassan

    Hi Hassan,
    maybe you should change the iView's Isolation Method to URL
    hope it helps,
    Yoav
    Message was edited by: Yoav Toussia Cohen

  • 30EA2 problem: Menu items not available

    After having used Data Modeler 30EA2 successfully for a while, suddenly several menu items are missing.
    E.g. in my File menu "Open" is not shown (in fact only "Save", "Save as", "Compare With" and "Exit" is shown). This clearly makes the modeler unusable, as I cannot open my models!
    The problem continues even after I download the product (Product Version: 3.0.0.653) from OTN, unzip in a new location and use that.
    Any suggestions?
    -- Peter

    Hi Peter.
    please try removing (or renaming the folder called .oraclesqldeveloperdatamodeler in C:\Documents and Settings\<YOUR_WINDOWS_USER>)
    This is a folder where the datamodeler IDE caches are stored.
    Hope that helps,
    Ivaylo

  • External USB Hard Drive causes menu problem - menu items flash

    Greetings:
    I have a external USB hard drive (250 GB) that is partitioned into 3 hard drives. Two hard drives are formatted in MacOS standard and one is formatted in MacOS extended. I had to reformat the last drive in MacOS extended because the Macbook would not let me edit files on the drive.
    The problem is that when I connect to the drives, the menu malfunctions (I cannot see the date and time and the menu items flash). Dismounting the drives solves the problem.
    Do I need to reformat the hard drives? Or do I need a new USB drive?
    Thank you.
    EA

    Hmm, someone else had a similar problem.  Note the ":: Loading root filesystem module...-e" line.  That "-e" shouldn't be there.  It should be, instead, the module for the filesystem.
    As a workaround for right now, you can add your filesystem module to the MODULES array, and remove the "filesystems" hook.
    In that case, you'll probably want rootdelay=* to allow the drive some time to settle, and rootfstype=* to speed up filesystem detection while in kinit.
    By the way, what filesystem do you have on that machine?  Can you tell me what
    /usr/lib/klibc/bin/fstype < /dev/sda1
    outputs on a running system (you may need to be root, or add yourself to the "disk" group or something similar) - /dev/sda1 should be replaced if the usb drive is not sda1

  • DW menu item font problems Snow Leopard

    I am having a problem in Dreamweaver with the font used for menu items. Out of PS, Fireworks, and Dreamweaver this is the only Adobe program where this problem is evident. I have tried many resolutions on the computer such as clearing font casche, diabling fonts, changing font charastics within DW, installing the latest PS font patch from apple, etc. If anyone has anything I can try to resolve this problem I would appreaciate it.

    I've been using Lion since it's release, it's fine.  Don't know what's holding you back.
    Did you take a higher res screenshot and run it through what the font?  From a glance I'm guessing at Conceilian outline, White Wolf.  And upgrading won't solve this problem because the font will still reside on the system.  An OS upgrade does not remove your custom fonts. It's going to be a process but you might just have to go through every outline font on your system.

  • Actobat 9 Execute Menu Item problem

    I have a new PC with Window 7 and have successfully loaded Acrobat 9 pro - but a lot of the Acrobat functionality is now missing (it all worked under the XP platform). For example, when creating a form, using a buttom with an 'Execute menu item' command is not possible - it's blank actually. As this is the most useful tool within Acrobat forms it's really annoying. I have upgraded to 9.4.1 which is supposed to be Window 7 compatible but no luck. I've unistalled and reinstalled and called Adobe support (4 hours!) and still no solution.
    Can anyone help me?

    After selecting this action you're supposed to go to the actual menus and
    select the menu item that should be executed. This is instead of choosing it
    from a list. Did you try that?

  • Menu item stroke problems

    I am unable to add a right aligned stroke on the word 'Snowdon Super Cup' because the border cuts across the word 'Cup'. (the stroke appears where the word 'Cup' starts)
    How to I extend the border area in order for the menu item 'Snowdon Super Cup' to fit within the correct boundaries?

    Hello,
    Please confirm are you using Manual menu here?
    If yes, please select the label "Snowdon Super Cup" by clicking on it twice and stretch the text box.
    You can also clock on the tiny white arrow in blue circle at the top right corner, and in widget properties, change the "Item size" drop down to uniform size or uniform spacing.
    Hope this helps.
    Regards,
    Sachin

  • Option / Menu items render smaller 12 points in Chinese font problem

    Doesn't anyone experience when JVM SWING render Chinese Font smaller than
    12 points (say 9 points) very ugly in label, ...etc. Just not similar to Windows' one.
    How to config it to work properly?
    I find that menu items / option items both are rendered ugly in Star office
    application / OpenOffice.

    Hi,
    unfortunatly you cannot change the properties of Action object as you would do with JavaBeans. Instead you have to use the 'put' method.
    eg.:
    myAction.put(Action.SMALL_ICON, new ImageIcon(...));IMHO this was a bad decision, because it's not like the JavaBeans standard and you loose static type information. :-/
    -Puce
    Message was edited by:
    Puce

Maybe you are looking for