我正在尝试在后台运行一些代码,而主框架正在运行。但是当ı在代码下运行时,jframe正在打开,但在线程完成之前无法执行任何操作。我的主要方法是:
public static void main(String[] args) {
Thread thread = new Thread() {
@Override
public void run() {
CheckLicense license = new CheckLicense();
boolean check = license.checkUpdateStatus();
if (!check) {
HMessageBoxForLicenseControl control = new HMessageBoxForLicenseControl(null, null,
ModalityType.APPLICATION_MODAL,
TextResources.getInstance().getResourceValue("systemNotification"),
TextResources.getInstance().getResourceValue("licenseTimeOver"));
control.setVisible(true);
}
}
};
thread.start();
// System.setProperty("file.encoding", "UTF-8");
MainFrame window = new MainFrame();
window.frame.setVisible(true);
}