📄 shows.java
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class shows extends PrintScore{
private JRadioButton jchkran=new JRadioButton("显示矩形图");
private JRadioButton jchkround=new JRadioButton("显示圆形图");
private int cho=0;
shows(){
jok3.setText("确定");
checkpanel.add(jchkran);
checkpanel.add(jchkround);
ButtonGroup group=new ButtonGroup();
group.add(jchkround);
group.add(jchkran);
jchkround.setSelected(true);
this.setBackground(Color.pink);
jchkran.addActionListener(this);
jchkround.addActionListener(this);
}
/* public static void main(String[] args){
shows s=new shows();
s.setSize(300,200);
s.setVisible(true);
}*/
public void actionPerformed(ActionEvent e){
if(jchkran==e.getSource()){
cho=1;
}
else if(jchkround==e.getSource())
{
cho=0;
}
if(jok3==e.getSource()){
access check=new access();
String count89=check.requir(elesson[clesson.getSelectedIndex()],
80,89,eclass[cclass.getSelectedIndex()]);
String count06=check.requir(elesson[clesson.getSelectedIndex()],
0,59,eclass[cclass.getSelectedIndex()]);
String count67=check.requir(elesson[clesson.getSelectedIndex()],
60,69,eclass[cclass.getSelectedIndex()]);
String count78=check.requir(elesson[clesson.getSelectedIndex()],
70,79,eclass[cclass.getSelectedIndex()]);
String count91=check.requir(elesson[clesson.getSelectedIndex()],
90,100,eclass[cclass.getSelectedIndex()]);
String count01=check.requir(elesson[clesson.getSelectedIndex()],
0,100,eclass[cclass.getSelectedIndex()]);
check.close();
int count1=Integer.parseInt(count01);
int count2=Integer.parseInt(count06);
int count3=Integer.parseInt(count67);
int count4=Integer.parseInt(count78);
int count5=Integer.parseInt(count89);
int count6=Integer.parseInt(count91);
if(cho==1){
ShowRectangle r=new ShowRectangle(count1,count2,count3,count4,
count5,count6);
r.setSize(550,400);
r.setTitle("成绩情况矩形图");
Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();
int screenWidth=screenSize.width;
int screenHeight=screenSize.height;
x=(screenWidth-r.getWidth())/2;
y=(screenHeight-r.getWidth())/2;
r.setLocation(x,y);
r.setVisible(true);
}
else if(cho==0){
ShowRounds r2=new ShowRounds(count1,count2,count3,count4,
count5,count6);
r2.setSize(450,350);
r2.setTitle("成绩情况盘型图");
Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();
int screenWidth=screenSize.width;
int screenHeight=screenSize.height;
x=(screenWidth-r2.getWidth())/2;
y=(screenHeight-r2.getWidth())/2;
r2.setLocation(x,y);
r2.setVisible(true);
}
}
else if(cancle==e.getSource()){
this.dispose();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -