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 / August 2004

Tip: Looking for answers? Try searching our database.

Error Using cardLayout.show with Java 1.4

Thread view: 
mpinhorn - 30 Aug 2004 19:22 GMT
Hello,

I have a problem in my code. When I use Java 1.3 my code works fine.
But when I use Java 1.4.1, I get an "Array Index Out of Range" Error
on my cardLayout.show line.

Can anybody explain what is going on ? Did I miss something between
Java 1.3 and 1.4 ?

Here is an snip of my code.

private final CardLayout cardLayout = new CardLayout();
private final JPanel     cardPanel  = new JPanel(cardLayout);
.
.
.
 if (ev.getActionCommand().equals(CARD_CHANGE_COMMAND)) {

       String name = (String)cbCards.getSelectedItem();

    cardLayout.show(cardPanel, name);

   }

Thanks for any help.

Matthew
Andrew Thompson - 31 Aug 2004 06:24 GMT
> I have a problem in my code. ..

What code?  Give us a small example
<http://www.physci.org/codes/sscce.jsp>

[  Many things are possible, but it is most
likely a bug in your code was hidden by 1.3
and revelaed by 1.4

Thread safety perhaps?  ]

Signature

Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology



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.