I want to set the JMenuBar in JApplet from the top to down. Is this possible. I have maket work with application why I can't makit work with JApplet what I'm doing wrong Here is my
Applet:
import javax.swing.*;
import java.awt.*;
//import java.awt.event.*;
import javax.swing.border.*;
public class Feni extends JApplet {
public JMenuBar menibar = new JMenuBar();
public JMenu[] menita = {
new JMenu("Resources and mining"),
new JMenu("Production"),
new JMenu("About the process"),
new JMenu("Investments"),
new JMenu("Logistic"),
new JMenu("Environment"),
new JMenu("Other activitys")
};
public void init() {
menibar.setLayout(new BoxLayout(menibar, BoxLayout.Y_AXIS));
for(int i=0; i<menita.length; i++) {
menita[i].setBorder(new EtchedBorder());
menibar.add(menita[i]);
}
//setPreferredSize(new Dimension(150, 1000));
setJMenuBar(menibar);
}
}
and I insert in to HTML:
<html>
<body>
<applet code=Feni.class width="160" height="1100">
</applet>
</body>
</html>
I dont have error but thе menubar is in the top of the window from left to right not like I want, from top to down