鄙人刚学JAVA,有两个简单问题,请大家不吝赐教。多谢多谢。

getian 2003-04-14 01:21:58
1、J2EE、JDK、VJ、JBUILDER是什么关系啊,我们学校里讲的是SUM的JDK1。4,用的是JBUILDER,我在家用VJ编程,可是大家讨论的是J2EE,都是些什么概念啊?

2、我用VJ,产生的是APPLET,可它居然报错:“FontSize"是未定义标识符,
老大,那可是标准的JAVA对象啊,JDK和MSDN里都有讲到的,老师让我去下一个新一点JDK来装一下,说可能是版本不对。 但我用的是VJ呀,到底是怎么回事啊,该怎么办啊? 下一个新的JDK1.4来装真的有用吗?
...全文
42 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
GuoYangHai 2003-04-15
  • 打赏
  • 举报
回复
FontSize.CELLHEIGHT
FontSize是一個類嗎,好像沒有聲明
hui_hui_lin 2003-04-15
  • 打赏
  • 举报
回复
用sun one吧
jettyl 2003-04-15
  • 打赏
  • 举报
回复
不要用VJ,VJ早就被淘汰了
初学者推荐用JCreator
JBuilder也比较方便
sun980346 2003-04-15
  • 打赏
  • 举报
回复
老兄,不要用VJ,用JB吧,初学的话也可以用JCreater,JDK1.4.1是比较新的的JDK,有什么问题可以去sun的网站去看看。
徐蕴 2003-04-15
  • 打赏
  • 举报
回复
vj不好,不支持java 2
直接用jdk就可以了
hoxisoft 2003-04-15
  • 打赏
  • 举报
回复
别用VJ
getian 2003-04-14
  • 打赏
  • 举报
回复
我出错的代码:
import java.awt.*;
import java.applet.*;
import java.awt.event.* ;

public class ex3d extends Applet implements TextListener, ActionListener
{
TextArea text1,text2; TextField text3,text4;
Label 颜色,字体;
Button copyto;
public void init()
{
setLayout(null);
text1=new TextArea();
text2=new TextArea();
text3=new TextField();
text4=new TextField();
copyto=new Button("复制");
颜色=new Label ("设置颜色:");
字体=new Label ("设置字体:");
add(text1);add(text2);add(text3);add(text4);
add(copyto);add (颜色);add(字体);
text1.setBounds(10,10,170,220);
text2.setBounds (270,10,170,220);
text3.setBounds (10,270,170,20);
text4.setBounds (270,270,170,20);
copyto.setBounds (190,100,60,20);
颜色.setBounds (10,245,60,20);
字体.setBounds (270,245,60,20);
text3.addTextListener(this);
text4.addTextListener(this);
copyto.addActionListener(this);
}
public void textValueChanged(TextEvent e)
{
String tempStr;
Font f;
if (e.getSource()==text3)
{
tempStr=text3.getText ();
if(tempStr.equals("red"))
{
text2.setBackground (Color.red);
}
else if (tempStr.equals("black"))
{
text2.setBackground (Color.black);
}
else if (tempStr.equals("green"))
{
text2.setBackground (Color.green);
}
else if (tempStr.equals("yellow"))
{
text2.setBackground (Color.yellow);
}
else if (tempStr.equals("pink"))
{
text2.setBackground (Color.pink);
}
else if (tempStr.equals("blue"))
{
text2.setBackground (Color.blue);
}
else if (tempStr.equals("white"))
{
text2.setBackground (Color.white);
}

else if (tempStr.equals("orange"))
{
text2.setBackground (Color.orange );
}
else if (tempStr.equals("magenta"))
{
text2.setBackground (Color.magenta );
}
else if (tempStr.equals("cyan"))
{
text2.setBackground (Color.cyan);
}

}
else if (e.getSource() ==text4)
{
tempStr=text4.getText ();
if (tempStr.equals ("粗体"))
{
f=new Font("宋体",Font.BOLD,18);
text2.setFont (f);
}
else if (tempStr.equals ("恢复"))
{
f=new Font("宋体",Font.PLAIN ,20);
text2.setFont (f);
}
else if (tempStr.equals ("斜体"))
{
f=new Font("宋体",Font.ITALIC ,20);
text2.setFont (f);
}
else if (tempStr.equals ("大"))
{
f=new Font("宋体",text2.getFont().getSize() +1,FontSize.CELLHEIGHT);//这里报告错误
text2.setFont (f);
}
else if (tempStr.equals ("小"))
{
f=new Font("宋体",text2.getFont().getSize ()-1,FontSize.CELLHEIGHT);
text2.setFont (f);
}
}
}
public void actionPerformed(ActionEvent e)
{
if (e.getSource() ==copyto)
{
text2.setText (text1.getText ());
}
}
}
kbb 2003-04-14
  • 打赏
  • 举报
回复
up

62,623

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧