Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jumping from one frame to another..help me!!  RSS feed

 
Afida Sharifoedin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i am quite new to java. And i want to build a java application using JBuilder. My question is, how do we go from one frame to another. Supposed we have three frames now. One for logging in, and the other two is the window for admin and user. So how do i connect the frames? For example, in VB, if upon clicking the button 'admin' from the main menu (main.frm) and u wish to go to admin (admin.frm), the coding is gonna be

admin.Show
main.Hide
but what about java? Pls help. And it is frames that differentiate one window from another, right?
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Similar idea in Java. Essentially, you use either JFrame or JDialog classes, -- they are both subclasses of Window and as such have methods show(), hide(), and many others.
In a typical Java app, you would have what's known a Model-View-Controller (MVC) design pattern, where the controller would keep track of your frames and manipulate them in response to user actions.
 
Afida Sharifoedin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
eugene, can you pls show me the simplest example possible for moving from one frame to another frame (upon button click)?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!