Results 1 to 3 of 3
- 06-19-2010, 09:36 PM #1
Member
- Join Date
- Jun 2010
- Posts
- 2
- Rep Power
- 0
JFrame problem - need suggestions
Hi all.
I'm having the following problem:
I wrote an application - desktop application. It has a total of 5 windows. Each window is it's own class extending the Main class which extends the JFrame class.
Now, the problem is when I open and close the windows from within the application in Windows taskbar you can see windows closing and opening. I.e. when I switch a screen (window) in my application you can see the previous screen closing and new screen or a window opening. It looks a little funky in the taskbar.
Now, can someone suggest what would be the best approach to change this?
I was considering using the JInternalFrame instead of JFrame but this doesn't seem like a good solution.
Has anoyone been in a similar situation? What should I do?
The main goal is to change the screens within one window so taskbar wouldn't show many windows opening and closing.
Thank you all for your time and knowledge.
- 06-19-2010, 09:43 PM #2
Senior Member
- Join Date
- May 2010
- Posts
- 436
- Rep Power
- 4
You may wish to have a look at a CardLayout.
The general scheme here is to gear your GUI's to create JPanels, not JFrames, and in fact have the main app create the one and only JFrame. Then when you wish to change views, swap JPanel(s) in the JFrame by using a CardLayout. The Sun Swing tutorials can show you how to do this.
How to Use CardLayout (The Java™ Tutorials > Creating a GUI With JFC/Swing > Laying Out Components Within a Container)
- 06-19-2010, 10:29 PM #3
Member
- Join Date
- Jun 2010
- Posts
- 2
- Rep Power
- 0
Thanx curmudgeon
I reviewed the docs and that's what I basically did in my application but the wrong way. I see there are methods for first, next, previous, last... in CardLayout and I did the same thing in my application using Stack and stacking JFrames to it - now I see that was unneccessary.
Thanx again, I'll try with CardLayout and JPanels.
Similar Threads
-
JFrame resizing problem
By Bluefox815 in forum AWT / SwingReplies: 7Last Post: 02-24-2011, 07:56 PM -
Problem-----JFrame
By HariPrasad in forum AWT / SwingReplies: 2Last Post: 07-28-2009, 12:34 PM -
Suggestions required for solving a Java problem
By bilal_ali_java in forum Advanced JavaReplies: 3Last Post: 08-16-2008, 01:11 AM -
JFrame problem
By vassil_zorev in forum AWT / SwingReplies: 1Last Post: 01-25-2008, 02:53 AM -
JFrame problem
By saytri in forum New To JavaReplies: 6Last Post: 01-11-2008, 05:12 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks