JAVA 책에 있는 코드를
제 나름대로 JBuilder로 옮겨서 실행을 해 봤는데요.
컴파일시에는 에러가 안 생기는데
실행을 하면
unable to start runtime due to incomplete configuration
이런 에러가 뜹니다.
도대체 뭐가 잘 못 된거죠?
전 JBuilder 8을 씁니다.
(파일 내용을 첨부합니다.
DirectoryJTree에서는 디렉토리를
FileTableModel에서는 파일을 보여주는 클래스이고
밑에 파일은 JExplorer이라는. DirectoryJTree와 FileTableModel을 불러와서 각각 하나씩의 JScollPane에보여주는 파일입니다.
아마 제 생각으로는 제가 JExplorer파일을 소스 그대로 친게 아니라,
디자인 탭에서 콤포넌트를 추가하고 적당한곳에 조금 수정을 가한것이 어딘가에 문제가 생긴것 같습니다.)
고수님들의 많은 부탁하래염~ ^^"
package jex;
import java.io.*;
import java.awt.*;
import java.util.*;
import java.beans.*;
import java.awt.event.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
public class JExplorer extends JFrame implements PropertyChangeListener{
FileTableModel model;
static ResourceBundle bundle;
static
{
try
{
bundle = ResourceBundle.getBundle("JExplorerResourceDundle");
}
catch(MissingResourceException mre)
{
}
}
XYLayout xYLayout1 = new XYLayout();
JScrollPane jScrollPane1;
JScrollPane jScrollPane2 = new JScrollPane();
JTable table;
public JExplorer()
{
super("JExplorer");
DirectoryJTree dt = new DirectoryJTree();
dt.addDirectoryPropertyChangeListener(this);
jScrollPane1= new JScrollPane(dt);
table = new JTable(model = new FileTableModel());
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
this.getContentPane().setLayout(xYLayout1);
this.getContentPane().add(jScrollPane1, new XYConstraints(5, 10, 236, 421));
this.getContentPane().add(jScrollPane2, new XYConstraints(249, 13, 263, 423));
jScrollPane2.getViewport().add(table, null);
}
public static String getResoutce(String key)
{
return bundle.getString(key);
}
public static String[] getResourceArray(String key)
{
return bundle.getStringArray(key);
}
public void propertyChange(PropertyChangeEvent evt)
{
File dir=(File)evt.getNewValue();
model.setDirectory(dir);
table.updateUI();
}
|