eclipse动态爱心代码,亲啊在用eclipse做动态网页的登录问题中代码显示没有错误可是

1,亲啊在用eclipse做动态网页的登录问题中代码显示没有错误可是1.把页面传过来的用户名和密码在后台打印出来看看有值么,有的话检查下你的用户查询的sql看看有问题不,2.把用户查询拼接的sql语句打印出来去数据库查查 , 看有没有问题
2,Eclipse的所有代码颜色都一样了求大佬帮忙啊setTextColor(Color.parseColor("#FFFFFF"));/*载入颜色#FFFFFF*/已有的Java文件做好备份恢复默认的主题 。颜色和字体主题依赖项目的存放路径的,可以先关闭eclipse,然后把workplace目录删了(项目源码做好备份),再启动eclipse,这时再创建一个新的workplace,名字和路径可以随便选择(注意,如果有项目要依赖之前的路径和名字的,最好和原来的一样),就可一恢复eclipse的默认主题和颜色了 。这种情况产生的原因主要有2种:一是系统,二是显卡和显卡驱动 。一般来说,你所说的这种问题在xp系统下很少出现 , 主要在vista和windows 7中出现的比较多,我用的win7系统就有这种情况; 另外一种比较多的情况就是显卡驱动,显卡问题倒不大,因为cs系列游戏对显卡要求并不高,但如果显卡的驱动安装的不合适的话就会出问题 。所以,我给你的建议是:先用驱动精灵或驱动之家,检查你的电脑的驱动,然后你选择显卡驱动进行下载安装,这样一般可以解决这些问题 。【eclipse动态爱心代码,亲啊在用eclipse做动态网页的登录问题中代码显示没有错误可是】
3 , 求一份爱心形状特征提取Copencv的代码整个项目的结构图:编写DetectFaceDemo.java,代码如下:[java] view plaincopyprint?package com.njupt.zhb.test;import org.opencv.core.Core;import org.opencv.core.Mat;import org.opencv.core.MatOfRect;import org.opencv.core.Point;import org.opencv.core.Rect;import org.opencv.core.Scalar;import org.opencv.highgui.Highgui;import org.opencv.objdetect.CascadeClassifier;// // Detects faces in an image, draws boxes around them, and writes the results // to "faceDetection.png". //public class DetectFaceDemopublic void run()System.out.println("\nRunning DetectFaceDemo");System.out.println(getClass().getResource("lbpcascade_frontalface.xml").getPath());// Create a face detector from the cascade file in the resources // directory. //CascadeClassifier faceDetector = new CascadeClassifier(getClass().getResource("lbpcascade_frontalface.xml").getPath()); //Mat image = Highgui.imread(getClass().getResource("lena.png").getPath()); //注意:源程序的路径会多打印一个/,因此总是出现如下错误/** Detected 0 faces Writing faceDetection.png libpng warning: Image* width is zero in IHDR libpng warning: Image height is zero in IHDR* libpng error: Invalid IHDR data*///因此,我们将第一个字符去掉 String xmlfilePath=getClass().getResource("lbpcascade_frontalface.xml").getPath().substring(1);CascadeClassifier faceDetector = new CascadeClassifier(xmlfilePath);Mat image = Highgui.imread(getClass().getResource("we.jpg").getPath().substring(1));// Detect faces in the image. // MatOfRect is a special container class for Rect. MatOfRect faceDetections = new MatOfRect();faceDetector.detectMultiScale(image, faceDetections);System.out.println(String.format("Detected %s faces", faceDetections.toArray().length));// Draw a bounding box around each face. for (Rect rect : faceDetections.toArray())Core.rectangle(image, new Point(rect.x, rect.y), new Point(rect.x + rect.width, rect.y + rect.height), new Scalar(0, 255, 0));}// Save the visualized detection. String filename = "faceDetection.png";System.out.println(String.format("Writing %s", filename));Highgui.imwrite(filename, image);}}package com.njupt.zhb.test;import org.opencv.core.Core;import org.opencv.core.Mat;import org.opencv.core.MatOfRect;import org.opencv.core.Point;import org.opencv.core.Rect;import org.opencv.core.Scalar;import org.opencv.highgui.Highgui;import org.opencv.objdetect.CascadeClassifier;//// Detects faces in an image, draws boxes around them, and writes the results// to "faceDetection.png".//public class DetectFaceDemopublic void run()System.out.println("\nRunning DetectFaceDemo");System.out.println(getClass().getResource("lbpcascade_frontalface.xml").getPath());// Create a face detector from the cascade file in the resources// directory.//CascadeClassifier faceDetector = new CascadeClassifier(getClass().getResource("lbpcascade_frontalface.xml").getPath());//Mat image = Highgui.imread(getClass().getResource("lena.png").getPath());//注意:源程序的路径会多打印一个/,因此总是出现如下错误/** Detected 0 faces Writing faceDetection.png libpng warning: Image* width is zero in IHDR libpng warning: Image height is zero in IHDR* libpng error: Invalid IHDR data*///因此,我们将第一个字符去掉String xmlfilePath=getClass().getResource("lbpcascade_frontalface.xml").getPath().substring(1);CascadeClassifier faceDetector = new CascadeClassifier(xmlfilePath);Mat image = Highgui.imread(getClass().getResource("we.jpg").getPath().substring(1));// Detect faces in the image.// MatOfRect is a special container class for Rect.MatOfRect faceDetections = new MatOfRect();faceDetector.detectMultiScale(image, faceDetections);System.out.println(String.format("Detected %s faces", faceDetections.toArray().length));// Draw a bounding box around each face.for (Rect rect : faceDetections.toArray())Core.rectangle(image, new Point(rect.x, rect.y), new Point(rect.x + rect.width, rect.y + rect.height), new Scalar(0, 255, 0));}// Save the visualized detection.String filename = "faceDetection.png";System.out.println(String.format("Writing %s", filename));Highgui.imwrite(filename, image); }}3.编写测试类:[java] view plaincopyprint?package com.njupt.zhb.test;public class TestMainpublic static void main(String[] args)System.out.println("Hello, OpenCV");// Load the native library. System.loadLibrary("opencv_java246");new DetectFaceDemo().run();}}//运行结果://Hello, OpenCV ////Running DetectFaceDemo ///E:/eclipse_Jee/workspace/JavaOpenCV246/bin/com/njupt/zhb/test/lbpcascade_frontalface.xml //Detected 8 faces //Writing faceDetection.pngpackage com.njupt.zhb.test;public class TestMainpublic static void main(String[] args)System.out.println("Hello, OpenCV");// Load the native library.System.loadLibrary("opencv_java246");new DetectFaceDemo().run(); }}//运行结果://Hello, OpenCV////Running DetectFaceDemo///E:/eclipse_Jee/workspace/JavaOpenCV246/bin/com/njupt/zhb/test/lbpcascade_frontalface.xml//Detected 8 faces//Writing faceDetection.png1、opencv由一系列 c 函数和少量 c++ 类构成,同时提供了python、ruby、matlab等语言的接口,用类来组织,基本是c 。2、opencv2.0以后增加了对c++风格代码的兼容 。vs2008+opencv2.1,所有的函数他都是有的 , 可以直接调用 。
4,求个eclipse的java代码靠 , 悬赏分:0 还要求代码晕死天下没有免费的午餐package javatest;import java.awt.frame;import java.awt.textfield;import java.awt.rectangle;import java.awt.button;import java.awt.componentorientation;import java.awt.dimension;import javax.swing.jcomponent;import javax.swing.jtooltip;import javax.swing.tooltipmanager;public class 计算器 extends frameprivate static final long serialversionuid = 1l; private textfield textfield = null; private button button = null; private button button1 = null; private button button2 = null; private button button3 = null; private button button4 = null; private button button5 = null; private button button6 = null; private button button7 = null; private button button8 = null; private button button9 = null; private button button10 = null; private button button11 = null; private button button12 = null; private button button13 = null; private button button14 = null; private button button15 = null; private textfield textfield1 = null; private textfield textfield2 = null; private textfield textfield3 = null; private button button16 = null; /*** this method initializes textfield** @return java.awt.textfield*/ private textfield gettextfield()if (textfield == null)textfield = new textfield();textfield.setbounds(new rectangle(45, 30, 226, 16));textfield.setcomponentorientation(componentorientation.unknown);textfield.setname("textfield");}return textfield; } /*** this method initializes button** @return java.awt.button*/ private button getbutton()if (button == null)button = new button();button.setbounds(new rectangle(30, 72, 32, 33));button.setlabel("0");button.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()if(textfield2.gettext().equals(""))//必须加equals,不能写成if(textfield2.gettext=="")textfield1.settext(textfield1.gettext()+"0");textfield.settext(textfield.gettext()+"0");}elsetextfield3.settext(textfield3.gettext()+"0");textfield.settext(textfield.gettext()+"0");}}});}return button; } /*** this method initializes button1** @return java.awt.button*/ private button getbutton1()if (button1 == null)button1 = new button();button1.setbounds(new rectangle(91, 72, 32, 33));button1.setlabel("1");button1.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()if(textfield2.gettext().equals(""))textfield1.settext(textfield1.gettext()+"1");textfield.settext(textfield.gettext()+"1");}elsetextfield3.settext(textfield3.gettext()+"1");textfield.settext(textfield.gettext()+"1");}}});}return button1; } /*** this method initializes button2** @return java.awt.button*/ private button getbutton2()if (button2 == null)button2 = new button();button2.setbounds(new rectangle(146, 72, 32, 33));button2.setlabel("2");button2.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()if(textfield2.gettext().equals(""))textfield1.settext(textfield1.gettext()+"2");textfield.settext(textfield.gettext()+"2");}elsetextfield3.settext(textfield3.gettext()+"2");textfield.settext(textfield.gettext()+"2");}}});}return button2; } /*** this method initializes button3** @return java.awt.button*/ private button getbutton3()if (button3 == null)button3 = new button();button3.setbounds(new rectangle(30, 114, 32, 33));button3.setlabel("3");button3.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()if(textfield2.gettext().equals(""))textfield1.settext(textfield1.gettext()+"3");textfield.settext(textfield.gettext()+"3");}elsetextfield3.settext(textfield3.gettext()+"3");textfield.settext(textfield.gettext()+"3");}}});}return button3; } /*** this method initializes button4** @return java.awt.button*/ private button getbutton4()if (button4 == null)button4 = new button();button4.setbounds(new rectangle(91, 114, 32, 33));button4.setlabel("4");button4.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()if(textfield2.gettext().equals(""))textfield1.settext(textfield1.gettext()+"4");textfield.settext(textfield.gettext()+"4");}elsetextfield3.settext(textfield3.gettext()+"4");textfield.settext(textfield.gettext()+"4");}}});}return button4; } /*** this method initializes button5** @return java.awt.button*/ private button getbutton5()if (button5 == null)button5 = new button();button5.setbounds(new rectangle(146, 114, 32, 33));button5.setlabel("5");button5.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()if(textfield2.gettext().equals(""))textfield1.settext(textfield1.gettext()+"5");textfield.settext(textfield.gettext()+"5");}elsetextfield3.settext(textfield3.gettext()+"5");textfield.settext(textfield.gettext()+"5");}}});}return button5; } /*** this method initializes button6** @return java.awt.button*/ private button getbutton6()if (button6 == null)button6 = new button();button6.setbounds(new rectangle(30, 155, 32, 33));button6.setlabel("6");button6.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()if(textfield2.gettext().equals(""))textfield1.settext(textfield1.gettext()+"6");textfield.settext(textfield.gettext()+"6");}elsetextfield3.settext(textfield3.gettext()+"6");textfield.settext(textfield.gettext()+"6");}}});}return button6; } /*** this method initializes button7** @return java.awt.button*/ private button getbutton7()if (button7 == null)button7 = new button();button7.setbounds(new rectangle(91, 155, 32, 33));button7.setlabel("7");button7.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()if(textfield2.gettext().equals(""))textfield1.settext(textfield1.gettext()+"7");textfield.settext(textfield.gettext()+"7");}elsetextfield3.settext(textfield3.gettext()+"7");textfield.settext(textfield.gettext()+"7");}}});}return button7; } /*** this method initializes button8** @return java.awt.button*/ private button getbutton8()if (button8 == null)button8 = new button();button8.setbounds(new rectangle(146, 155, 32, 33));button8.setlabel("8");button8.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()if(textfield2.gettext().equals(""))textfield1.settext(textfield1.gettext()+"8");textfield.settext(textfield.gettext()+"8");}elsetextfield3.settext(textfield3.gettext()+"8");textfield.settext(textfield.gettext()+"8");}}});}return button8; } /*** this method initializes button9** @return java.awt.button*/ private button getbutton9()if (button9 == null)button9 = new button();button9.setbounds(new rectangle(30, 201, 32, 33));button9.setlabel("9");button9.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()if(textfield2.gettext().equals(""))textfield1.settext(textfield1.gettext()+"9");textfield.settext(textfield.gettext()+"9");}elsetextfield3.settext(textfield3.gettext()+"9");textfield.settext(textfield.gettext()+"9");}}});}return button9; } /*** this method initializes button10** @return java.awt.button*/ private button getbutton10()if (button10 == null)button10 = new button();button10.setbounds(new rectangle(91, 201, 32, 33));button10.setlabel(".");button10.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()if(textfield2.gettext().equals(""))textfield1.settext(textfield1.gettext()+".");elsetextfield3.settext(textfield3.gettext()+".");}});}return button10; } /*** this method initializes button11** @return java.awt.button*/ private button getbutton11()if (button11 == null)button11 = new button();button11.setbounds(new rectangle(270, 73, 32, 30));button11.setlabel("+");button11.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()textfield2.settext("+");textfield.settext("");}});}return button11; } /*** this method initializes button12** @return java.awt.button*/ private button getbutton12()if (button12 == null)button12 = new button();button12.setbounds(new rectangle(270, 115, 32, 30));button12.setlabel("-");button12.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()textfield2.settext("-");textfield.settext("");}});}return button12; } /*** this method initializes button13** @return java.awt.button*/ private button getbutton13()if (button13 == null)button13 = new button();button13.setbounds(new rectangle(270, 157, 32, 30));button13.setlabel("*");button13.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()textfield2.settext("*");textfield.settext("");}});}return button13; } /*** this method initializes button14** @return java.awt.button*/ private button getbutton14()if (button14 == null)button14 = new button();button14.setbounds(new rectangle(270, 199, 32, 30));button14.setlabel("/");button14.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()textfield2.settext("/");textfield.settext("");}});}return button14; } /*** this method initializes button15** @return java.awt.button*/ private button getbutton15()if (button15 == null)button15 = new button();button15.setbounds(new rectangle(146, 201, 32, 33));button15.setlabel("=");button15.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()//double result;double result=0;double a=double.parsedouble(textfield1.gettext());double b=double.parsedouble(textfield3.gettext());if(textfield2.gettext().equals("+"))result=a+b;elseif(textfield2.gettext().equals("-"))result=a-b;elseif(textfield2.gettext().equals("*"))result=a*b;elseif(textfield2.gettext().equals("/")&&b!=0)result=a/b;textfield2.settext("");textfield3.settext("");string str=string.valueof(result);textfield.settext(str);textfield1.settext(str);}});}return button15; } /*** this method initializes textfield1** @return java.awt.textfield*/ private textfield gettextfield1()if (textfield1 == null)textfield1 = new textfield();textfield1.setbounds(new rectangle(47, 242, 81, 24));textfield1.settext("");textfield1.setname("textfield1");textfield1.setvisible(true);}return textfield1; } /*** this method initializes textfield2** @return java.awt.textfield*/ private textfield gettextfield2()if (textfield2 == null)textfield2 = new textfield();textfield2.setbounds(new rectangle(154, 242, 27, 24));textfield2.setname("textfield2");}return textfield2; } /*** this method initializes textfield3** @return java.awt.textfield*/ private textfield gettextfield3()if (textfield3 == null)textfield3 = new textfield();textfield3.setbounds(new rectangle(211, 241, 81, 24));textfield3.setname("textfield3");}return textfield3; } /*** this method initializes button16** @return java.awt.button*/ private button getbutton16()if (button16 == null)button16 = new button();button16.setbounds(new rectangle(286, 29, 41, 29));button16.setlabel("清空");button16.addactionlistener(new java.awt.event.actionlistener()public void actionperformed(java.awt.event.actionevent e)system.out.println("actionperformed()"); // todo auto-generated event stub actionperformed()textfield.settext("");textfield1.settext("");textfield2.settext("");textfield3.settext("");}});button16.addmouselistener(new java.awt.event.mouseadapter()public void mouseentered(java.awt.event.mouseevent e)system.out.println("mouseentered()"); // todo auto-generated event stub mouseentered()jtooltip jtt=new jtooltip();//工具提示jtt.settiptext("这是一个清空按钮");}});}return button16; } /*** @param args*/ public static void main(string[] args)// todo auto-generated method stubnew 计算器(); } /*** this is the default constructor*/ public 计算器()super();initialize();show(); } /*** this method initializes this** @return void*/ private void initialize()this.setlayout(null);this.setsize(339, 278);this.settitle("frame");this.add(gettextfield(), null);this.add(getbutton(), null);this.add(getbutton1(), null);this.add(getbutton2(), null);this.add(getbutton3(), null);this.add(getbutton4(), null);this.add(getbutton5(), null);this.add(getbutton6(), null);this.add(getbutton7(), null);this.add(getbutton8(), null);this.add(getbutton9(), null);this.add(getbutton10(), null);this.add(getbutton11(), null);this.add(getbutton12(), null);this.add(getbutton13(), null);this.add(getbutton14(), null);this.add(getbutton15(), null);this.add(gettextfield1(), null);this.add(gettextfield2(), null);this.add(gettextfield3(), null);this.add(getbutton16(), null); }}//@jve:decl-index=0:visual-constraint="96,21"我来,代码十分钟后加上来.(贴上来了)你不选我,我就跟你拼了!!!!! (仅针对没有奖的时候,现在随你了) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Test public static String getNumber(String message)//从键盘输入 System.out.println(message); String str=null; BufferedReader buf=new BufferedReader(new InputStreamReader(System.in)); try str=buf.readLine(); } catch (IOException e) // TODO Auto-generated catch block e.printStackTrace(); } return str; } //叛断输入的是不是一个数 public static String checkNumber()String str=null; str=getNumber("请输入一个数: "); int number=0; try number=Integer.parseInt(str); } catch (NumberFormatException e) // TODO Auto-generated catch block System.out.println("您输入的不是一个数..."); System.exit(1); } return str; } public static void isOrNotFiveAndHuiyan()int sum=0; String str=checkNumber(); if(str.length()!=5)System.out.println("不是一个五位数..."); System.exit(0); //判断是不是五位数 }elseSystem.out.println("这是一个五位数..."); } String str1=""; for(int i=0;i<str.length();i++)str1+=str.charAt(str.length()-i-1); } if(str1.equals(str))System.out.println("这是一个回文数: "); //判断是不是回文数 }elseSystem.out.println(str+","+str1); System.out.println("这不是一个回文数: "); } for(int i=0;i<str.length();i++)sum+=Integer.parseInt(str.charAt(i)+""); } System.out.println("这个回文数的各位和为: "+sum); } public static void main(String[] args)isOrNotFiveAndHuiyan(); } }

    推荐阅读