WebLogic与Corba!!Corba只能传送英文字符串,中文就报错!怎么办? Corba--哪家的 CORBA? Java 和 哪个语言通过 CORBA 连接? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 都是Java的Corba。主要目的是用来做远程通信。当返回值里有中文字符串的时候就出错。 就出错--what's error message 在corba中使用wstring代替string类型. 老大,你这段程序诊锻炼人!!改完以后,足够可以去拿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 modeljsp.model.addColumn("Column"+colCount);//cannot resolve symbol:variable modeljsp.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; }}} 好像是一道java面试题,但我运行代码后却没反应,求解? 求关于ibm wid wps简单事例 再战LUCKY52!!! Set类型和List类型之间如何互相转换? 关于 visual editor 中的 alignment tool 网络编程需要哪些语言?学JAVA是首选吗? 救命!大家来帮小弟一把!谢谢! 如何取得数组的长度? 在多线程中,为什么这两种写法有非常大的结果性的区别 java io缓冲问题 如何将一个双引号”放在一个字符串中,就是在字符串中如何转义一个双引号。谢谢! 如何得到控件的真实尺寸?
--what's error message
如下,没问题!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;
}
}
}