[5207] in java-interest

home help back first fref pref prev next nref lref last post

How is Window work in Java?

daemon@ATHENA.MIT.EDU (Kok Kai Loon)
Thu Feb 1 23:14:46 1996

Date: Thu, 1 Feb 1996 16:16:23 +0800 (SST)
From: Kok Kai Loon <klkok@csam.com.MY>
To: java-interest@java.sun.com

Hello guys,

I am very new to this Java programming. Currently I am in the progress of
learning the language, I am using Beta JDK in Solaris 2.4.

My problem is, how to create a Simple Window with MenuBar on it. I have
work out something, the window is showing out on the screen (I am
using Netscape 2.0 beta 4) but with the message of "Untrusted Java Applet
Window" on it's status line, also the MenuBar that I created is not shown.

Hope someone could help me out.

Thanks in advance.
KLKOK
(klkok@csam.com.MY)

Attachment of my sample code;
--------------------------------------------------------------------------
public class MainScreen extends Applet{                                   
     
        Window     MainWindow;

        public MainScreen(){
                MenuBar    MainMenu;
                Menu       FileMenu;
                Menu       EditMenu;
                Menu       OptionMenu;
                Menu       HelpMenu;

                /* Create FileMenu */
                FileMenu = new Menu("File");
                FileMenu.add(new MenuItem("Open"));
                FileMenu.add(new MenuItem("Close"));
                FileMenu.add(new MenuItem("-"));
                FileMenu.add(new MenuItem("Exit"));
 
                /* Create EditMenu */
                EditMenu = new Menu("Edit");
                EditMenu.add(new MenuItem("Copy"));
                 EditMenu.add(new MenuItem("Past"));                      
      
 
                /* Create OptionMenu */
                OptionMenu = new Menu("Option");
                OptionMenu.add(new MenuItem("Setting"));
 
                /* Create HelpMenu */
                HelpMenu = new Menu("Help");
                HelpMenu.add(new MenuItem("Help"));
                HelpMenu.add(new MenuItem("-"));
                HelpMenu.add(new MenuItem("About"));
 
                /* Create MenuBar */
                MainMenu = new MenuBar();
                MainMenu.add(FileMenu);
                MainMenu.add(EditMenu);
                MainMenu.add(OptionMenu);
                
		/* Create MainWindow and attach with it Menus */         
                Frame MainMenuFrame;

                MainMenuFrame=new Frame(new String("CSA Sample Application"));
                MainWindow=new Window(MainMenuFrame);
                MainWindow.show();
	}
}


-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post