The moose likes Swing / AWT / SWT and the fly likes Frames Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Frames" Watch "Frames" New topic


dhanasekaran mani

Joined: Aug 29, 2006
Posts: 6
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

Joined: Jun 09, 2003
Posts: 4632
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

wood burning stoves
subject: Frames
Similar Threads
can object only be created in classes with a "main"?
Is possible to get variable name in java?
packages and import
doubt ->Accessing from default package
How to use package?