public void widgetSelected(SelectionEvent arg0) {
Cserver =new ChatServer();
serverDialog = new ConfigureServerInfo()
}ChatServer和ConfigureServerInfo是另外两个类文件,调试时ChatServer类可以正确的new出来,但是ConfigureServerInfo类却跟到了如下代码中
private synchronized Class loadClassInternal(String name)
throws ClassNotFoundException
{
return loadClass(name);
}
上面代码时java自带代码。
请高手帮忙看下,其中IDE编译没有错误。
Cserver =new ChatServer();
serverDialog = new ConfigureServerInfo()
}ChatServer和ConfigureServerInfo是另外两个类文件,调试时ChatServer类可以正确的new出来,但是ConfigureServerInfo类却跟到了如下代码中
private synchronized Class loadClassInternal(String name)
throws ClassNotFoundException
{
return loadClass(name);
}
上面代码时java自带代码。
请高手帮忙看下,其中IDE编译没有错误。
解决方案 »
- 初学者问题:JAVA到底能开发什么软件?
- 如何根据已知的方法名调用类里以此命名的方法
- 有应用服务器还要http服务器干什么?
- \t 这个制表字符,我从来就没用好过。有时宽,有时窄,有人知道怎么使用吗?
- 需要写一个小游戏,能不能帮忙想想?
- java访问数据库的问题
- 想做一个java定时器,大家有这样的源代码吗?高分重谢
- 请问怎么在字符界面上输入一个LONG,FLOAT等类型的数值给变量,有什么函数可以做到吗?
- 求j2sdk-1_3_1_01-linux-i386.bin,能给个下载地址吗(教育网)而不是(java.sun.com)
- 高手们,有没有人能解决java 数据报表问题啊!
- 2007年最新技术
- split的用法
楼上的对应的包具体指什么?
/*
* 创建日期 2007-1-9
*
* TODO 要更改此生成的文件的模板,请转至
* 窗口 - 首选项 - Java - 代码样式 - 代码模板
*//**
* @author Administrator
*
* TODO 要更改此生成的类型注释的模板,请转至
* 窗口 - 首选项 - Java - 代码样式 - 代码模板
*/
public class ChatServer {
// ServerInterface serverInterface; public static void main(String[] args) {
new ServerInterface();
}
}//ServerInterface.java
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;/*
* 创建日期 2007-1-9
*
* TODO 要更改此生成的文件的模板,请转至
* 窗口 - 首选项 - Java - 代码样式 - 代码模板
*//**
* @author Administrator
*
* TODO 要更改此生成的类型注释的模板,请转至
* 窗口 - 首选项 - Java - 代码样式 - 代码模板
*/
public class ServerInterface { /**
* Launch the application
* @param args
*/
public ServerInterface() {
final Display display = Display.getDefault();
final Shell shell = new Shell();
shell.setSize(500, 375);
shell.setText("SWT Application");
// shell.open(); final Button bConfigure = new Button(shell, SWT.NONE);
bConfigure.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent arg0) { //就是下面这个对象new 不出来
ConfigureServerInfo configureServerInfo =new ConfigureServerInfo(shell);
}
});
bConfigure.setText("bConfigure");
bConfigure.setBounds(110, 256, 44, 23);
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
}//ConfigureServerInfo.java
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
/*
* 创建日期 2007-1-9
*
* TODO 要更改此生成的文件的模板,请转至
* 窗口 - 首选项 - Java - 代码样式 - 代码模板
*//**
* @author Administrator
*
* TODO 要更改此生成的类型注释的模板,请转至
* 窗口 - 首选项 - Java - 代码样式 - 代码模板
*/
public class ConfigureServerInfo extends Dialog { protected Object result; protected Shell shell; /**
* Create the dialog
* @param parent
* @param style
*/
public ConfigureServerInfo(Shell parent, int style) {
super(parent, style);
} /**
* Create the dialog
* @param parent
*/
public ConfigureServerInfo(Shell parent) {
this(parent, SWT.NONE);
} /**
* Open the dialog
* @return the result
*/
public Object open() {
createContents();
shell.open();
shell.layout();
Display display = getParent().getDisplay();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
return result;
} /**
* Create contents of the dialog
*/
protected void createContents() {
shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
shell.setSize(500, 375);
shell.setText("SWT Dialog");
//
}
}
//就是下面这个对象new 不出来
ConfigureServerInfo configureServerInfo =new ConfigureServerInfo(shell);
*
*/
public test() {
// TODO 自动生成构造函数存根
}}
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;这个包我没有 T_T
我重现不了你的问题了...555555555555555
new testB();
}
}//testC.java
public class testC { /**
*
*/
public testC() {
// TODO 自动生成构造函数存根
}}
//testC.java
public class testC { /**
*
*/
public testC() {
// TODO 自动生成构造函数存根
}}
//testB.java
public class testB { /**
*
*/
public testB() {
new testC();
new testA();
// TODO 自动生成构造函数存根
}}我在//testB.java文件中new testC();处设置断点调试,new testC();时失败,new testA();可以成功,搞了很久实在是搞不清楚为什么?请指点下
private synchronized Class loadClassInternal(String name)
throws ClassNotFoundException
{
return loadClass(name);
}我以为异常了,就是new失败了,其实是正常的,继续运行后边会new的。