Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Newbe question

 
JeF Ald
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have been developing applets for a month or so and they work great but now i am trying to create different classes and be able to call the other classess for examble i have a login class and once that is validated i want the applet to be cleared and my MainMenu applet to be run and from there be able to call other applets by clicking next or enter i have not been able to accomplish this if anyone could please help i would be extremely greatefull
 
Jason Kretzer
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I am not mistaken you can set up several GUI's and then trigger a switch between the by changing the content pane of your main window.
Kind of like this: You have a JFrame as the main window. You make up several JPanels with different guis. You can use the setContentPane method of JFrame to switch between them.
HTH,
 
Dave Wingate
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might be too simple of an answer, but I'll throw it out any way. Why not change the layout manager of your applet to CardLayout since it is designed to easily switch the panel displayed in your gui?
 
Younes Essouabni
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't it possible to load several classes?
 
Karl Laird
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think what you really want to do is to use new frames rather than a whole new applet.
Rather that calling a standalone applet it would be better to have all the GUI for your application in different classes (rather than applets) and either (as previously mentioned) use card layout or the show() / hide() of the JFrame / whichever class to display / remove each GUI component.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic