JMenuItem Problems ?

hi,i got problems,i cannot view the JMenuItem ?what's wrong ?
satu.java
import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
public class satu {
      * @param args
     public static void main(String[] args) {
          // TODO Auto-generated method stub
          JFrame.setDefaultLookAndFeelDecorated(true);
          final JFrame appp = new JFrame("TEST ");
          appp.setSize(150,180);
          appp.setUndecorated(true);
          appp.setResizable(false);
          testmenu m = new testmenu();
          appp.setJMenuBar(m.createbar());
          appp.setContentPane(m.createContentPane());
          m.start();
          appp.setSize(540,430);
          //dua m = new dua(appp);
        //m.init();
          //TestHeaderRenderer m = new TestHeaderRenderer();
          appp.add(m,BorderLayout.CENTER);   
         appp.setVisible(true);
         //appp.setLocationRelativeTo(null);
          appp.addWindowListener(new WindowAdapter() {
                       public void windowClosing(WindowEvent evt) {
                      appp.setVisible(false);
                      appp.dispose();
}testmenu.java
import java.awt.Color;
import java.awt.Container;
import java.awt.Graphics;
import java.awt.Panel;
import java.awt.event.KeyEvent;
import java.applet.*;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
public class testmenu extends Applet {
     String sessionid,usersession;
     JMenuItem menuout;
    Panel contentPane;
    public JMenuBar createbar(){
          JMenuBar menu1 = new JMenuBar();
          JMenu menustart = new JMenu("File");
          menustart.setMnemonic(KeyEvent.VK_F);
        JMenu menutool = new JMenu("Tools");
        menutool.setMnemonic(KeyEvent.VK_T);
          menuout = new JMenuItem("New");
          menustart.add(menuout);
          menu1.add(menustart);
          menu1.add(menutool);
          return menu1;
     public Container createContentPane() {
          contentPane = new Panel();
          contentPane.setBackground(Color.BLACK);
        gbrutama x = new gbrutama();
        contentPane.add(x);
        return contentPane;
class gbrutama extends Applet{
   public gbrutama() {
   public void paintComponent(Graphics g){
    g.drawLine(0,0,200,200);
}when i click on menu "File",why i cannot view "New" JMenuItem ?Please someone help me,please...
thanks.

for your old code it worked :Check it
import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import java.awt.Color;
import java.awt.Container;
import java.awt.Graphics;
import java.awt.Panel;
import java.awt.event.KeyEvent;
import java.applet.*;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
public class satu {
      * @param args
     public static void main(String[] args) {
          // TODO Auto-generated method stub
          JFrame.setDefaultLookAndFeelDecorated(true);
          final JFrame appp = new JFrame("TEST ");
          appp.setSize(150,180);
          appp.setUndecorated(true);
          appp.setResizable(false);
          testmenu m = new testmenu();
          appp.setJMenuBar(m.createbar());
          appp.setContentPane(m.createContentPane());
          m.start();
          appp.setSize(540,430);
          //dua m = new dua(appp);
        //m.init();
          //TestHeaderRenderer m = new TestHeaderRenderer();
          appp.add(m,BorderLayout.CENTER);
         appp.setVisible(true);
         //appp.setLocationRelativeTo(null);
          appp.addWindowListener(new WindowAdapter() {
                       public void windowClosing(WindowEvent evt) {
                      appp.setVisible(false);
                      appp.dispose();
//testmenu.java
class testmenu extends Applet {
     String sessionid,usersession;
     JMenuItem menuout;
    javax.swing.JPanel contentPane;
    public JMenuBar createbar(){
          JMenuBar menu1 = new JMenuBar();
          JMenu menustart = new JMenu("File");
          menustart.setMnemonic(KeyEvent.VK_F);
        JMenu menutool = new JMenu("Tools");
        menutool.setMnemonic(KeyEvent.VK_T);
          menuout = new JMenuItem("New");
          menustart.add(menuout);
          menu1.add(menustart);
          menu1.add(menutool);
          return menu1;
     public Container createContentPane() {
          contentPane = new javax.swing.JPanel();
          contentPane.setOpaque(true);
          contentPane.setBackground(Color.BLACK);
        gbrutama x = new gbrutama();
        contentPane.add(x);
        return contentPane;
class gbrutama extends Applet{
   public gbrutama() {
   public void paintComponent(Graphics g){
    g.drawLine(0,0,200,200);
}wait let me see your new modified code...

Similar Messages

  • InternalFrameListener and JMenuItem problem

    Hi there, I did the following (just an outline, I know, that program is not working.... :))
    class A{
    static JMenuItem m_saveMenu;
    A(){
    JMenuBar mB = new JMenuBar();
    m_saveMenu = new JMenuItem("Save As...");
    class B{
    JInternalFrame iFrame = new JInternalFrame();
    iFrame.addInternalFrameListener(new MyListener());
    class MyListener extends InternalFrameAdapter{
         public void internalFrameActivated (InternalFrameEvent e){
              A.m_saveMenu.setEnabled(true);     }
         public void internalFrameDeactivated(InternalFrameEvent e){
    A.m_saveMenu.setEnabled(false);
    So if I (in my working program) create a new JInternalFrame and activate it I get the following error message:
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    why could that be??
    Thx
    Charly

    hi,
    I mean this is obvious: You didn't initialize the menu item, you just declared it! And the listener might be used before the constructor of class A is called.
    You could do the following now:
    static JMenuItem m_saveMenu=new JMenuItem("Save As...");
    unless you are sure that the constructor of class A and with it the initialization of the menu item goes ahead.
    best regards, Michael

  • JMenuItem.setIcon problem

    When I create a JMenuItem and add an icon, the menu item text is greyed out (it's not disabled). When I remove the setIcon, the text appears normally. This is L&F independent.
    I've tried various things to force the foreground color to black, but nothing works.
    I'm using JRE 1.4.2_04.
    Any suggestions?
    Thanks
    Ross

    Now that I think about it, I remember that there are quite a few problems with setting button background colors due to conflicts with Windows desktop styles and the native button code. I assume that's involved here since JMenuItems are buttons.
    However, in this particular case, I'm not trying to set any colors, just setting an icon. Why wouldn't that work?

  • JMenuItem ActionEvent Dinamically - Problems

    Hi, friends
    I am trying to use a JMenu and a JMenuItem wich are dinamicaly
    constructed getting data using a Oracle's Database Table.
    They are working fine, but I can't figured out how can I add
    ActionEvent dinamicaly. The piece of my code is down here:
    JMenuBar menuOpcao = new JMenuBar;
    JMenu menu[] = new JMenu[5];
    JMenuItem submenu[] = new JMenuItem[20];
    for (x=0;x<menu.lenght;x++)
    menu[x] = new JMenu();
    menu[x].setLabel(" menu " + x); //menu 1, menu 2...
    for (y=0;y<submenu.lenght;y++)
    submenu[y] = new JMenuItem();
    submenu[y].setLabel(" submenu " + y); // submenu 1...
    submenu[y].addActionListener(new ActionListener()
    { public void actionPerformed(ActionEvent e){
    System.out.println(e);}
    menu[x].add(submenu[y];
    menuOpcao.add(menu[x]);
    My problem: the ActionEvent is not working, because I need know
    wich Item I am clicking, so I can execute a query in a Database.
    Any Ideas?
    Thank you.
    null

    You don't use MouseListeners. You use ActionListeners.
    Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html]How to Use Menus for working examples.

  • JMenuItem painting Problem

    Hi,
    I have painting problem with adding the JMenuItems dynamically. In the screen1 figure shown below, Menu 2 has has total 10 items, but initially we will show only three items. When the user clicks on the menu item ">>" all the Ten Items in Menu 2 are shown. But, All the 10 items are inserted in a compressed manner as shown in screen 2. When i click on the Menu 2 again, is shows properly as shown in screen 3.
    screen 1:
    <img src="http://img.photobucket.com/albums/v652/petz/Technical/screen1.jpg" border="0" alt="Screen 1"/>
    screen 2:
    <img src="http://img.photobucket.com/albums/v652/petz/Technical/screen2.jpg" border="0" alt="Screen 2"/>
    screen 3:
    <img src="http://img.photobucket.com/albums/v652/petz/Technical/screen3.jpg" border="0" alt="Screen 3"/>
    Here is the code:
    import java.awt.GridLayout;
    import java.awt.event.KeyEvent;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import javax.swing.JFrame;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    public class MenuUI implements MouseListener
        JFrame frame;
        JMenuBar menubar;
        JMenu menu1,menu2;
        JMenuItem menuItem;
        JMenuItem lastMenuItem;
        String MENU1_ITEMS[] = {"ONE","TWO","THREE","FOUR","FIVE"};
        String MENU2_ITEMS[] = {"ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE","TEN"};
        int MIN_MENU = 3;
        public MenuUI()
            menubar = new JMenuBar();
            /*menu1 = new JMenu("Menu 1");
            menu1.setMnemonic(KeyEvent.VK_1);
            menu1.getPopupMenu().setLayout(new GridLayout(5,1));
            menu2 = new JMenu("Menu 2");
            menu2.setMnemonic(KeyEvent.VK_2);
            menu2.getPopupMenu().setLayout(new GridLayout(5,2));*/
            menu1 = new JMenu("Menu 1");
            menu1.setMnemonic(KeyEvent.VK_1);
            menu2 = new JMenu("Menu 2");
            menu2.setMnemonic(KeyEvent.VK_2);
            menubar.add(menu1);
            menubar.add(menu2);
            createMinMenuItems();
            frame = new JFrame("MenuDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setJMenuBar(menubar);
            frame.setSize(500, 300);
            frame.setVisible(true);
        public void createMinMenuItems()
            for (int i = 0; i < MIN_MENU; i++)
                menuItem = new JMenuItem(MENU1_ITEMS);
    menu1.add(menuItem);
    lastMenuItem = new JMenuItem(">>");
    lastMenuItem.addMouseListener(this);
    menu1.add(lastMenuItem);
    for (int i = 0; i < MIN_MENU; i++)
    menuItem = new JMenuItem(MENU2_ITEMS[i]);
    menu2.add(menuItem);
    lastMenuItem = new JMenuItem(">>");
    lastMenuItem.addMouseListener(this);
    menu2.add(lastMenuItem);
    private void showAllMenuItems(int menuNo)
    if(menuNo == 1)
    menu1.remove(MIN_MENU);
    for (int i = MIN_MENU; i < MENU1_ITEMS.length; i++)
    menuItem = new JMenuItem(MENU1_ITEMS[i]);
    menu1.add(menuItem);
    menu1.updateUI();
    else if(menuNo == 2)
    menu2.removeAll();
    menu2.getPopupMenu().setLayout(new GridLayout((MENU2_ITEMS.length),1));
    for (int i = 0; i < MENU2_ITEMS.length; i++)
    menuItem = new JMenuItem(MENU2_ITEMS[i]);
    //menuItem.setMinimumSize(new Dimension(35,20));
    menu2.add(menuItem);
    menu2.updateUI();
    //menu2.getPopupMenu().invalidate();
    //menu2.getPopupMenu().repaint();
    //menubar.repaint();
    //menubar.invalidate();
    //menubar.getParent().repaint();
    /* (non-Javadoc)
    * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
    public void mousePressed(MouseEvent arg0)
    System.out.println("mousePressed: Menu 1 selected: "+menu1.isSelected());
    System.out.println("mousePressed: Menu 2 selected: "+menu2.isSelected());
    if(menu1.isSelected())
    System.out.println("mousePressed: Menu 1: Show All Items");
    showAllMenuItems(1);
    else if(menu2.isSelected())
    System.out.println("mousePressed: Menu 2: Show All Items");
    showAllMenuItems(2);
    /* (non-Javadoc)
    * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
    public void mouseClicked(MouseEvent evt)
    /* (non-Javadoc)
    * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
    public void mouseEntered(MouseEvent arg0)
    /* (non-Javadoc)
    * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
    public void mouseExited(MouseEvent arg0)
    /* (non-Javadoc)
    * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
    public void mouseReleased(MouseEvent arg0)
    public static void main(String[] args)
    MenuUI ui = new MenuUI();

    // menu2.updateUI();
    menu2.getPopupMenu().setVisible(false);
    menu2.getPopupMenu().setVisible(true);

  • JPopupMenu/JMenuItem sizing problem

    Hi All,
    I have a JPopupMenu that is displayed when a right-click takes place. The popup menu should display three JMenuItems when a vertex is right-clicked and one menu item when an edge is right-clicked. However, when I right-click a vertex, only two menu items are visible, and when I right-click an edge, zero menu items are visible (the popup menu appears, but it is so small that I can't see the menu item).
    Here is the relevant code:
              protected void handlePopup(MouseEvent me) {
                final VisualizationViewer vv = (VisualizationViewer)me.getSource();
                Point2D p = vv.inverseViewTransform(me.getPoint());
                PickSupport pickSupport = vv.getPickSupport();
                if(pickSupport != null) {
                    Vertex v = pickSupport.getVertex(p.getX(), p.getY());
                    Edge e = pickSupport.getEdge(p.getX(), p.getY());
                    if((v != null) && (v instanceof BrokerVertex)) {                 
                         JPopupMenu popup = new JPopupMenu();
                        JMenuItem m_SetAdvMenuItem = new JMenuItem(MonitorResources.M_SET_ADV);
                        m_SetAdvMenuItem.addActionListener(m_MonitorFrame);
                        popup.add(m_SetAdvMenuItem);
                        JMenuItem m_centerVertex = new JMenuItem("Center Vertex");
                        m_centerVertex.setAction(new CenterAction(m_graph.getLayout().getLocation(v)));
                        popup.add(m_centerVertex);
                        JMenuItem m_SetSubMenuItem = new JMenuItem(MonitorResources.M_SET_SUB);
                        m_SetSubMenuItem.addActionListener(m_MonitorFrame);
                        popup.add(m_SetSubMenuItem);
                        popup.show(vv, me.getX(), me.getY());
                        popup.pack();
                    } else if ((e != null) && (e instanceof MonitorEdge)) {
                         MonitorEdge mEdge = (MonitorEdge) e;
                         JPopupMenu popup = new JPopupMenu();
                         boolean activationCountDisplayStatus = mEdge.activationCountIsDisplayed();
                         String activationCountToggleMessage;
                         if (activationCountDisplayStatus) {
                              activationCountToggleMessage = "Hide Message Counter";
                         } else {
                              activationCountToggleMessage = "Show Message Counter";
                        JMenuItem m_activationCountMenuItem = new JMenuItem(activationCountToggleMessage);
                        m_activationCountMenuItem.setAction(new ToggleEdgeActivationCountMessageAction(mEdge));
                        popup.add(m_activationCountMenuItem);
                        popup.show(vv, me.getX(), me.getY());
                        popup.pack();
              }The problem is with the JMenuItems that use setAction instead of addActionListener (m_centerVertex and m_activationCountMenuItem). These two JMenuItems are in the popup menu list, but the popup menu is not large enough for me to see the labels given to m_centerVertex and m_activationCountMenuItem.
    Anyone know what I'm doing wrong?
    m_SetAdvMenuItem and m_SetSubMenuItem display correctly. It's as if the height of m_centerVertex and m_activationCountMenuItem are set at a value of 0 but the heights of the other two JMenuItems are the correct height.
    Message was edited by:
    themiddle

    Did you set a name value in your Actions? The name value will be used to set the text. If its null that may account for the small size of the menu item.
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

  • Problems adding JMenuItem-s

    Hello!
    I have encountered a problem and I don't know where my JMenuItem-s disappear. The output for the next program:
    public class test {
    public test() {
    public static void main(String[] args) {
    JPanel panel = new JPanel();
    JMenu menu = new JMenu("Meniu");
    JMenuItem item1 = new JMenuItem("1");
    JMenuItem item2 = new JMenuItem("2");
    menu.add(item1);
    menu.add(item2);
    System.out.println("The menu has "+menu.getItemCount()+" item(s).");
    JMenuItem item3 = menu.getItem(0);
    System.out.println("The menu has "+menu.getItemCount()+" item(s).");
    panel.add(item3);
    System.out.println("The menu has "+menu.getItemCount()+" item(s).");
    is:
    The menu has 2 item(s).
    The menu has 2 item(s).
    The menu has 1 item(s).
    Shouldn't it be 2-2-2? One of my items is gone. Can you tell me what can I do? Thanks.

    The problem is (I think, somebody correct me if I'm mistaken), you're taking the first item in your menu and adding it to the panel. A Component can only be a child of one thing at a time, so adding that first item to the panel removes it from the menu.

  • Problem with JMenuItem, method isArmed()

    Hi everybody,
    I want hide my menu when I "open" it and click in another part of the application.
    it did not work when I made the verification using the method isArmed() in JMenuItem.
    I added a mouseListener in my JPanel, that is located below my JMenuBar. In mouseClicked(), i do the verification like this:
    public void mouseClicked(MouseEvent mouseevent) {
              int contador = ViewFacade.getViewFacade().getMenuBar().getMenuCount();
              for (int i = 0; i < contador; i++){
                   JMenu myMenu = (JMenu)ViewFacade.getViewFacade().getMenuBar().getMenu(i);
                   for (Component itensMenu : myMenu.getMenuComponents()){
                        if (itensMenu instanceof JMenu){
                             if (((JMenu)itensMenu).isArmed()){
                                  ((JMenu)itensMenu).setArmed(false);
                        }else if (itensMenu instanceof JMenuItem){
                             if (((JMenuItem)itensMenu).isArmed()){
                                  ((JMenuItem)itensMenu).setArmed(false);
    But it did not work. Even when my JMenu is "armed", it doesn't work.
    Can anybody give me a hint??
    thanks, Guilherme

    Don't understand what you are doing playing with the isArmed() method. A JMenu will automatically disappear when you click on another part of your application, so no custom code is required.
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the posted code retains its original formatting.

  • Problems with event handling in JmenuItem

    Hello:
    I'm trying to handle an event for a menuItem and tool bar item: with this code:
    newBallotAction = new AbstractAction("newBallot")
    public void actionPerformed(ActionEvent e)
    try{
    System.out.println("MainWindow newBallotAction");
    Ballot ballot = new Ballot();
    System.out.println("MainWindow newBallotAction 2nd");
    DDNewBallotWindow ddNewBallotWindow = new DDNewBallotWindow(ballot);
    if (ballot != null) // <ballotName>, <ballotOptionsNumber> , <ballotOption1>, <ballotOption2>, .., <ballotOption(optionsNumber)>
    brothers.msgToBrothers("<Ballot>" + "<origin>" + myName + "</origin>"+ ballot.toRep() +"</Ballot>" , myName);
    else
    System.out.println("MainWindow ballot null");
    }catch(Exception f){
    System.out.println("MainWindow newBallotAction exception" + e);
    JMenuItem ballotMIDdMenu = new JMenuItem("New Ballot");
    ballotMIDdMenu = fileMenu.add(newBallotAction);
    ddMenu.add(ballotMIDdMenu);
    It produces the next exception:
    MainWindow newBallotAction exceptionjava.awt.event.ActionEvent[ACTION_PERFORMED,cmd=newBallot] on javax.swing.JMenu$2[,1,49,137x21,alignmentX=null,alignmentY=null,border=javax.swing.plaf.metal.MetalBorders$MenuItemBorder@55a338,flags=264,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=2,bottom=2,right=2],paintBorder=true,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=newBallot]
    It's really complex ... I'm desperado ;)
    Thanks in advance, Nacho.

    Hi,
    The exception is propably occuring in the Ballot() constructor (which you didn't post).
    And, as dukeman already mentionned, you are printing out the ActionEvent object and not the Exception itself.

  • JMenuItem and MouseListener Problems

    I add the MouseListener to the JMenu, the event works.
    but when I add the MouseListener to the JMenuItem, it didn't work?
    why?
    the following is my code:                         jMenuItemRelogin = new JMenuItem();
                             jMenuLogin.add(jMenuItemRelogin);
                             jMenuItemRelogin.setText("Relogin");
                             jMenuItemRelogin.addMouseListener(new MouseAdapter(){
                                  public void mouseClicked(MouseEvent evt){
                                       reloginMouseClicked(evt);
                             });

    You don't use MouseListeners. You use ActionListeners.
    Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html]How to Use Menus for working examples.

  • Problems with JMenuItem

    I want my menuitem to show the text "New(N) Ctrl+N",and when i press the combination key ctrl and N the system will create an Event,which has the same effect with I click the menuitem.
    My code is:
               javax.swing.KeyStroke stroke;
               int event=java.awt.event.KeyEvent.VK_N;
               int inputEvent=java.awt.event.InputEvent.CTRL_DOWN_MASK;
               stroke=javax.swing.KeyStroke.getKeyStroke(event, inputEvent);
               jMenuItemNew.setAccelerator(stroke);
               but when i press the combination key Ctrl and N,there is no response.
    Did i do wrong?
    Any suggestions would be welcom!
    thanks in advance!

    I want my menuitem to show as"New(N) " and there is an underline under the second letter N.my code is:
    jMenuItemNew.setMnemonic(java.awt.event.KeyEvent.VK_N);when i press the combination key Alt and N,it has the same effect wih I click the menuitem.But how can i let it show as "New(N) " with a line under the second letter N.
    thanks!

  • Disabled JMenuItem doesn show animated gif

    Hi there
    I would like to have a popup menu with actions that are enabled after they have finished with some background task taking some time. Basically this works fine for the enabling action on a shown popup. However, adding an animated gif as the icon or disabled icon does not show it in disabled state. In enabled state it works perfect. Please have a try with the sample code. You should see the disabled item for 2 secs and the icon is not showing up. After being enabled, it does. Invoking the menu again shows the animated gif in its last state left, but not moving any more.
    I guess, repaints are not done appropriately in disabled state... Any ideas how to solve that would be highly appreciated :-)
    Actually I used the icon at http://mentalized.net/activity-indicators/indicators/pascal_germroth/indicator.white.gif
    Cheers
    Daniel
    public class Main
      public static void main(String[] args)
        final JFrame frame = new JFrame();
        frame.addMouseListener(new MouseAdapter()
          public void mousePressed(final MouseEvent e)
            final JPopupMenu popup = new JPopupMenu();
            popup.add(new JMenuItem("Open..."));
            popup.add(new JMenuItem("Close"));
            final JMenuItem action = new JMenuItem("Long loading until enabled");
            action.setIcon(new ImageIcon("C:/spinner.gif"));
            action.setDisabledIcon(new ImageIcon("C:/spinner.gif"));
            popup.add(action).setEnabled(false);
            popup.show(e.getComponent(), e.getX(), e.getY());
            SwingUtilities.invokeLater(new Runnable()
              public void run()
                try
                  Thread.sleep(2000);
                  action.setEnabled(true);
                catch (InterruptedException e1)
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(300, 200);
        frame.setVisible(true);
    }Edited by: daniel.frey on Apr 22, 2009 7:50 AM

    The problem is that you are causing the EDT to sleep, which means the GUI can't repaint itself. Read the section from the Swing tutorial on Concurrency to understand what is happening.

  • MDI JTable Overlap Area Repaint Problem

    Hi all,
    I have a problem for my application in MDI mode.
    I open many windows (JInternalFrame contain JTable) under JDesktopPane. Some of the windows are overlapping and when they receive update in the table, it seems repaint all of the overlapping windows, not only itself. This make my application performance become poor, slow respond for drap & drop an existing window or open a new window.
    To prove this, i make a simple example for open many simple table and have a thread to update the table's value for every 200 mill second. After i open about 20 windows, the performance become poor again.
    If anyone face the same problem with me and any suggestions to solve the problem ?
    Please help !!!!!
    Following are my sources:
    public class TestMDI extends JFrame {
        private static final long serialVersionUID = 1L;
        private JPanel contentPanel;
        private JDesktopPane desktopPane;
        private JMenuBar menuBar;
        private List<TestPanel> allScreens = new ArrayList<TestPanel>();
        private List<JDialog> freeFloatDialogs = new ArrayList<JDialog>();
        private List<JInternalFrame> mdiInternalFrm = new ArrayList<JInternalFrame>();
        int x = 0;
        int y = 0;
        int index = 0;
        private static int MDI_MODE = 0;
        private static int FREE_FLOAT_MODE = 1;
        private int windowMode = MDI_MODE;
        public TestMDI() {
            init();
        public static void main(String[] args) {
            new TestMDI().show();
        public void init() {
            contentPanel = new JPanel();
            desktopPane = new JDesktopPane();
            desktopPane.setDragMode(JDesktopPane.LIVE_DRAG_MODE);
            desktopPane.setFocusTraversalKeysEnabled(false);
            desktopPane.setFocusTraversalPolicyProvider(false);
            desktopPane.setBorder(null);
            desktopPane.setIgnoreRepaint(true);
            desktopPane.setPreferredSize(new Dimension(1000, 800));
            this.setSize(new Dimension(1000, 800));
            menuBar = new JMenuBar();
            JMenu menu1 = new JMenu("Test");
            JMenuItem menuItem1 = new JMenuItem("Open Lable Screen");
            menuItem1.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    for (int i = 1; i < 4; i++) {
                        final TestJLableScreen screen = new TestJLableScreen("Screen  " + (allScreens.size() + 1));
                        screen.startTime();
                        if (windowMode == MDI_MODE) {
                            JInternalFrame frame = createInternalFram(screen);
                            desktopPane.add(frame);
                            mdiInternalFrm.add(frame);
                            if (allScreens.size() * 60 + 100 < 1000) {
                                x = allScreens.size() * 60;
                                y = 60;
                            } else {
                                x = 60 * index;
                                y = 120;
                                index++;
                            frame.setLocation(x, y);
                            frame.setVisible(true);
                        } else {
                            JDialog dialog = createJDialog(screen);
                            freeFloatDialogs.add(dialog);
                            if (i * 60 + 100 < 1000) {
                                x = i * 60;
                                y = 60;
                            } else {
                                x = 60 * index;
                                y = 120;
                                index++;
                            dialog.setLocation(x, y);
                            dialog.setVisible(true);
                        allScreens.add(screen);
            JMenuItem menuItem2 = new JMenuItem("Open Table Screen");
            menuItem2.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    for (int i = 1; i < 4; i++) {
                        TestTableScreen screen = new TestTableScreen("Screen  " + (allScreens.size() + 1));
                        screen.startTime();
                        if (windowMode == MDI_MODE) {
                            JInternalFrame frame = createInternalFram(screen);
                            desktopPane.add(frame);
                            mdiInternalFrm.add(frame);
                            if (allScreens.size() * 60 + 100 < 1000) {
                                x = allScreens.size() * 60;
                                y = 60;
                            } else {
                                x = 60 * index;
                                y = 120;
                                index++;
                            frame.setLocation(x, y);
                            frame.setVisible(true);
                        } else {
                            JDialog dialog = createJDialog(screen);
                            freeFloatDialogs.add(dialog);
                            if (i * 60 + 100 < 1000) {
                                x = i * 60;
                                y = 60;
                            } else {
                                x = 60 * index;
                                y = 120;
                                index++;
                            dialog.setLocation(x, y);
                            dialog.setVisible(true);
                        allScreens.add(screen);
            menu1.add(menuItem1);
            menu1.add(menuItem2);
            this.setJMenuBar(menuBar);
            this.getJMenuBar().add(menu1);
            this.getJMenuBar().add(createSwitchMenu());
            this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            this.add(desktopPane);
            desktopPane.setDesktopManager(null);
        public JInternalFrame createInternalFram(final TestPanel panel) {
            final CustomeInternalFrame internalFrame = new CustomeInternalFrame(panel.getTitle(), true, true, true, true) {
                public void doDefaultCloseAction() {
                    super.doDefaultCloseAction();
                    allScreens.remove(panel);
            internalFrame.setPanel(panel);
            // internalFrame.setOpaque(false);
            internalFrame.setSize(new Dimension(1010, 445));
            internalFrame.add(panel);
            internalFrame.setFocusTraversalKeysEnabled(false);
            internalFrame.setFocusTraversalPolicyProvider(false);
            desktopPane.getDesktopManager();
            // internalFrame.setFocusTraversalKeysEnabled(false);
            internalFrame.setIgnoreRepaint(true);
            return internalFrame;
        public JDialog createJDialog(final TestPanel panel) {
            JDialog dialog = new JDialog(this, panel.getTitle());
            dialog.setSize(new Dimension(1010, 445));
            dialog.add(panel);
            dialog.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    allScreens.remove(panel);
            return dialog;
        public JMenu createSwitchMenu() {
            JMenu menu = new JMenu("Test2");
            JMenuItem menuItem1 = new JMenuItem("Switch FreeFloat");
            menuItem1.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    windowMode = FREE_FLOAT_MODE;
                    for (JInternalFrame frm : mdiInternalFrm) {
                        frm.setVisible(false);
                        frm.dispose();
                        frm = null;
                    mdiInternalFrm.clear();
                    remove(desktopPane);
                    desktopPane.removeAll();
    //                revalidate();
                    repaint();
                    add(contentPanel);
                    index = 0;
                    for (JDialog dialog : freeFloatDialogs) {
                        dialog.setVisible(false);
                        dialog.dispose();
                        dialog = null;
                    freeFloatDialogs.clear();
                    for (int i = 0; i < allScreens.size(); i++) {
                        JDialog dialog = createJDialog(allScreens.get(i));
                        freeFloatDialogs.add(dialog);
                        if (i * 60 + 100 < 1000) {
                            x = i * 60;
                            y = 60;
                        } else {
                            x = 60 * index;
                            y = 120;
                            index++;
                        dialog.setLocation(x, y);
                        dialog.setVisible(true);
            JMenuItem menuItem2 = new JMenuItem("Switch MDI");
            menuItem2.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    windowMode = MDI_MODE;
                    remove(contentPanel);
                    add(desktopPane);
                    for (int i = 0; i < freeFloatDialogs.size(); i++) {
                        freeFloatDialogs.get(i).setVisible(false);
                        freeFloatDialogs.get(i).dispose();
                    freeFloatDialogs.clear();
    //                revalidate();
                    repaint();
                    for (JInternalFrame frm : mdiInternalFrm) {
                        frm.setVisible(false);
                        frm.dispose();
                        frm = null;
                    mdiInternalFrm.clear();
                    index = 0;
                    for (int i = 0; i < allScreens.size(); i++) {
                        JInternalFrame frame = createInternalFram(allScreens.get(i));
                        desktopPane.add(frame);
                        mdiInternalFrm.add(frame);
                        if (i * 60 + 100 < 1000) {
                            x = i * 60;
                            y = 60;
                        } else {
                            x = 60 * index;
                            y = 120;
                            index++;
                        frame.setLocation(x, y);
                        frame.setVisible(true);
            menu.add(menuItem1);
            menu.add(menuItem2);
            return menu;
    public class TestTableScreen extends TestPanel {
        private static final long serialVersionUID = 1L;
        JTable testTable = new JTable();
        MyTableModel tableModel1 = new MyTableModel(1);
        private boolean notRepaint = false;
        int start = 0;
        JScrollPane scrollPane = new JScrollPane();
        private Timer timmer = new Timer(200, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                Random indexRandom = new Random();
                final int index = indexRandom.nextInt(50);
                Random valRandom = new Random();
                final int val = valRandom.nextInt(600);
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        notRepaint = false;
                        TestTableScreen.this.update(index + "|" + val);
        public TestTableScreen(String title) {
            this.title = title;
            init();
            tableModel1.setTabelName(title);
        public void startTime() {
            timmer.start();
        public String getTitle() {
            return title;
        public void update(String updateStr) {
            String[] val = updateStr.split("\\|");
            if (val.length == 2) {
                int index = Integer.valueOf(val[0]);
                List vals = tableModel1.getVector();
                if (vals.size() > index) {
                    vals.set(index, val[1]);
    //                 tableModel1.fireTableRowsUpdated(index, index);
                } else {
                    vals.add(val[1]);
    //                 tableModel1.fireTableRowsUpdated(vals.size() - 1, vals.size() - 1);
                tableModel1.fireTableDataChanged();
        public TableModel getTableModel() {
            return tableModel1;
        public void init() {
            testTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
            testTable.setRowSelectionAllowed(true);
            this.testTable.setModel(tableModel1);
            int[] width = { 160, 80, 45, 98, 60, 88, 87, 88, 80, 70, 88, 80, 75, 87, 87, 41, 88, 82, 75, 68, 69 };
            TableColumnModel columnModel = testTable.getColumnModel();
            for (int i = 0; i < width.length; i++) {
                columnModel.getColumn(i).setPreferredWidth(width[i]);
            testTable.setRowHeight(20);
            tableModel1.fireTableDataChanged();
            this.setLayout(new BorderLayout());
            TableColumnModel columnMode2 = testTable.getColumnModel();
            int[] width2 = { 200 };
            for (int i = 0; i < width2.length; i++) {
                columnMode2.getColumn(i).setPreferredWidth(width2[i]);
            scrollPane.getViewport().add(testTable);
            scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
            this.add(scrollPane, BorderLayout.CENTER);
        class MyTableModel extends DefaultTableModel {
            public List list = new ArrayList();
            String titles[] = new String[] { "袨怓1", "袨怓2", "袨怓3", "袨怓4", "袨怓5", "袨怓6", "袨怓7", "袨怓8", "袨怓9", "袨怓10", "袨怓11",
                    "袨怓12", "袨怓13", "袨怓14", "袨怓15", "袨怓16", "袨怓17", "袨怓18", "袨怓19", "袨怓20", "袨怓21" };
            String tabelName = "";
            int type_head = 0;
            int type_data = 1;
            int type = 1;
            public MyTableModel(int type) {
                super();
                this.type = type;
                for (int i = 0; i < 50; i++) {
                    list.add(i);
            public void setTabelName(String name) {
                this.tabelName = name;
            public int getRowCount() {
                if (list != null) {
                    return list.size();
                return 0;
            public List getVector() {
                return list;
            public int getColumnCount() {
                if (type == 0) {
                    return 1;
                } else {
                    return titles.length;
            public String getColumnName(int c) {
                if (type == 0) {
                    return "head";
                } else {
                    return titles[c];
            public boolean isCellEditable(int nRow, int nCol) {
                return false;
            public Object getValueAt(int r, int c) {
                if (list.size() == 0) {
                    return null;
                switch (c) {
                default:
                    if (type == 0) {
                        return r + " " + c + "  test ";
                    } else {
                        return list.get(r) + "   " + c;
        public boolean isNotRepaint() {
            return notRepaint;
        public void setNotRepaint(boolean notRepaint) {
            this.notRepaint = notRepaint;
    public class TestPanel extends JPanel {
        protected String title = "";
        protected boolean needRepaint = false;
        protected boolean isFirstOpen = true;
        public String getTitle() {
            return title;
        public void setNeedRepaint(boolean flag) {
            this.needRepaint = flag;
        public boolean isNeedRepaint() {
            return needRepaint;
        public boolean isFirstOpen() {
            return isFirstOpen;
        public void setFirstOpen(boolean isFirstOpen) {
            this.isFirstOpen = isFirstOpen;
    public class TestJLableScreen extends TestPanel {
        private static final long serialVersionUID = 1L;
        private JLabel[] allLables = new JLabel[20];
        private Timer timmer = new Timer(20, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                Random indexRandom = new Random();
                final int index = indexRandom.nextInt(10);
                Random valRandom = new Random();
                final int val = valRandom.nextInt(600);
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        TestJLableScreen.this.setNeedRepaint(true);
                        TestJLableScreen.this.update(index + "|" + val);
        public TestJLableScreen(String title) {
            this.title = title;
            init();
        public void startTime() {
            timmer.start();
        public String getTitle() {
            return title;
        public void update(String updateStr) {
            String[] val = updateStr.split("\\|");
            if (val.length == 2) {
                int index = Integer.valueOf(val[0]);
                allLables[index * 2 + 1].setText(val[1]);
        public void init() {
            this.setLayout(new GridLayout(10, 2));
            boolean flag = true;
            for (int i = 0; i < allLables.length; i++) {
                allLables[i] = new JLabel() {
                    // public void setText(String text) {
                    // super.setText(text);
                    // // System.out.println("  setText " + getTitle() + "   ; " + this.getName());
                    public void paint(Graphics g) {
                        super.paint(g);
                        // System.out.println("  paint " + getTitle() + "   ; " + this.getName());
                    // public void repaint() {
                    // super.repaint();
                    // System.out.println("  repaint " + getTitle() + "   ; " + this.getName());
                allLables[i].setName("" + i);
                if (i % 2 == 0) {
                    allLables[i].setText("Name " + i + "  : ");
                } else {
                    allLables[i].setOpaque(true);
                    if (flag) {
                        allLables[i].setBackground(Color.YELLOW);
                        flag = false;
                    } else {
                        allLables[i].setBackground(Color.CYAN);
                        flag = true;
                    allLables[i].setText(i * 8 + "");
            for (int i = 0; i < allLables.length; i++) {
                this.add(allLables[i]);
    public class CustomeInternalFrame extends JInternalFrame {
        protected TestPanel panel;
        public CustomeInternalFrame() {
            this("", false, false, false, false);
        public CustomeInternalFrame(String title) {
            this(title, false, false, false, false);
        public CustomeInternalFrame(String title, boolean resizable) {
            this(title, resizable, false, false, false);
        public CustomeInternalFrame(String title, boolean resizable, boolean closable) {
            this(title, resizable, closable, false, false);
        public CustomeInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable) {
            this(title, resizable, closable, maximizable, false);
        public CustomeInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable,
                boolean iconifiable) {
            super(title, resizable, closable, maximizable, iconifiable);
        public TestPanel getPanel() {
            return panel;
        public void setPanel(TestPanel panel) {
            this.panel = panel;

    i had the same problem with buttons and it seemed that i overlayed my button with something else...
    so check that out first do you put something on that excact place???
    other problem i had was the VAJ one --> VisualAge for Java (terrible program)
    it does strange tricks even when you don't use the drawing tool...
    dunno 2 thoughts i had... check it out...
    SeJo

  • Problems getting data from JMenuBar to JInternalFrame

    I have modified an example to show my problem. I am trying to take text input from the menu bar and print it into a JTextArea. I don't know how to reference the data in my ActionListener.
    The ActionListener is incomplete, but this is basically what I am trying to do:
    import javax.swing.JInternalFrame;
    import javax.swing.JDesktopPane;
    import javax.swing.JMenu;
    import javax.swing.JMenuItem;
    import javax.swing.JMenuBar;
    import javax.swing.JFrame;
    import javax.swing.KeyStroke;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    * InternalFrameDemo.java is a 1.4 application that requires:
    *   MyInternalFrame.java
    public class InternalFrameDemo extends JFrame
                                   implements ActionListener {
        JDesktopPane desktop;
        JTextField memAddrBox;
        JTextArea menuText;
        JTextArea frame;
        String textFieldString = " Input Text: ";
        ActionListener al;
        public InternalFrameDemo() {
            super("InternalFrameDemo");
            //Make the big window be indented 50 pixels from each edge
            //of the screen.
            int inset = 50;
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            setBounds(inset, inset,
                      screenSize.width  - inset*2,
                      screenSize.height - inset*2);
            //Set up the GUI.
            desktop = new JDesktopPane(); //a specialized layered pane
            frame = createFrame(); //create first "window"
            setContentPane(desktop);
            setJMenuBar(createMenuBar());
            //Make dragging a little faster but perhaps uglier.
            desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
        protected JMenuBar createMenuBar() {
            JMenuBar menuBar = new JMenuBar();
            JLabel memAddrLabel = new JLabel(textFieldString);
            memAddrLabel.setLabelFor(memAddrBox);
            menuBar.add(memAddrLabel);
            JTextField memAddrBox = new JTextField();
            memAddrBox.addActionListener(this);
            memAddrBox.setActionCommand("chMemAddr");
            menuBar.add(memAddrBox);
            return menuBar;
        //React to menu selections.
        public void actionPerformed(ActionEvent e) {
            if ("chMemAddr".equals(e.getActionCommand())) 
                JMenuBar bar = getJMenuBar();
    //            JTextField memAddrBox = bar.getParent();
                String memStartString = memAddrBox.getText();
                update(memStartString);
        public void update(String temp)
            frame.setText(temp);
        //Create a new internal frame.
        protected JTextArea createFrame() {
            JInternalFrame frame = new JInternalFrame("Memory",true,true,true,true);      
            frame.setSize(650, 500);
            frame.setVisible(true);
            frame.setLocation(200, 0);
            desktop.add(frame);  
            JTextArea textArea = new JTextArea();
            frame.getContentPane().add("Center", textArea);
            textArea.setFont(new Font("SansSerif", Font.PLAIN, 12));
            textArea.setVisible(true);
            textArea.setText("Initial Text");
            return textArea;
        //Quit the application.
        protected void quit() {
            System.exit(0);
        public static void main(String[] args) {
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            InternalFrameDemo frame = new InternalFrameDemo();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Display the window.
            frame.setVisible(true);
    class MyInternalFrame extends JInternalFrame {
        static int openFrameCount = 0;
        static final int xOffset = 30, yOffset = 30;
        public MyInternalFrame() {
            super("Document #" + (++openFrameCount),
                  true, //resizable
                  true, //closable
                  true, //maximizable
                  true);//iconifiable
            //...Create the GUI and put it in the window...
            //...Then set the window size or call pack...
            setSize(300,300);
            //Set the window's location.
            setLocation(xOffset*openFrameCount, yOffset*openFrameCount);
    }I want to take the input from the "memAddrBox" and put it into the "frame" using the update() method. Probably a simple solution, but I have not found a similar problem in the Forums.

    I knew it had to be something simple, here is the fix I found:
    import javax.swing.JInternalFrame;
    import javax.swing.JDesktopPane;
    import javax.swing.JMenu;
    import javax.swing.JMenuItem;
    import javax.swing.JMenuBar;
    import javax.swing.JFrame;
    import javax.swing.KeyStroke;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    * InternalFrameDemo.java is a 1.4 application that requires:
    *   MyInternalFrame.java
    public class InternalFrameDemo extends JFrame
                                   implements ActionListener {
        JDesktopPane desktop;
        JTextField memAddrBox;
        JTextArea menuText;
        JTextArea frame;
        String textFieldString = " Input Text: ";
        ActionListener al;
        public InternalFrameDemo() {
            super("InternalFrameDemo");
            //Make the big window be indented 50 pixels from each edge
            //of the screen.
            int inset = 50;
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            setBounds(inset, inset,
                      screenSize.width  - inset*2,
                      screenSize.height - inset*2);
            //Set up the GUI.
            desktop = new JDesktopPane(); //a specialized layered pane
            frame = createFrame(); //create first "window"
            setContentPane(desktop);
            setJMenuBar(createMenuBar());
            //Make dragging a little faster but perhaps uglier.
            desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
        protected JMenuBar createMenuBar() {
            JMenuBar menuBar = new JMenuBar();
            JLabel memAddrLabel = new JLabel(textFieldString);
            memAddrLabel.setLabelFor(memAddrBox);
            menuBar.add(memAddrLabel);
            JTextField memAddrBox = new JTextField();
            memAddrBox.addActionListener(this);
            memAddrBox.setActionCommand("chMemAddr");
            menuBar.add(memAddrBox);
            return menuBar;
        //React to menu selections.
        public void actionPerformed(ActionEvent e) {
            if ("chMemAddr".equals(e.getActionCommand())) 
               JTextField textField =
                 (JTextField)e.getSource();
                String memStartString = textField.getText();
                update(memStartString);
        public void update(String temp)
            frame.setText(temp);
        //Create a new internal frame.
        protected JTextArea createFrame() {
            JInternalFrame frame = new JInternalFrame("Memory",true,true,true,true);      
            frame.setSize(650, 500);
            frame.setVisible(true);
            frame.setLocation(200, 0);
            desktop.add(frame);  
            JTextArea textArea = new JTextArea();
            frame.getContentPane().add("Center", textArea);
            textArea.setFont(new Font("SansSerif", Font.PLAIN, 12));
            textArea.setVisible(true);
            textArea.setText("Initial Text");
            return textArea;
        //Quit the application.
        protected void quit() {
            System.exit(0);
        public static void main(String[] args) {
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            InternalFrameDemo frame = new InternalFrameDemo();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Display the window.
            frame.setVisible(true);
    class MyInternalFrame extends JInternalFrame {
        static int openFrameCount = 0;
        static final int xOffset = 30, yOffset = 30;
        public MyInternalFrame() {
            super("Document #" + (++openFrameCount),
                  true, //resizable
                  true, //closable
                  true, //maximizable
                  true);//iconifiable
            //...Create the GUI and put it in the window...
            //...Then set the window size or call pack...
            setSize(300,300);
            //Set the window's location.
            setLocation(xOffset*openFrameCount, yOffset*openFrameCount);
    }Note the e.getSource() change in the ActionListener.

  • 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) {   }
    }

Maybe you are looking for

  • IPod won't restore...error message saying "Can't mount iPod"...

    I have determined that I need to restore my iPod based on my problem (I manually update playlists and cannot add a playlist because I get an error message saying "The disk cannot be read from or written to.") So I open iPod updater 11-17-2005 to try

  • Edit in Photoshop CS6 (version 13.0.1 x64) from Lightroom 5.2

    I have an image in Lightroom 5 where I have not made any adjustments and I want to Edit In Photoshop CS 6, When I go to Photo>Edit In> Edit In Adobe Photoshop CS6, Photoshop opens without first displaying the "Edit Photo with Adobe Photoshop CS6 What

  • Not able to get calls from landlines in my E51

    All of a sudden I am not able to recieve calls from landlines, the caller gets long ring or proper ring tone giving impression that I am not picking up

  • Randomly corrupted installers

    We are developing a software suite called Omnitapps in Adobe AIR (sdk 4.5.1 build as 2.6) in FDT 4.5 Since a while now our installers we package with ant seem to get corrupted randomly, some times it works some times it doesnt. It seems to get worse

  • HELP! IM Notifications aren't working on 4.3.2

    I realized about a week ago that I wasn't getting pop-up notifications from Beejive (for GTalk) or Meebo on my iPad (16g/wifi). Specifically, when I'm not in the app, I wouldn't see the pop-up notification (alerts) or number of unread messages (badge