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
Rep Power: 0
ibanez270dx is on a distinguished road
Default 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
  #2 (permalink)  
Old 11-12-2007, 11:10 PM
Member
 
Join Date: Nov 2007
Location: Bay Area, CA
Posts: 13
Rep Power: 0
ibanez270dx is on a distinguished road
Default
sorry, nevermind my question - I figured out that CardLayout will do the trick. Thanks!
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

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

BB 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 +2. The time now is 08:27 AM.



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