我正试图让所有打开的窗户.我尝试使用System.Windows.Application.Current.Windows但是我得到了Null Pointer Exception,其中foreach循环是.有谁知道出了什么问题?
public Window getWindow(String Title)
{
Window windowObject = null;
Console.WriteLine("Inside getWindow");
foreach (Window window in System.Windows.Application.Current.Windows)
{
if (window.Title == Title)
{
windowObject = window;
}
}
return windowObject;
}
Run Code Online (Sandbox Code Playgroud) 我对RegSvr32的dll注册有问题.在应用程序启动之前,一切都是在Java下以编程方式完成 我的问题是:
是否有任何解决方案禁用警报出现DLL注册的结果?这是一个"OK"按钮的提示.
谢谢你的建议.
我遇到了处理线程完成的类的问题.它可以通知其他线程,因为第二个线程可以启动.这是我的项目结构:
MainClass.java
public class MainClass implements ThreadCompleteListener {
public void main(String[] args) throws InterruptedException {
NotifyingThread test = new Thread1();
test.addListener((ThreadCompleteListener) this);
test.start();
}
@Override
public void notifyOfThreadComplete(Thread thread) {
// TODO Auto-generated method stub
}
}
Run Code Online (Sandbox Code Playgroud)
类 - Thread1.java
public class Thread1 extends NotifyingThread {
@Override
public void doRun() {
try {
metoda();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static synchronized void metoda() throws InterruptedException {
for(int i = 0; i …Run Code Online (Sandbox Code Playgroud)