⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newjframe.java

📁 能简单的实现商品的查询
💻 JAVA
字号:
/* * NewJFrame.java * * Created on 2008骞?鏈?鏃? 涓婂崍11:59 *///package shop;/** * * @author  ldwin */import javax.swing.JOptionPane;import java.awt.event.*;public class NewJFrame extends javax.swing.JFrame {        /** Creates new form NewJFrame */    public NewJFrame() {        initComponents();    }        /** This method is called from within the constructor 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=" 生成的代码 ">//GEN-BEGIN:initComponents    private void initComponents() {        jScrollPane1 = new javax.swing.JScrollPane();        jTextArea1 = new javax.swing.JTextArea();        jMenuBar1 = new javax.swing.JMenuBar();        jMenu1 = new javax.swing.JMenu();        jMenuItem1 = new javax.swing.JMenuItem();        jMenuItem2 = new javax.swing.JMenuItem();        jMenuItem3 = new javax.swing.JMenuItem();        jMenu2 = new javax.swing.JMenu();        jMenuItem4 = new javax.swing.JMenuItem();        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);        jTextArea1.setBackground(java.awt.Color.green);        jTextArea1.setColumns(20);        jTextArea1.setEditable(false);        jTextArea1.setFont(new java.awt.Font("楷体_GB2312", 0, 18));        jTextArea1.setForeground(java.awt.Color.red);        jTextArea1.setRows(5);        jTextArea1.setText("    welcome to use star shop system!");        jScrollPane1.setViewportView(jTextArea1);        jMenu1.setText("\u7528\u6237\u767b\u9646");        jMenuItem1.setText("vip\u767b\u9646");        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jMenuItem1ActionPerformed(evt);            }        });        jMenu1.add(jMenuItem1);        jMenuItem2.setText("\u7ba1\u7406\u5458\u767b\u9646");        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jMenuItem2ActionPerformed(evt);            }        });        jMenu1.add(jMenuItem2);        jMenuItem3.setText("\u9000\u51fa\u7cfb\u7edf");        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jMenuItem3ActionPerformed(evt);            }        });        jMenu1.add(jMenuItem3);        jMenuBar1.add(jMenu1);        jMenu2.setText("\u5e2e\u52a9");        jMenuItem4.setText("\u5173\u4e8e\u672c\u7cfb\u7edf");        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jMenuItem4ActionPerformed(evt);            }        });        jMenu2.add(jMenuItem4);        jMenuBar1.add(jMenu2);        setJMenuBar(jMenuBar1);        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(23, 23, 23)                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 349, javax.swing.GroupLayout.PREFERRED_SIZE)                .addContainerGap(28, Short.MAX_VALUE))        );        layout.setVerticalGroup(            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)            .addGroup(layout.createSequentialGroup()                .addGap(26, 26, 26)                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 207, javax.swing.GroupLayout.PREFERRED_SIZE)                .addContainerGap(61, Short.MAX_VALUE))        );        pack();    }// </editor-fold>//GEN-END:initComponentsprivate void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed    // TODO add your handling code here:       try					 {  						 JOptionPane.showMessageDialog(this,"copyrights shopsystem"+'\n'+"my email,maxpaynelevel@gmail.com","帮助",							 JOptionPane.INFORMATION_MESSAGE);   					 }					 catch(Exception eee)					 {						 System.out.println(eee);					 }}//GEN-LAST:event_jMenuItem4ActionPerformedprivate void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed    // TODO add your handling code here:    System.exit(0);}//GEN-LAST:event_jMenuItem3ActionPerformedprivate void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed    // TODO add your handling code here:     try{            Runtime ce=Runtime.getRuntime();            ce.exec("javac NewJFrame2.java");            ce.exec("java NewJFrame2");                    } catch(Exception e) {            System.out.println(e);        }}//GEN-LAST:event_jMenuItem2ActionPerformedprivate void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed    // TODO add your handling code here:    try{            Runtime ce=Runtime.getRuntime();            ce.exec("javac NewJFrame1.java");            ce.exec("java NewJFrame1");                    } catch(Exception e) {            System.out.println(e);        }}//GEN-LAST:event_jMenuItem1ActionPerformed        /**     * @param args the command line arguments     */    public static void main(String args[]) {        java.awt.EventQueue.invokeLater(new Runnable() {            public void run() {                new NewJFrame().setVisible(true);            }        });    }        // 变量声明 - 不进行修改//GEN-BEGIN:variables    private javax.swing.JMenu jMenu1;    private javax.swing.JMenu jMenu2;    private javax.swing.JMenuBar jMenuBar1;    private javax.swing.JMenuItem jMenuItem1;    private javax.swing.JMenuItem jMenuItem2;    private javax.swing.JMenuItem jMenuItem3;    private javax.swing.JMenuItem jMenuItem4;    private javax.swing.JScrollPane jScrollPane1;    private javax.swing.JTextArea jTextArea1;    // 变量声明结束//GEN-END:variables    }

⌨️ 快捷键说明

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