Modal action in swing form
Make form implement the interface LongRunningSubActionInterface
e.g.
-
private void startLongOperation() {
-
setEnabled(false);
-
this.getGlassPane().setVisible(true);
-
this.getGlassPane().repaint();
-
}
-
private void endLongOperation() {
-
setEnabled(true);
-
this.getGlassPane().setVisible(false);
-
this.setVisible(true);
-
}
Put the following in jbinit()
-
super.paint(g);
-
5 * 0.1f));
-
g.fillRect(0, 0, getWidth(), getHeight());
-
-
}
-
});
Then add actions as
-
{
-
putValue(NAME, m_strMenuOpen);
-
putValue(SMALL_ICON, getValue(LARGE_ICON_KEY));
-
}
-
-
//Write Code
-
//No need to if enabled
-
//No need for start or end long running operation
-
//No need for exception messagebox
-
}
-
};
google juice
Block Form Red Long Operation
RJM Article Type
Quick Reference