首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

求救!非法的表达式开始!该如何处理

2012-01-12 
求救!非法的表达式开始!!十万火急!!谢谢!!在publicvoidactionPerformed(ActionEventae)开始提示:非法的表

求救!非法的表达式开始!!
十万火急!!谢谢!!
在   public   void   actionPerformed(ActionEvent   ae)开始提示:非法的表达式开始
把这个PUBLIC屏蔽后在下面的每个public行都出现:非法的表达式开始
各路高手救命啊
源码:

import   java.awt.*;
import   java.awt.event.*;
import   java.rmi.*;
import   java.rmi.server.*;

public   class   client   extends   Frame   implements   ActionListener,KeyListener,Notfiable{
        int   flag   =   0;
        String   s;
        String   userName;
        String   welcome;
        String   input;
        TextArea   TextArea;
        TextField   inputText;
        Label   hello;
       
        RemoteInterface   server;
        public   client(){
                        addWindowListener(new   WindowAdapter(){
                              public   void   windowClosing(WindowEvent   e){
                                            System.exit(0);
                                      }
                              });
                              Panel   up   =   new   Panel();
                              Panel   down   =   new   Panel();
                              this.add(up,BorderLayout.NORTH);
                              this.add(down,BorderLayout.SOUTH);
                              welcome   =   "hello,stone!! ";
                              hello   =   new   Label(welcome);
                              TextArea   =   new   TextArea(s,15,50,TextArea.SCROLLBARS_BOTH);
                              TextArea.setEditable(false);
                              up.add(hello,BorderLayout.NORTH);
                              up.add(TextArea,BorderLayout.SOUTH);
                             
                              inputText   =   new   TextField(35);
                              Button   send   =   new   Button( "send ");


                              down.setBackground(Color.pink);
                              down.add(inputText);
                              down.add(send);
                             
                              send.addActionListener(this);
                              inputText.addKeyListener(this);
                              try{
                                        UnicastRemoteObject.exportObject(this);
                                      }catch(RemoteException   re){
                                                re.printStackTrace();
                                              }
                    //从这里开始,把这个屏蔽了下个public的地方又出现非法表达式的开始        
                  public   void   actionPerformed(ActionEvent   ae){
                                      if(ae.getActionCommand().equals( "send ")){
                                                try{
                                                        server.setChatText(userName+ ": "+inputText.getText());
                                                        inputText.setText(null);
                                                      }catch(RemoteException   re){
                                                                re.printStackTrace();
                                                              }
                                              }


                                      }
                                     
                            public   void   keyPressed(KeyEvent   ev){
                                        int   keyCode   =   ev.getKeyCode();
                                        if(keyCode==KeyEvent.VK_ENTER){
                                                try{
                                                                server.setChatText(userName+ ": "+inputText.getText());
                                                                inputText.setText(null);
                                                          }catch(RemoteException   re){
                                                                    re.printStackTrace();
                                                                  }
                                              }
                                      }        
                                     
                              public   void   keyReleased(KeyEvent   ev){}
                              public   void   keyTyped(KeyEvent   ev){}        
                              public   void   notify(Integer   reason){
                                        if(reason.intValue()==0){
                                                try{


                                                                input   =   server.getChatText();
                                                                s   =   TextArea.getText()+ "\r\n ";
                                                                TextArea.setText(s+input);
                                                            }catch(RemoteException   re){
                                                                        re.printStackTrace();
                                                                  }
                                              }
                                      }
                                     
                              public   static   void   main(String[]   args){
                                        if(args.length==0){
                                                    System.out.println( "USAGE:   java   <username> ");
                                                    System.exit(0);
                                                }
                                              System.setSecurityManager(new   RMISecurityManger());
                                              client   f   =   new   client();
                                              f.username   =   args[0];


                                              try{
                                                            f.server   =   (RemoteInterface)Naming.lookup( "rmi://127.0.0.1/test ");
                                                            f.server.registerForNotification(f);
                                                      }catch(Exception   e){
                                                                e.printStackTrace();
                                                              }
                                              f.setSize(400,350);
                                              f.show();                
                                      }        
                  }
      }


[解决办法]
这分。。。
[解决办法]
我也 jf
[解决办法]
..

热点排行