Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Trouble with CardLayout (I think)

Reply
Thread Tools

Trouble with CardLayout (I think)

 
 
AJ
Guest
Posts: n/a
 
      01-08-2004
I have an application that looks like this:

--------------------------
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
--------------------------


The thing on the left is a JPanel with Buttons and other things on it.
The thing on the right is a JPanel with a CardLayout. I am having a
problem with the various cards in the CardLayout receiving mouse
clicks. As of now, I only have 2 cards in my card layout. One is a
JEditorPane, and one is a Java X Server application. The applications
which I display on the X Server in the one card don't seem to get
keyboard input. The html I am displaying in the JEditorPane doesn't
respond to hyperlinks (Yes, I did make it a hyperlinkistener). The
code in question seems to work fine in sample applications that don't
use the CardLayout. Any ideas?

Thanks!

AJ
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      01-09-2004
"AJ" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
.....
| ...The
| code in question seems to work fine in sample applications that
don't
| use the CardLayout. Any ideas?

Try to add both of the Panels into a GridLayout
instead of CardLayout, and see if _that_ works.
If it does, it strongly indicates the CardLayout is
the problem..

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site


 
Reply With Quote
 
 
 
 
Wilhelm Stockhammer
Guest
Posts: n/a
 
      01-10-2004
I once wrote an applet for conversion of arabic numbers to roman.
I added the two numpads (one for arabic and one for roman), that
contained the numbers in form of clickable buttons, into a cardlayout.
I had a similiar problam as you. The buttons did not respond to
mouse-clicks.
I found out, that after changing the size of the browser-window, the
application worked properly. (which, I must confess is not very
satisfying as a solution, but it may point out that the problem
is maybe on the hand of the window manager or the vm).
I made that experience on a Debian Linux system.

Willi

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cardlayout GUI IanH Java 11 03-14-2006 05:19 PM
CardLayout works, but "cards" randomly disappear roadkill Java 7 01-09-2005 06:04 AM
problems with a cardlayout. steve Java 1 11-21-2004 10:54 PM
cardlayout problem BG Java 0 07-30-2003 02:44 AM
CardLayout on JRE 1.4.2 Lee Fesperman Java 0 07-04-2003 02:48 AM



Advertisments