Corba
--哪家的 CORBA? Java 和 哪个语言通过 CORBA 连接?

解决方案 »

  1.   

    都是Java的Corba。主要目的是用来做远程通信。当返回值里有中文字符串的时候就出错。
      

  2.   

    就出错
    --what's error message
      

  3.   

    在corba中使用wstring代替string类型.
      

  4.   

    老大,你这段程序诊锻炼人!!改完以后,足够可以去拿SCJP了
    如下,没问题!import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class MyWork
    {
      public static void main(String args[])
      {
    Jsp jsp = new Jsp();
    TopPanel panel= new TopPanel(jsp);
    TopPanel.GJApp app= panel.new GJApp();
    app.launch(new Jf(panel,jsp),"泰能电子",150,150,600,350); //cannot resolve symbol:Class GJApp
      }
    }
    class Jf extends JFrame
    {
      public Jf(TopPanel panel,Jsp jsp)
      {
        getContentPane().add(jsp,BorderLayout.CENTER);
        getContentPane().add(panel,BorderLayout.NORTH);
        getContentPane().add(panel.new LeftPanel(),BorderLayout.EAST);//cannot resolve symbol:LeftPanel(),LEFT
      }
    }
    class Jsp extends JScrollPane
    {
      int rows=3,cols=5;
      Object[] rowData=new Object[cols];
      public DefaultTableModel model=new DefaultTableModel();
      JTable table=new JTable(model);  Jsp()
      {
        for (int c=0;c<cols;c++)
        {
      model.addColumn("Column"+Integer.toString(c));
        }
    for (int r=0;r<rows;r++)
    {
      for (int c=0;c<cols;c++)
      {
        rowData[c]="("+r+","+c+")";
      }
    model.addRow(rowData);
    }
      }
    }
    class TopPanel extends JPanel
    {
      JButton rowBtn=new JButton("增加记录");
      JButton colBtn=new JButton("增加字段");
      JButton saveBtn=new JButton("保存");
      JButton delBtn=new JButton("删除");
      JButton exitBtn=new JButton("退出");  TopPanel(final Jsp jsp)
      {
        setLayout(new FlowLayout());
    add(rowBtn);
    add(colBtn);
    add(saveBtn);
    add(delBtn);
    add(exitBtn);rowBtn.addActionListener(new ActionListener()
    {
          public void actionPerformed(ActionEvent e)
      {
        int rowCount=jsp.model.getRowCount();//cannot resolve symbol:variable model
        int colCount=jsp.model.getColumnCount();//cannot resolve symbol:variable model        if (colCount>jsp.rowData.length)//cannot resolve symbol:variable rowData
            {
          jsp.rowData=new Object[colCount];//cannot resolve symbol:variable rowData
            }    for (int c=0;c<jsp.cols;c++)//cannot resolve symbol:variable cols
        {
          jsp.rowData[c]="("+rowCount+","+c+")";//cannot resolve symbol:variable rowData
        }
        jsp.model.addRow(jsp.rowData);//cannot resolve symbol:variable model,rowData
      }
        }
    );    colBtn.addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
        int colCount=jsp.model.getColumnCount();//cannot resolve symbol:variable model
    jsp.model.addColumn("Column"+colCount);//cannot resolve symbol:variable model
    jsp.table.sizeColumnsToFit(-1);//cannot resolve symbol:variable table
      }
    }
    );saveBtn.addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
      }
    }
        );delBtn.addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
      }
    }
    );exitBtn.addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
      }
    }
    );
    }
    class LeftPanel extends JPanel
    {
      LeftPanel()
      {
        setBackground(Color.green);
      }
    }public class GJApp extends WindowAdapter
    {
       private JPanel statusArea=new JPanel();//inner classes cannot have static declarations
       private JLabel status=new JLabel("");//inner classes cannot have static declarations
       private ResourceBundle resources;//inner classes cannot have static declarations  public  void launch(final JFrame f,String title,final int x,final int y,final int w,final int h)//inner classes cannot have static declarations
      {
        launch(f,title,x,y,w,h,null); 
      }
      
      public  void launch(final JFrame f,String title,final int x,final int y,final int w,final int h,String propertiesFilename)//inner classes cannot have static declarations
      {
        f.setTitle(title);
        f.setBounds(x,y,w,h);
        f.setVisible(true);    statusArea.setBorder(BorderFactory.createEtchedBorder());
        statusArea.setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
        statusArea.add(status);
        status.setHorizontalAlignment(JLabel.LEFT);    f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);    if(propertiesFilename!=null)
        {
          resources=ResourceBundle.getBundle(propertiesFilename,Locale.getDefault());
        }    f.addWindowListener(new WindowAdapter()
        {
          public void windowClosed(WindowEvent e)
          {
            System.exit(0);
          }
        }
    );
      }
      
       public JPanel getStatusArea()//inner classes cannot have static declarations
      {
        return statusArea;
      }
      
       public void showStatus(String s)//inner classes cannot have static declarations
      {
        status.setText(s);
      }
      
       String getResource(String key)//inner classes cannot have static declarations
      {
        if(resources!=null)
        {
          return resources.getString(key);
        }
        return null;
      }
    }
    }