使用的jdk版本是多少?描述一下自己机器的软件环境和原码

解决方案 »

  1.   

    jdk版本是1.4.0我用的是Windows2000 Professionalimport java.awt.*;
    import java.applet.*;
    import java.awt.event.*;public class frame extends Applet implements ActionListener
    {
     public input_frame a_frame;
     public Button b_open,b_close;
     public TextArea the_message;
     boolean frame_visible;     
     
     public void init()
     {
      b_open = new Button("打开 frame");
      add(b_open);
       b_open.addActionListener(this);
      b_close = new Button("关闭 frame");
      add(b_close);
       b_close.addActionListener(this);
      the_message = new TextArea(5,20);
      add(the_message);
      frame_visible = false;
      a_frame = create_dialog("Input:\n");
     } public input_frame create_dialog(String the_title)
     {
      a_frame = new input_frame(the_title,this);
      a_frame.setSize(250,200);
      return a_frame;
     } public void actionPerformed(ActionEvent ev)
     {
      String label = ev.getActionCommand();  if(label.equals("Open frame")&&(!frame_visible))
      {
       a_frame.show();
       frame_visible = true;
      }  if(label.equals("Close frame")&&frame_visible)
      {
       a_frame.setVisible(false);
       frame_visible = false;
      }
     }
    }class input_frame extends Frame implements ActionListener
    {
     Button close_frame;
     TextArea text_space;
     frame my_parent; input_frame(String the_title,frame host)
     {
       super(the_title);
       FlowLayout fl;
       my_parent = host;
       fl = new FlowLayout();
       setLayout(fl);
       close_frame = new Button("Close frame");
       add(close_frame);
         close_frame.addActionListener(this);
       text_space = new TextArea("Input:\n",5,10);
       add(text_space);
     } public synchronized void setVisible(boolean visible)
     {
       String the_input;
       the_input = text_space.getText();
       my_parent.the_message.insert(the_input,0);
       my_parent.frame_visible = false;
       super.setVisible(visible);
     } public void actionPerformed(ActionEvent ev)
     {
       String label = ev.getActionCommand();
       
       if(label.equals("Close frame"))
            setVisible(false);
     }
    }在DOS下编译,在执行后,就是乱码
      

  2.   

    我遇到的问题是:jdk1.4做的Applet在别的机器上能够看到中文。我自己的反而不能。都用的是XP+jdk1.4的plugin.搞不懂!!!!
      

  3.   

    我的也是1.4的,居然连编译都过不了 ,说是::
    illegal character: \65292
      

  4.   

    我没有遇到过中文问题,我都用swing
      

  5.   

    我这边没有问题。可能跟编译的Encoding有.
      

  6.   

    我这边测试没有问题,可能跟编译时的encoding有关.设置一下试试。
      

  7.   

    只要在每一个页面中都加入<%@ page contentType="text/html;charset=gb2312"%>就可以了!
      

  8.   

    搞错了,应该是<meta http-equiv="Content-Type" content="text/html; charset=GBK"/>还要注意大小写!
      

  9.   

    Caibo(丰风) :怎么解决的?什么问题?