Two Laptop Bag*
The moose likes Beginning Java and the fly likes How to navigate in a standalone application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to navigate in a standalone application" Watch "How to navigate in a standalone application" New topic
Author

How to navigate in a standalone application

Chris Creed
Ranch Hand

Joined: Feb 27, 2009
Posts: 67

Hello all.

I'm authoring a simple program, has a few different menu options, that sort of thing. However what I'm wondering is when you make such a program, how do switch to another section of your program when say you click on a menu option or what not. If it was a web application it'd be as simple as having a link and loading a new page for the user, but for a standalone application I'm at a loss. I hope I've explained this decently enough as to what I' trying to explain, and that someone can point me to how this can be done.

EDIT: The application situation in question would be a GUI based app.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41880
    
  63
That sounds like a use case for a java.awt.CardLayout: http://java.sun.com/docs/books/tutorial/uiswing/layout/card.html


Ping & DNS - my free Android networking tools app
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38881
    
  23
Command-line or Swing GUI?
Chris Creed
Ranch Hand

Joined: Feb 27, 2009
Posts: 67



That could work with some "pages" that I was thinking of for an app actually.
Campbell Ritchie wrote:Command-line or Swing GUI?


Swing GUI.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to navigate in a standalone application