Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Frames

 
dhanasekaran mani
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
iam having a class called first.java which uses frames and menus, when Click the menu item name file, new class called second.java is executed, but it opens in a new window, i want the first.java container to display the execution of second.java

help me.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic