please tell me where i'm off
the window opens but no menu bar.
the error says :
java:52: '.class' expected
menuInput[][] = array [row][col];
thanks hs
import java.awt.*;
import java.awt.event.KeyEvent;
import javax.swing.*;
public class Driver{
public static void main(String[] args) {
TheWindowObject aTestFrame = new TheWindowObject ("test");
} }
class TheWindowObject{
TheWindowObject(String title){
CreateWindow () ;
}
TheWindowObject(String title, int height, int width){
}
JFrame CreateWindow (){
String title ="test";
int height =200 ;
int width=400 ;
JFrame aTestFrame= null;
aTestFrame =new JFrame("test");
aTestFrame.setSize (width, height);
aTestFrame.setVisible (true);
aTestFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
aTestFrame.setJMenuBar (new MenuFactory().generate());
return aTestFrame;
}}
class MenuFactory {
JMenuBar generate(){
JFrame aTestFrame= null;
JMenuBar generate= new JMenuBar();
JMenu createMenu=null;
JMenuItem createMenuItem;
String menuInput= null;
array();
createMenu = new JMenu(menuInput);
generate.add(createMenu );
return generate;
}
String [][]array(){
String [][] array = null;
String [][] menuInput ={{"File", "Edit", "Windows", "Help"},{"Open","Cut","First","About"},{"Close","Paste","Second", null},{"Exit","Copy",null, null},{null, "Select All", null, null,}};
for ( row=0; row<array.length; row++){
for ( col=0; col< array[row].length; col++)
menuInput[][] = array [row][col];
}
return menuInput;
}
}