use a CardLayout()
whatever displays in first.java, is card(0), then, instead of a frame for
second.java, use a JPanel, then add second.java as card(1)
the actionListener for the menuItem just has card.next(..), to display second.java
more info
http://java.sun.com/docs/books/tutorial/uiswing/layout/card.html