newjapplet.java

来自「java绘图 java awt 经典绘图的例子,对于初学awt模块的人非常有帮助」· Java 代码 · 共 72 行

JAVA
72
字号
/* * NewJApplet.java * * Created on 2008年3月31日, 上午9:45 */package swing;/** * * @author  zhaolin */public class NewJApplet extends javax.swing.JApplet {        /** Initializes the applet NewJApplet */    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() {        jLabel1 = new javax.swing.JLabel();        jButton1 = new javax.swing.JButton();        jLabel1.setText("jLabel1");        jButton1.setText("jButton1");        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());        getContentPane().setLayout(layout);        layout.setHorizontalGroup(            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(layout.createSequentialGroup()                .addGap(88, 88, 88)                .addComponent(jLabel1)                .addGap(18, 18, 18)                .addComponent(jButton1)                .addContainerGap(169, Short.MAX_VALUE))        );        layout.setVerticalGroup(            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(layout.createSequentialGroup()                .addGap(77, 77, 77)                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                    .addComponent(jLabel1)                    .addComponent(jButton1))                .addContainerGap(198, Short.MAX_VALUE))        );    }// </editor-fold>//GEN-END:initComponents            // Variables declaration - do not modify//GEN-BEGIN:variables    private javax.swing.JButton jButton1;    private javax.swing.JLabel jLabel1;    // End of variables declaration//GEN-END:variables    }

⌨️ 快捷键说明

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