Error Using cardLayout.show with Java 1.4

  • Follow


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
0
Reply mpinhorn 8/30/2004 6:22:34 PM

On 30 Aug 2004 11:22:34 -0700, mpinhorn wrote:

> 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?  ]

-- 
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
0
Reply Andrew 8/31/2004 5:24:33 AM


1 Replies
190 Views

(page loaded in 0.047 seconds)

Similiar Articles:













7/29/2012 6:19:57 PM


Reply: