• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Frames

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic