java--GUI--下拉框组件_jframe下拉框
package PredictedScore;
import org.knowm.xchart.SwingWrapper;
import org.knowm.xchart.XChartPanel;
import org.knowm.xchart.XYChart;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Text {
static final int WIDTH = 1000;
static final int HEIGHT = 800;
static JFrame frame =new JFrame("用户画像");
public static void text() {
frame.setFont(Util.fontTitle);
frame.setSize(WIDTH, HEIGHT);
frame.setVisible(true);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
JMenuBar menuBar=new JMenuBar();
menuBar.add(Util.menu1());
menuBar.add(Util.menu2());
menuBar.add(Util.menu3());
menuBar.add(Util.menu4());
menuBar.add(Util.menu5());
menuBar.add(Util.menu6());
frame.setJMenuBar(menuBar);
}
public static void main(String[] args) {
SwingUtilities.invokeLater(Text::text);
}
}
package PredictedScore;
import org.knowm.xchart.*;
import org.knowm.xchart.internal.chartpart.Chart;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Util {
static final int WIDTH = 1000;
static final int HEIGHT = 800;
static Font fontTitle = new Font("宋体",Font.BOLD,18);
static Font font = new Font("宋体",Font.PLAIN,18);
static Font fontBig = new Font("宋体",Font.PLAIN,20);
static JPanel temPanel;
public static JMenu menu1(){
JMenu menu=new JMenu("诊断分值");
menu.setFont(font);
JMenuItem menuItem1=new JMenuItem("学生试题类型诊断分值图");
JMenuItem menuItem2=new JMenuItem("学生阅读理解知识点诊断分值图");
JMenuItem menuItem3=new JMenuItem("学生作文写作知识点诊断分值图");
JMenuItem menuItem4=new JMenuItem("学生短文翻译知识点诊断分值图");
menuItem1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
RadarChart chart = RadarChart01.getChart();
JPanel chartPanel = new XChartPanel<RadarChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生试题类型诊断分值图");
}
});
menuItem2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
RadarChart chart = RadarChart02.getChart();
JPanel chartPanel = new XChartPanel<RadarChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生阅读理解知识点诊断分值图");
}
});
menuItem4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
RadarChart chart = RadarChart04.getChart();
JPanel chartPanel = new XChartPanel<RadarChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生短文翻译知识点诊断分值图");
}
});
menuItem3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
RadarChart chart = RadarChart03.getChart();
JPanel chartPanel = new XChartPanel<RadarChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生作文写作知识点诊断分值图");
}
});
menuItem1.setFont(font);
menuItem2.setFont(font);
menuItem3.setFont(font);
menuItem4.setFont(font);
menu.add(menuItem1);
menu.add(menuItem2);
menu.add(menuItem3);
menu.add(menuItem4);
return menu;
}
public static JMenu menu4(){
JMenu menu=new JMenu("完形填空");
menu.setFont(font);
JMenuItem menuItem1=new JMenuItem("学生一学期内四级完形填空(词汇知识点)答题情况图");
JMenuItem menuItem2=new JMenuItem("学生一学期内五级完形填空(词汇知识点)答题情况图");
menuItem1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CategoryChart chart = TestForIssue62.getHistogramChartByLevelFour("学生一学期内四级完形填空(词汇知识点)答题情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<CategoryChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内四级完形填空(词汇知识点)答题情况图");
}
});
menuItem2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CategoryChart chart = TestForIssue62.getHistogramChartByLevelFive("学生一学期内五级完形填空(词汇知识点)答题情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<CategoryChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内五级完形填空(词汇知识点)答题情况图");
}
});
menuItem1.setFont(font);
menuItem2.setFont(font);
menu.add(menuItem1);
menu.add(menuItem2);
return menu;
}
public static JMenu menu2(){
JMenu menu=new JMenu("数量分布");
menu.setFont(font);
JMenuItem menuItem1=new JMenuItem("学生一个学期内答题类型数量分布图");
JMenuItem menuItem2=new JMenuItem("学生一个学期内答题等级数量分布图");
menuItem1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
PieChart chart = TestForIssue1.getChart();
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<PieChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一个学期内答题类型数量分布图");
}
});
menuItem2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
PieChart chart = TestForIssue2.getChart();
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<PieChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一个学期内答题等级数量分布图");
}
});
menuItem1.setFont(font);
menuItem2.setFont(font);
menu.add(menuItem1);
menu.add(menuItem2);
return menu;
}
public static JMenu menu3(){
JMenu menu=new JMenu("阅读理解");
JMenu menu1=new JMenu("阅读理解总览");
JMenu menu2=new JMenu("四级阅读理解知识点");
JMenu menu3=new JMenu("五级阅读理解知识点");
menu.setFont(font);
menu1.setFont(font);
menu2.setFont(font);
menu3.setFont(font);
JMenuItem menuItem1=new JMenuItem("学生一学期内四级阅读理解答题情况图");
JMenuItem menuItem2=new JMenuItem("学生一学期内五级阅读理解答题情况图");
menu1.add(menuItem1);
menu1.add(menuItem2);
menuItem1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
PieChart chart = TestForIssue21.getChart();
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<PieChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内四级阅读理解答题情况图");
}
});
menuItem2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
PieChart chart = TestForIssue22.getChart();
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<PieChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内五级阅读理解答题情况图");
}
});
JMenuItem menuItem3=new JMenuItem("学生一学期内四级阅读理解(态度知识点)答题情况图");
JMenuItem menuItem4=new JMenuItem("学生一学期内四级阅读理解(主旨知识点)答题情况图");
JMenuItem menuItem5=new JMenuItem("学生一学期内四级阅读理解(词汇知识点)答题情况图");
JMenuItem menuItem6=new JMenuItem("学生一学期内四级阅读理解(细节知识点)答题情况图");
JMenuItem menuItem7=new JMenuItem("学生一学期内四级阅读理解(同义转述知识点)答题情况图");
JMenuItem menuItem8=new JMenuItem("学生一学期内四级阅读理解(推理知识点)答题情况图");
menu2.add(menuItem3);
menu2.add(menuItem4);
menu2.add(menuItem5);
menu2.add(menuItem6);
menu2.add(menuItem7);
menu2.add(menuItem8);
menuItem3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CategoryChart chart = TestForIssue61.getHistogramChartByLevelFour("学生一学期内四级阅读理解(态度知识点)答题情况图");
JPanel chartPanel = new XChartPanel<CategoryChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内四级阅读理解(态度知识点)答题情况图");
}
});
menuItem4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CategoryChart chart = TestForIssue61.getHistogramChartByLevelFour("学生一学期内四级阅读理解(主旨知识点)答题情况图");
JPanel chartPanel = new XChartPanel<CategoryChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内四级阅读理解(主旨知识点)答题情况图");
}
});
menuItem5.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CategoryChart chart = TestForIssue61.getHistogramChartByLevelFour("学生一学期内四级阅读理解(词汇知识点)答题情况图");
JPanel chartPanel = new XChartPanel<CategoryChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内四级阅读理解(词汇知识点)答题情况图");
}
});
menuItem6.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CategoryChart chart = TestForIssue61.getHistogramChartByLevelFour("学生一学期内四级阅读理解(细节知识点)答题情况图");
JPanel chartPanel = new XChartPanel<CategoryChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内四级阅读理解(细节知识点)答题情况图");
}
});
menuItem7.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CategoryChart chart = TestForIssue61.getHistogramChartByLevelFour("学生一学期内四级阅读理解(同义转述知识点)答题情况图");
JPanel chartPanel = new XChartPanel<CategoryChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内四级阅读理解(同义转述知识点)答题情况图");
}
});
menuItem8.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CategoryChart chart = TestForIssue61.getHistogramChartByLevelFour("学生一学期内四级阅读理解(推理知识点)答题情况图");
JPanel chartPanel = new XChartPanel<CategoryChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内四级阅读理解(推理知识点)答题情况图");
}
});
JMenuItem menuItem9=new JMenuItem("学生一学期内五级阅读理解(态度知识点)答题情况图");
JMenuItem menuItem10=new JMenuItem("学生一学期内五级阅读理解(主旨知识点)答题情况图");
JMenuItem menuItem11=new JMenuItem("学生一学期内五级阅读理解(词汇知识点)答题情况图");
JMenuItem menuItem12=new JMenuItem("学生一学期内五级阅读理解(细节知识点)答题情况图");
JMenuItem menuItem13=new JMenuItem("学生一学期内五级阅读理解(同义转述知识点)答题情况图");
JMenuItem menuItem14=new JMenuItem("学生一学期内五级阅读理解(推理知识点)答题情况图");
menu3.add(menuItem9);
menu3.add(menuItem10);
menu3.add(menuItem11);
menu3.add(menuItem12);
menu3.add(menuItem13);
menu3.add(menuItem14);
menuItem9.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CategoryChart chart = TestForIssue61.getHistogramChartByLevelFive("学生一学期内五级阅读理解(态度知识点)答题情况图");
JPanel chartPanel = new XChartPanel<CategoryChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内五级阅读理解(态度知识点)答题情况图");
}
});
menuItem10.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CategoryChart chart = TestForIssue61.getHistogramChartByLevelFour("学生一学期内五级阅读理解(主旨知识点)答题情况图");
JPanel chartPanel = new XChartPanel<CategoryChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内五级阅读理解(主旨知识点)答题情况图");
}
});
menuItem11.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CategoryChart chart = TestForIssue61.getHistogramChartByLevelFour("学生一学期内五级阅读理解(词汇知识点)答题情况图");
JPanel chartPanel = new XChartPanel<CategoryChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内五级阅读理解(词汇知识点)答题情况图");
}
});
menuItem12.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CategoryChart chart = TestForIssue61.getHistogramChartByLevelFour("学生一学期内五级阅读理解(细节知识点)答题情况图");
JPanel chartPanel = new XChartPanel<CategoryChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内五级阅读理解(细节知识点)答题情况图");
}
});
menuItem13.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CategoryChart chart = TestForIssue61.getHistogramChartByLevelFour("学生一学期内五级阅读理解(同义转述知识点)答题情况图");
JPanel chartPanel = new XChartPanel<CategoryChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内五级阅读理解(同义转述知识点)答题情况图");
}
});
menuItem14.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CategoryChart chart = TestForIssue61.getHistogramChartByLevelFour("学生一学期内五级阅读理解(推理知识点)答题情况图");
JPanel chartPanel = new XChartPanel<CategoryChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内五级阅读理解(推理知识点)答题情况图");
}
});
menuItem1.setFont(font);
menuItem2.setFont(font);
menuItem3.setFont(font);
menuItem4.setFont(font);
menuItem5.setFont(font);
menuItem6.setFont(font);
menuItem7.setFont(font);
menuItem8.setFont(font);
menuItem9.setFont(font);
menuItem10.setFont(font);
menuItem11.setFont(font);
menuItem12.setFont(font);
menuItem13.setFont(font);
menuItem14.setFont(font);
menu.add(menu1);
menu.add(menu2);
menu.add(menu3);
return menu;
}
public static JMenu menu5(){
JMenu menu=new JMenu("作文写作");
JMenu menu1=new JMenu("一学期内四级作文写作");
JMenu menu2=new JMenu("一学期内五级作文写作");
JMenu menu3=new JMenu("一月内四级作文写作");
JMenu menu4=new JMenu("一月内五级作文写作");
menu.setFont(font);
menu1.setFont(font);
menu2.setFont(font);
menu3.setFont(font);
menu4.setFont(font);
JMenuItem menuItem1=new JMenuItem("学生一学期内四级作文写作各知识点平均分值情况图");
JMenuItem menuItem2=new JMenuItem("学生一学期内五级作文写作各知识点平均分值情况图");
menu1.add(menuItem1);
menu2.add(menuItem2);
menuItem1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart04.getChart("学生一学期内四级作文写作各知识点平均分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内四级作文写作各知识点平均分值情况图");
}
});
menuItem2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart04.getChart("学生一学期内五级作文写作各知识点平均分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内五级作文写作各知识点平均分值情况图");
}
});
JMenuItem menuItem3=new JMenuItem("学生三月份四级作文写作各知识点分值情况图");
JMenuItem menuItem4=new JMenuItem("学生四月份四级作文写作各知识点分值情况图");
JMenuItem menuItem5=new JMenuItem("学生五月份四级作文写作各知识点分值情况图");
JMenuItem menuItem6=new JMenuItem("学生六月份四级作文写作各知识点分值情况图");
menu3.add(menuItem3);
menu3.add(menuItem4);
menu3.add(menuItem5);
menu3.add(menuItem6);
menuItem3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart03.getChart("学生三月份四级作文写作各知识点分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生三月份四级作文写作各知识点分值情况图");
}
});
menuItem4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart03.getChart("学生四月份四级作文写作各知识点分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生四月份四级作文写作各知识点分值情况图");
}
});
menuItem5.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart03.getChart("学生五月份四级作文写作各知识点分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生五月份四级作文写作各知识点分值情况图");
}
});
menuItem6.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart03.getChart("学生六月份四级作文写作各知识点分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生六月份四级作文写作各知识点分值情况图");
}
});
JMenuItem menuItem9=new JMenuItem("学生三月份五级作文写作各知识点分值情况图");
JMenuItem menuItem10=new JMenuItem("学生四月份五级作文写作各知识点分值情况图");
JMenuItem menuItem11=new JMenuItem("学生五月份五级作文写作各知识点分值情况图");
JMenuItem menuItem12=new JMenuItem("学生六月份五级作文写作各知识点分值情况图");
menu4.add(menuItem9);
menu4.add(menuItem10);
menu4.add(menuItem11);
menu4.add(menuItem12);
menuItem9.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart03.getChart("学生三月份五级作文写作各知识点分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生三月份五级作文写作各知识点分值情况图");
}
});
menuItem10.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart03.getChart("学生四月份五级作文写作各知识点分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生四月份五级作文写作各知识点分值情况图");
}
});
menuItem11.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart03.getChart("学生五月份五级作文写作各知识点分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生五月份五级作文写作各知识点分值情况图");
}
});
menuItem12.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart03.getChart("学生六月份五级作文写作各知识点分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生六月份五级作文写作各知识点分值情况图");
}
});
menuItem1.setFont(font);
menuItem2.setFont(font);
menuItem3.setFont(font);
menuItem4.setFont(font);
menuItem5.setFont(font);
menuItem6.setFont(font);
menuItem9.setFont(font);
menuItem10.setFont(font);
menuItem11.setFont(font);
menuItem12.setFont(font);
menu.add(menu1);
menu.add(menu2);
menu.add(menu3);
menu.add(menu4);
return menu;
}
public static JMenu menu6(){
JMenu menu=new JMenu("短文翻译");
JMenu menu1=new JMenu("一学期内四级短文翻译");
JMenu menu2=new JMenu("一学期内五级短文翻译");
JMenu menu3=new JMenu("一月内四级短文翻译");
JMenu menu4=new JMenu("一月内五级短文翻译");
menu.setFont(font);
menu1.setFont(font);
menu2.setFont(font);
menu3.setFont(font);
menu4.setFont(font);
JMenuItem menuItem1=new JMenuItem("学生一学期内四级短文翻译各知识点平均分值情况图");
JMenuItem menuItem2=new JMenuItem("学生一学期内五级短文翻译各知识点平均分值情况图");
menu1.add(menuItem1);
menu2.add(menuItem2);
menuItem1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart04.getChart("学生一学期内四级短文翻译各知识点平均分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内四级短文翻译各知识点平均分值情况图");
}
});
menuItem2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart04.getChart("学生一学期内五级短文翻译各知识点平均分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生一学期内五级短文翻译各知识点平均分值情况图");
}
});
JMenuItem menuItem3=new JMenuItem("学生三月份四级短文翻译各知识点分值情况图");
JMenuItem menuItem4=new JMenuItem("学生四月份四级短文翻译各知识点分值情况图");
JMenuItem menuItem5=new JMenuItem("学生五月份四级短文翻译各知识点分值情况图");
JMenuItem menuItem6=new JMenuItem("学生六月份四级短文翻译各知识点分值情况图");
menu3.add(menuItem3);
menu3.add(menuItem4);
menu3.add(menuItem5);
menu3.add(menuItem6);
menuItem3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart03.getChart("学生三月份四级短文翻译各知识点分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生三月份四级短文翻译各知识点分值情况图");
}
});
menuItem4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart03.getChart("学生四月份四级短文翻译各知识点分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生四月份四级短文翻译各知识点分值情况图");
}
});
menuItem5.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart03.getChart("学生五月份四级短文翻译各知识点分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生五月份四级短文翻译各知识点分值情况图");
}
});
menuItem6.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart03.getChart("学生六月份四级短文翻译各知识点分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生六月份四级短文翻译各知识点分值情况图");
}
});
JMenuItem menuItem9=new JMenuItem("学生三月份五级短文翻译各知识点分值情况图");
JMenuItem menuItem10=new JMenuItem("学生四月份五级短文翻译各知识点分值情况图");
JMenuItem menuItem11=new JMenuItem("学生五月份五级短文翻译各知识点分值情况图");
JMenuItem menuItem12=new JMenuItem("学生六月份五级短文翻译各知识点分值情况图");
menu4.add(menuItem9);
menu4.add(menuItem10);
menu4.add(menuItem11);
menu4.add(menuItem12);
menuItem9.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart03.getChart("学生三月份五级短文翻译各知识点分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生三月份五级短文翻译各知识点分值情况图");
}
});
menuItem10.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart03.getChart("学生四月份五级短文翻译各知识点分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生四月份五级短文翻译各知识点分值情况图");
}
});
menuItem11.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart03.getChart("学生五月份五级短文翻译各知识点分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生五月份五级短文翻译各知识点分值情况图");
}
});
menuItem12.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
XYChart chart = DateChart03.getChart("学生六月份五级短文翻译各知识点分值情况图");
// new SwingWrapper<>(chart).displayChart();
JPanel chartPanel = new XChartPanel<XYChart>(chart);
if(temPanel != null){
Text.frame.remove(temPanel);
}
temPanel = chartPanel;
Text.frame.add(chartPanel);
Text.frame.setVisible(true);
System.out.println("学生六月份五级短文翻译各知识点分值情况图");
}
});
menuItem1.setFont(font);
menuItem2.setFont(font);
menuItem3.setFont(font);
menuItem4.setFont(font);
menuItem5.setFont(font);
menuItem6.setFont(font);
menuItem9.setFont(font);
menuItem10.setFont(font);
menuItem11.setFont(font);
menuItem12.setFont(font);
menu.add(menu1);
menu.add(menu2);
menu.add(menu3);
menu.add(menu4);
return menu;
}
}