newapplet.java

来自「计算星座的代码..比较简单..不过java初学者可以参考下哈..是吧」· Java 代码 · 共 63 行

JAVA
63
字号
/*
 * NewApplet.java
 *
 * Created on 2007年1月14日, 下午7:33
 */

/**
 *
 * @author  Administrator
 */
public class NewApplet extends java.applet.Applet {
    
    /** Initializes the applet NewApplet */
    public void init() {
        try {
            java.awt.EventQueue.invokeAndWait(new Runnable() {
                public void run() {
                    initComponents();
                }
            });
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
    /** This method is called from within the init() method to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        menuBar1 = new java.awt.MenuBar();
        hello = new java.awt.Menu();
        jhgjh = new java.awt.MenuItem();

        hello.setLabel("Menu");
        jhgjh.setLabel("Item");
        jhgjh.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jhgjhActionPerformed(evt);
            }
        });

        hello.add(jhgjh);

        menuBar1.add(hello);

    }// </editor-fold>//GEN-END:initComponents

    private void jhgjhActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jhgjhActionPerformed
// TODO add your handling code here:
    }//GEN-LAST:event_jhgjhActionPerformed
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private java.awt.Menu hello;
    private java.awt.MenuItem jhgjh;
    private java.awt.MenuBar menuBar1;
    // End of variables declaration//GEN-END:variables
    
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?