📄 mycount.java
字号:
package ding;import java.awt.*;import javax.swing.*;/** * <p>Title: 门电路画图器</p> * <p>Description: www.1shu.net</p> * <p>Copyright: Copyright (c) 2003</p> * <p>Company: EyeSome</p> * @author ES * @version 1.0 */public class mycount extends JFrame { GridLayout gridLayout1 = new GridLayout(); public mycount(mainFrame frame) { super("统计信息"); int num=0; int count=0; setSize(160,400); JPanel pane = new JPanel(); Font tmpF = new Font("Dialog", Font.PLAIN, 14); gridLayout1.setRows(frame.yjtNo-10); gridLayout1.setColumns(1); for(int i=0;i<frame.yjtNo;i++){ if(frame.yjt[i].number != 0){ JLabel ll = new JLabel(); ll.setFont(tmpF); count=count+frame.yjt[i].number; ll.setText(frame.yjt[i].des + ":" + frame.yjt[i].number); pane.add(ll); num++; } } pane.setLayout(gridLayout1); JLabel a = new JLabel("--------------------------------"); JLabel ll = new JLabel("元器件种类:"+num); ll.setFont(tmpF); pane.add(a); pane.add(ll); JLabel lll = new JLabel("元器件数量:"+count); lll.setFont(tmpF); pane.add(lll); setContentPane(pane); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -