A very hard question

Hi all ,
Have you ever seen this problem ? What is happening with my menu ? It is obstructed  by the other . Here is the image .

http://s15.yousendit.com/d.aspx?id=3VNHUZ2DPURCZ0U6PLK1D1CD0E
hellovnAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

StillUnAwareCommented:
Can You put some of Your code please?
hellovnAuthor Commented:
bar = new JMenuBar();
 setJMenuBar(bar);
 bar.add(fileMenu);
 bar.add(editMenu);
 bar.add(windowMenu);
 bar.add(helpMenu);

...

getContentPane().add(toolBar, BorderLayout.NORTH);
getContentPane().add(searchBar, BorderLayout.EAST);
getContentPane().add(simpleBean, BorderLayout.CENTER);

dimension = Toolkit.getDefaultToolkit().getScreenSize();
setSize(dimension);
setVisible(true);


simpleBean is an instance of SimpleBean class extended Container class .
StillUnAwareCommented:
just try this, it works fine for me, maybe it won't for You:

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;

public class R extends JFrame {
  R() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }
  public void init() {
    JMenuBar jmb = new JMenuBar();
    JMenu jmFile = new JMenu("File");
    jmFile.setMnemonic(KeyEvent.VK_F);
    JMenuItem jmiNew = new JMenuItem("New", KeyEvent.VK_N);
    JMenuItem jmiExit = new JMenuItem("Exit", KeyEvent.VK_E);
    jmFile.add(jmiNew);
    jmFile.add(jmiExit);
    jmb.add(jmFile);
    setLayout(new BorderLayout());
    add(jmb, BorderLayout.NORTH);
    JPanel panel = new JPanel();
    panel.add(new JTextArea(30,30));
    add(panel);
    pack();
  }
  public static void main(String[] args) {
    R r = new R();
    r.init();
    r.setVisible(true);
  }
}
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

hellovnAuthor Commented:
Your program is correct  . But it can't help me .
StillUnAwareCommented:
So post Yours, maybe I'll find the problem.
doronbCommented:
SimpleBean is not Swing then?  Because mixing AWT and Swing components can result in problems like this, AFAIK.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
StillUnAwareCommented:
That's it, doronb is right, You'll have to rewrite Your program to use only awt package, or only swing.
hellovnAuthor Commented:
Ok , he's right . I've mixed AWT and Swing . But I don't want to replace Swing components with AWT Components . Is there a solution for it ?
Mayank SPrincipal TechnologistCommented:
Yes, use the Swing equivalents of the AWT components which you have, so that everything is Swing-based....
doronbCommented:
You can either use all Swing, or all AWT components.  Using both means that the OS's threads and Java's Swing-paint thread are fighting one another ;)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.