private void addSomeComponentsToFrame(){
JFrame frame = new JFrame();
.....
frame.setVisible(true);
frame.getContentPane().validate();
frame.getContentPane().repaint();
runOtherTask();
}
I want to see frame object and its components before runOtherTask method starts but when i try to run addSomeComponentsToFrame method, frame appears(as black rectangle) but freezes and after runOtherTask method completes it shows frame's components on screen.