Java 在jframe运行时运行线程
我试图在主框架运行时在后台运行一些代码。但当ı在代码下面运行时,jframe正在打开,但在线程完成之前无法执行任何操作。我的主要方法是:Java 在jframe运行时运行线程,java,multithreading,jframe,Java,Multithreading,Jframe,我试图在主框架运行时在后台运行一些代码。但当ı在代码下面运行时,jframe正在打开,但在线程完成之前无法执行任何操作。我的主要方法是: public static void main(String[] args) { Thread thread = new Thread() { @Override public void run() { CheckLicense license = new CheckLicense();
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);
}