hzglsd hzglsd
关注数: 3 粉丝数: 26 发帖数: 709 关注贴吧数: 66
js清除缓存问题! doFormatVal:function(){ getByID("column_tip").innerHTML = "(可以添加多个选项, 每行代表一个选项)"; getByID("row_tip").innerHTML = "(可以添加多个矩阵行, 每行代表一个矩阵行)"; var column = getByID("column_").value; var row = getByID("row_").value; var title = getByID("title_").value; if(title == "" || title.length<=0){ alert("请填写标题!"); return false; } var sz = column.split("\n"); for(var i=0; i<sz.length;i++){ if(sz[i]==" "){ sz.remove(i); } } for(var i=0;i<sz.length;i++){ var temp = sz[i].trim(); if(temp != ""){ for(var j=i+1; j< sz.length;j++){ if(temp == sz[j].trim()){ alert("第"+(i+1)+"项和第"+(j+1)+"项"+"重复"); return; } } } } var columnDisplay = getByID("item_column").style.display; if(columnDisplay == "block"){ if(column.trim() == ""){ getByID("column_tip").innerHTML = "<font color='red'><strong>问题选项必须填写!</strong></font>"; return false; } } var rowDisplay = getByID("item_row").style.display; if(rowDisplay == "block"){ if(row.trim() == ""){ getByID("row_tip").innerHTML = "<font color='red'><strong>矩阵行必须填写!</strong></font>"; return false; } } if($.browser.msie){ getByID("column_").value = column.replace(/\r\n(\r\n)+/g,'\r\n').replace(/(\r\n)+$/g,''); getByID("row_").value = row.replace(/\r\n(\r\n)+/g,'\r\n').replace(/(\r\n)+$/g,''); } else{ getByID("column_").value = column.replace(/\n(\n)+/g,'\n').replace(/\n+$/g,''); getByID("row_").value = row.replace(/\n(\n)+/g,'\n').replace(/\n+$/g,''); } var columnNum = column.split("\n"); var rowNum = row.split("\n"); if(columnNum.length > 10){ getByID("column_tip").innerHTML = "<font color='red'><strong>问题选项不能超过10项!</strong></font>"; return false; } if(rowNum.length > 10){ getByID("row_tip").innerHTML = "<font color='red'><strong>矩阵项不能超过10项!</strong></font>"; return false; } return true; },
求高手帮我 public class JFreeChartUtil { public static String buildChart(List<QiResult> qiResultList,QuestionWithBLOBs qwb,String rootPath)throws Exception{ int type = qwb.getQuestionType(); if(type == 1 || type == 2){//单选题//多选题 return getPie(qiResultList, qwb,rootPath)+"="+getBar(qiResultList, qwb,rootPath); }else if(type == 6|| type == 7){//矩阵单选题 return getBar2(qiResultList, qwb,rootPath); } return ""; } public static String getBar(List<QiResult> qiResultList,QuestionWithBLOBs qwb,String rootPath)throws Exception{ String optionStr = qwb.getQtOptions(); String[] optionsArray = SpecialStrUtil.filterSeparatorString_Array(optionStr); List<AnswerItemVo> answerItemVoList = new ArrayList<AnswerItemVo>(); AnswerItemVo answerItemVo = null; QiResult qiResult = null; for (int i = 0; i < qiResultList.size(); i++) { qiResult = qiResultList.get(i); answerItemVo = new AnswerItemVo(); answerItemVo.setColName(optionsArray); answerItemVo.setContent(qiResult.getResult()); answerItemVo.setId(qiResult.getId()); answerItemVo.setSeq(qwb.getQuestionSeq()); answerItemVo.setType(qwb.getQuestionType()); answerItemVoList.add(answerItemVo); } Map<String,Integer> data = AnswerStatisticsUtil.findSingleResultsInfo(answerItemVoList); DefaultCategoryDataset dataset=new DefaultCategoryDataset(); Set<String> set = data.keySet(); if(set != null){ for(Iterator<String> iter = set.iterator();iter.hasNext();){ String key = iter.next(); dataset.addValue(data.get(key),"",key); } } JFreeChart localJFreeChart = ChartFactory.createBarChart(qwb.getTitle(), "选项", "统计", dataset, PlotOrientation.VERTICAL, true, false, false); localJFreeChart.getRenderingHints().put(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); // 取得统一表的第一个图列 LegendTitle legend = localJFreeChart.getLegend(0); // 修改图例字体 legend.setItemFont(new Font("黑体", Font.BOLD, 14)); CategoryPlot localCategoryPlot = (CategoryPlot)localJFreeChart.getPlot(); localCategoryPlot.setDomainGridlinesVisible(true); localCategoryPlot.setRangeCrosshairVisible(true); localCategoryPlot.setRangeCrosshairPaint(Color.blue); //行内容 CategoryAxis rangeAxis = localCategoryPlot.getDomainAxis(); rangeAxis.setLabelFont(new Font("黑体", Font.BOLD, 14));// y轴的标题文字字体 rangeAxis.setTickLabelFont(new Font("黑体", Font.PLAIN, 14));// y轴坐标上数值字体 //列值 NumberAxis localNumberAxis = (NumberAxis)localCategoryPlot.getRangeAxis(); localNumberAxis.setLabelFont(new Font("黑体", Font.BOLD, 14));// X轴的标题文字字体 localNumberAxis.setTickLabelFont(new Font("黑体", Font.PLAIN, 14));// X轴坐标上数值字体
在线求解答,急!!! 可以的话加我QQ 396376770 远程帮看下,无限感激 Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at contro.ControATM.onRegAction(ControATM.java:91) at view.ATMRegFrame$3.actionPerformed(ATMRegFrame.java:107) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)
1 下一页