Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2005

Tip: Looking for answers? Try searching our database.

Changing JPanels in a JSplitPane

Thread view: 
Sebastian Murray-Roberts - 18 Jan 2005 09:59 GMT
Hi

I'm busy writing a swing application that consists of a JTabbedPane with each tab being a JSplitPane. Each of these JSplitPanes has a bunch of buttons on the left hand side, and pressing a button brings up a JPanel on the right hand side with the appropriate form on it. The problem is that i can bring up one panel, but the minute i click another button to bring up a different panel the application just hangs... I have no idea why.

The code i'm using to change panels looks something like this.

private void generalConfigPressed(java.awt.event.ActionEvent evt) {
       generalConfigPanel tmp = new generalConfigPanel();    
       tmp.setCommunicator(comm);
       jSplitPane1.remove(jSplitPane1.getRightComponent());
       jSplitPane1.setRightComponent(tmp);
   }

generalConfigPanel is a JPanel. setCommunicator is a method i need to invoke before displaying the panel.

I'm using j2sdk 1.4.2

Any suggestions would be most appreciated.

Thanks in advance
Sebastian
Andrew Thompson - 18 Jan 2005 10:08 GMT
> The code i'm using to change panels looks something like this.

"I wrote a tune and it goes a little somethin' like this.."
..Works great for ol' Blues players, less well for discussions of
programming languages, especially when the code breaks.

I suggest instead.. <http://www.physci.org/codes/sscce.jsp>

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane

Sebastian Murray-Roberts - 18 Jan 2005 13:16 GMT
well the sscce worked, so i realised i needed to allocate even more memory than i had previously. so thanks i guess ;)
Andrew Thompson - 18 Jan 2005 13:43 GMT
> well the sscce worked, so i realised i needed to allocate
> even more memory than i had previously. so thanks i guess ;)

You're welcome.  ..I guess.   ;-)

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.