JAVAEclipse:could not find the main class,program will exit!

JAVAEclipse:could not find the main class,program will exit!

题目
JAVAEclipse:could not find the main class,program will exit!
我在Eclipse中写了以下一个程序:
import java.awt.*;
import javax.swing.*;
import javax.swing.tree.*;
import javax.swing.event.*;
//森林状的关系图
public class JTreeDemo
extends JFrame{
JTextField jtfInfo; //文本域,用于显示点击的节点名称

public JTreeDemo(){
super("森林状的关系图"); //调用父类构造函数

DefaultMutableTreeNode root = new DefaultMutableTreeNode("设置"); //生成根节点
DefaultMutableTreeNode node1=new DefaultMutableTreeNode("常规"); //生成节点一
node1.add(new DefaultMutableTreeNode("默认路径")); //增加新节点到节点一上
node1.add(new DefaultMutableTreeNode("保存选项"));
root.add(node1); //增加节点一到根节点上
root.add(new DefaultMutableTreeNode("界面"));
root.add(new DefaultMutableTreeNode("提示声音"));
root.add(new DefaultMutableTreeNode("打印"));

JTree tree = new JTree(root); //得到JTree的实例
DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer)tree.get
答案
我试过了,你的程序没有任何问题,你运行的方式可能不正确.你在eclipse中用右键点击JTreeDemo.java文件“选择运行”->"java 应用程序"的方式运行试试,没问题的————————————————————————出现这...
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
最新试题
热门考点

超级试练试题库

© 2017-2019 超级试练试题库,All Rights Reserved.