java+sql2000 ,懂java swing eclipsee高手帮帮忙

我用myeclipse运行J2ME程序为什么模拟器一闪而过,为什么,怎么解决?请诸位高手们帮帮忙?_百度知道
我用myeclipse运行J2ME程序为什么模拟器一闪而过,为什么,怎么解决?请诸位高手们帮帮忙?
我程序代码:import javax.microedition.lcdui.*;import javax.microedition.midlet.*;public class HelloWorld extends MIDlet implements CommandListener{private Command exitCprivate TextBpublic HelloWorld(){ exitCommand=new Command(&Exit&,Command.EXIT,1); tb=new TextBox(&Hello MIDlet&,&Hello Java World!&,12,0); tb.addCommand(exitCommand); tb.setCommandListener(this);}protected void startApp() throws MIDletStateChangeException{ Display.getDisplay(this).setCurrent(tb); System.out.println(&startApp&);}protected void pauseApp(){ System.out.println(&pauseApp&);}protected void destroyApp(boolean c) throws MIDletStateChangeException{ System.out.println(&destroyApp&);}public void commandAction(Command c,Displayable d){ if(c==exitCommand){
try{destroyApp(false); }catch(MIDletStateChangeException exception){
System.out.println(&MIDletStateChangeException&); } notifyDestroyed();}}}运行console面板现:通存储根 C:\Users\lenovo\j2mewtk\2.5.2\appdb\DefaultColorPhone 运行Running with locale: Chinese (Simplified)_People's Republic of China.936Running in the identified_third_party security domainjava.lang.IllegalArgumentException at javax.microedition.lcdui.TextField.setChars(+105) at javax.microedition.lcdui.TextField.setString(+27) at javax.microedition.lcdui.TextField.&init&(+168) at javax.microedition.lcdui.TextBox.&init&(+74) at HelloWorld.&init&(+35) at java.lang.Class.runCustomCode(+0) at com.sun.midp.midlet.MIDletState.createMIDlet(+34) at com.sun.midp.midlet.Scheduler.schedule(+52) at com.sun.midp.main.Main.runLocalClass(+28) at com.sun.midp.main.Main.main(+80)Execution completed.3387201 bytecodes executed46 thread switches1667 classes in the system (including system classes)17772 dynamic objects allocated (533496 bytes)2 garbage collections (456816 bytes collected)谢谢
提问者采纳
tb=new TextBox(&Hello MIDlet&,&Hello Java World!&,12,0);Hello Java World!已经查<img class="word-replace" src="/api/getdecpic?picenc=0af字符值设置点tb=new TextBox(&Hello MIDlet&,&Hello Java World!&,100,0);
提问者评价
非常感谢!
其他类似问题
一闪而过的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁初学servlet,很受打击啊,高手帮帮忙,绝对高分_百度知道
初学servlet,很受打击啊,高手帮帮忙,绝对高分
Tomcat 6.0目录&#92;webapps&#92;examples&#92;WEB-INF&#92;classes面文件例运行啊我运行都运行都现类似错误The requested resource (&#47;servlets&#47;servlet&#47;HelloWorldExample) is not available.我按照课本写例名字MyServlet.java用命令提示符编译候通MyServlet.class文件文件应该放位置听说放&#92;webapps&#92;ROOT&#92;WEB-INF&#92;classes面我目录没classes文件夹要自手创建听说要配置web.xmlweb.xml配置tomcat目录web.xml应该配置哪路劲才确配置
提问者采纳
....语都工具党离工具干WEB程序标准目录结构myproject&#92;WEB-INF&#92;classesmyproject&#92;WEB-INF&#92;web.xmlservlet类编译放classes包要建相应目录package org.myweb.demopublic class MyServlet目录 myproject&#92;WEB-INF&#92;classes&#92;org&#92;myweb&#92;demo&#92;MyServlet.classweb.xml
应用配置自工程myproject&#92;WEB-INF&#92;web.xml面能配东西自查servlet配适改&web-app&&servlet&
&servlet-name&meServlet&/servlet-name&
&servlet-class&org.myweb.demo.MyServlet&/servlet-class&
&/servlet&
&servlet-mapping&
&servlet-name&meServlet&/servlet-name&
&url-pattern&/hello&/url-pattern&
&/servlet-mapping&
&/web-app&myproject目录拷贝
TOMCAT&#92;webapps
(TOMCAT&#92;conf&#92;server.xml配置)启tomcat,浏览器输入址&url-pattern&/hello&/url-pattern&
址栏用请求通servlet-name
找由类执行至 DaveMa333答楼主目前状态添加页面适用带Web Context-root
工程 通eclipseorg.ponent 类似文件吧各工程目录文件合标准工程拷贝tomcat运行燃烧青春 答纯扯蛋初者该用工具都知其知所现面试包括工作二三都答我用工具配行知道原知道
liubc00000 给链接帮助a2159049 面说需要手创建classes句用工具目录 明白邮件联系
提问者评价
其他类似问题
按默认排序
其他6条回答
需要手创建classes于web.xml我要前项目WEB-INF找tomcat所目录找至于配置web.xml面添加几句每配置servlet都要web.xml添加 &servlet&
&servlet-name&名称&/servlet-name&
&servlet-class&
&/servlet-class& &/servlet&
&servlet-mapping& &servlet-name&名称(要与面名称致)&/servlet-name& &url-pattern&写找servlet路径比/helloWorldExample或*.do&/url-pattern& &/servlet-mapping&
强烈建议1.用开发工具开发2.你去看一下servlet的教学视频。这东西没这个容易说清楚。
如果你是用eclipse创建servlet的话就不用自己配置web.xml,不是的话就要自己配了。tomcat下虽然是很多web.xml,但是你tomcat的webapps文件夹就只有你examples这个项目,所以修改这个文件夹里的web.xml,具体配置参考下面:,不理解再问我
你创建的有项目吧,访问路径就是Web Context-root 里面的,在一般和项目名一样。在webapps下创建一个访问路径名(项目名)一样的文件夹,然后把WebRoot下的所有东西复制进去启动Tomcat ,访问吧
看样子楼主刚刚起步,推荐看一下韩顺平老师的视频,讲的很好,包你学会。
给你推荐个开发工具,Myeclipse配置好JDK之后在安装,不容配WEB.INF,tomcatapp文件夹就是用于存放你的项目在tomcat服务器发布之后生成的一些文件。如果自己配置WEB.INF文件的话,只需要配置,&WEB-SERVLET&和&web-mapping&两项就行了,具体检查的映射和名字,看是否正确!
servlet的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁关于在Eclipse中配置TomCat中的问题,高手帮帮忙啊_百度知道
关于在Eclipse中配置TomCat中的问题,高手帮帮忙啊
The selected server is enabled,but is not configured properly.Deployment to it will not be permitted until the problem is corrected.Please navigate to the server preference pages and verify the field with the prompt:Tomcat JDK name我TomCat的路径绝对正确,原因是什么啊?
Myeclipse已经成功安装在myeclipse-&application server-&tomcat5中的tomcat home directory,tomcat Base directory,tomcat Temp directory都配置正确了
提问者采纳
用Myeclipse
其他类似问题
按默认排序
其他2条回答
你tomcat没有配置啊.windows菜单,最后一项.点开myeclipse,application server.在找到tomcat,选择正确的版本,比如是5的版本,就选5的.选Enable,再选正确的tomcat的路径.就OK了.
myeclipse-&application server-&tomcat5-&jdk把jre的路径修改成jdk的路径
tomcat的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁java程序 有一个错误,不知道什么地方错了,望各位高手帮帮忙,谢谢了!_百度知道
java程序 有一个错误,不知道什么地方错了,望各位高手帮帮忙,谢谢了!
import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.event.*; public class junber8 extends JFrame implements ActionListener{
JSplitPane panev,
JScrollPane
scropane1,scrollpane2;
textarea1,textarea2;
JLabel label1,label2;
JTextField
field1,field2;
JRadioButton radiobutton1,radiobutton2;
button1,button2;
public junber8(){
super(&聊天室&);
textarea1=new JTextArea();
textarea1.setEditable(false);
scropane1=new JScrollPane(textarea1);
pleft=new JPanel();
label1=new JLabel(&输入&);
field1=new JTextField(20);
button1=new JButton(&发送&);
button1.addActionListener(this);pleft.add(label1);
pleft.add(field1);
pleft.add(button1);pright=new JPanel();label2=new JLabel(&性别&);
field2=new JTextField(&请输入信息&);
field2.setFont(new Font(&serif&,Font.PLAIN,14));
ButtonGroup bg=new ButtonGroup();
radiobutton1=new JRadioButton(&男&);
radiobutton1.setFont(new Font(&serif&,Font.PLAIN,14));
radiobutton1.setSelected(true);
radiobutton2=new JRadioButton(&女&);
radiobutton2.setFont(new Font(&serif&,Font.PLAIN,14));
button2=new JButton(&确定&);
bg.add(radiobutton1);
bg.add(radiobutton2);pright.add(label2);
pright.add(radiobutton1);
pright.add(radiobutton2);
pright.add(field2);
pright.add(button2);
panev=new JSplitPane(JSplitPane.VERTICAL_SPLIT,scropane1,pleft);
panev.setDividerLocation(280);
paneh=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,panev,pright);
paneh.setDividerLocation(350);
this.add(paneh);
this.setSize(600,500);
this.setLocation(300,300);
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
&#47;&#47;setVisible(true);}
public void actionPeformed(ActionEvent e){
source=e.getSource();
&#47;&#47;&发送&按钮
if(source==button1){
button1Click();
public void button1Click(){
field=field1.getText();
if(field.equals(&&)){
JOptionPane.showMessageDialog(button1,&内容不能为空&,&提示&,JOptionPane.WARNING_MESSAGE);
}public static void main(String args[]){
junber=new junber8();
junber.setVisible(true);
提问者采纳
public void actionPeformed(ActionEvent e){写错了 public void actionPerformed(ActionEvent e){
提问者评价
其他类似问题
java程序的相关知识
其他1条回答
你继承了ActionListener接口,就必须实现它的抽象方法,就这个:public void actionPerformed(ActionEvent e) {}添加了这个方法就好了。你可以用Eclipse编辑的话,他自动帮你查找错误并帮助你添加这一行代码。。。
您可能关注的推广回答者:回答者:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁}

我要回帖

更多关于 java swing eclipse 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信