netbeans6.5 - java JFrames

is there a way i could make a button display a form only once?that is i have two jframe(courses and main page);at one jframe (main page),i have a jbutton that when i click on it the other jframe opens(the code at the button's event:courses frame=new courses(); frame.setVisible(true);but the issue is that i want when the jframe opens and i click on the button agin while it is open, not to display the the same form again not unless i have closed the opened one.Thanks in advance...Read more