Hi ,
I am trying to do very simple application with JApplet , on top I need one menu bar and below that menu , I just use paint components which I draw some line or some string or shape .
The sample code for my application is below , but if you run this code you will see the menu will be covert by paint stage unless you click on the menu bar area . I search in google , but I could not find match solution for it .
If anyone can suggest me what is the correct root for it , I will be thankful .
public class MyApplication extends JApplet {
public void init() {
setSize(400, 400);
this.setBackground(new Color(0x646060));
JMenuBar menubar = new JMenuBar();
JMenu menuOption = new JMenu("Options");
JMenuItem Camera01 = new JMenuItem("Camera 01", 1);
menuOption.add(Camera01);
menubar.add(menuOption);
setJMenuBar(menubar);
}
public void paint(Graphics g) {
g.setColor(Color.CYAN);
g.drawRect(0, 0, 100, 100);
}
}