您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 市场营销 > java商品管理系统6
packagecom.gui;importjava.awt.Font;importjava.awt.event.*;importjavax.swing.*;importjavax.swing.event.*;/****@author__USER__*/publicclassFontDialogextendsjavax.swing.JDialogimplementsActionListener,ListSelectionListener{publicFontDialog(java.awt.Frameparent,booleanmodal){super(parent,modal);initComponents();this.btnExit.addActionListener(this);this.btnSubmit.addActionListener(this);this.listZiXing.addListSelectionListener(this);this.listDaXiao.addListSelectionListener(this);this.listZiTi.addListSelectionListener(this);}privatevoidinitComponents(){lblZiTi=newjavax.swing.JLabel();txtZiTi=newjavax.swing.JTextField();jScrollPane1=newjavax.swing.JScrollPane();listZiTi=newjavax.swing.JList();lblZiXing=newjavax.swing.JLabel();txtZiXing=newjavax.swing.JTextField();jScrollPane2=newjavax.swing.JScrollPane();listZiXing=newjavax.swing.JList();lblDaXiao=newjavax.swing.JLabel();txtDaXiao=newjavax.swing.JTextField();jScrollPane3=newjavax.swing.JScrollPane();listDaXiao=newjavax.swing.JList();btnSubmit=newjavax.swing.JButton();btnExit=newjavax.swing.JButton();setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);lblZiTi.setFont(newjava.awt.Font(微软雅黑,0,18));lblZiTi.setText(\u5b57\u4f53\uff1a);txtZiTi.setText(\u5b8b\u4f53);listZiTi.setModel(newjavax.swing.AbstractListModel(){String[]strings={宋体,仿宋,黑体,楷体};publicintgetSize(){returnstrings.length;}publicObjectgetElementAt(inti){returnstrings[i];}});jScrollPane1.setViewportView(listZiTi);lblZiXing.setFont(newjava.awt.Font(微软雅黑,0,18));lblZiXing.setText(\u5b57\u5f62\uff1a);txtZiXing.setText(\u5e38\u89c4);listZiXing.setModel(newjavax.swing.AbstractListModel(){String[]strings={常规,斜体,粗体,粗体倾斜};publicintgetSize(){returnstrings.length;}publicObjectgetElementAt(inti){returnstrings[i];}});jScrollPane2.setViewportView(listZiXing);lblDaXiao.setFont(newjava.awt.Font(微软雅黑,0,18));lblDaXiao.setText(\u5927\u5c0f\uff1a);txtDaXiao.setText(12);listDaXiao.setModel(newjavax.swing.AbstractListModel(){String[]strings={12,14,16,18,20};publicintgetSize(){returnstrings.length;}publicObjectgetElementAt(inti){returnstrings[i];}});jScrollPane3.setViewportView(listDaXiao);btnSubmit.setText(\u786e\u5b9a);btnExit.setText(\u53d6\u6d88);javax.swing.GroupLayoutlayout=newjavax.swing.GroupLayout(getContentPane());getContentPane().setLayout(layout);layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,false).addComponent(jScrollPane1).addComponent(lblZiTi).addComponent(txtZiTi,javax.swing.GroupLayout.PREFERRED_SIZE,56,javax.swing.GroupLayout.PREFERRED_SIZE)).addGap(42,42,42).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,false).addComponent(lblZiXing).addComponent(jScrollPane2).addComponent(txtZiXing)).addGap(45,45,45).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,false).addComponent(lblDaXiao,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,Short.MAX_VALUE).addComponent(jScrollPane3).addComponent(txtDaXiao,javax.swing.GroupLayout.PREFERRED_SIZE,59,javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,39,Short.MAX_VALUE).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(btnSubmit).addComponent(btnExit)).addContainerGap()));layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addGap(44,44,44).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(lblZiTi).addComponent(lblZiXing).addComponent(lblDaXiao)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(btnSubmit).addComponent(txtZiTi,javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(txtZiXing,javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(txtDaXiao,javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE)).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addGap(80,80,80).addComponent(btnExit)).addGroup(layout.createSequentialGroup().addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane2,javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jScrollPane1,javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jScrollPane3,ja
本文标题:java商品管理系统6
链接地址:https://www.777doc.com/doc-6150104 .html