This one is cool. Very useful to inspect those flags
http://q-redux.blogspot.com/2011/01/inspecting-hotspot-jvm-options.html
This one is cool. Very useful to inspect those flags
http://q-redux.blogspot.com/2011/01/inspecting-hotspot-jvm-options.html
[java]
public void actionPerformed(ActionEvent e) {
Thread thread = new Thread(new Runnable() {
public void run() {
try {
doExpensiveOperation();
}
catch(SomeException e) {
JOptionPane.showMessageDialog(….);
}
}
});
thread.start();
}
[/java]
This needs no explanation.
[java]
public void actionPerformed(ActionEvent e) {
Thread thread = new Thread(new Runnable() {
public void run() {
doExpensiveOperation();
completed = true;
}
});
completed = false;
thread.start();
//Wait for expensive thread to complete.
while (!completed) {
try {
Thread.sleep(100);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
}
}
[/java]