Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-12-2007, 10:31 PM
Member
 
Join Date: Nov 2007
Location: Bay Area, CA
Posts: 13
ibanez270dx is on a distinguished road
Control Structure Question
Hi Everyone,
I'm really new to Java and the control structure is kinda confusing to me... I would just like some clarifications. I have a class that loads up a GUI (with the init() thing) and it has a button in it. I want the user to click the button and then the program executes a bunch of tasks and displays a new JPanel. How would I structure this? Am I going to need 2 classes? One for the initial start JPanel (the panel takes up the whole applet) and one for the secondary panel? I do already have an applet that initializes a gui (JPanel and JButton) and when the button is pressed, it closes the JPanel. I'm just not sure in what manner I should open a new one and execute commands. I usually code PHP and HTML, so this is very different for me... I also haven't done OOP before. In brief, it looks like:

initialize applet --> opens JPanel with button. (user clicks button) --> closes current JPanel, opens new JPanel, and executes commands.

If anyone knows what I'm talking about, please help... I am really having a hard time with Java so far...

Thanks in advance,
- Jeff
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-12-2007, 11:10 PM
Member
 
Join Date: Nov 2007
Location: Bay Area, CA
Posts: 13
ibanez270dx is on a distinguished road
sorry, nevermind my question - I figured out that CardLayout will do the trick. Thanks!
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Array of Structure PAffiliates New To Java 1 01-28-2008 07:08 AM
data structure code vgvt New To Java 1 01-17-2008 03:49 PM
X11.Toolkit logging out of control gjsalazar AWT / Swing 0 11-21-2007 12:42 AM
Use if then else structure, help paul New To Java 1 08-07-2007 06:00 AM
Help with Structure Albert New To Java 1 07-13-2007 04:27 PM


All times are GMT +3. The time now is 06:51 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org