Trouble with CardLayout (I think)

Discussion in 'Java' started by AJ, Jan 8, 2004.

  1. AJ

    AJ Guest

    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
     
    AJ, Jan 8, 2004
    #1
    1. Advertising

  2. "AJ" <> wrote in message
    news:...
    .....
    | ...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
     
    Andrew Thompson, Jan 9, 2004
    #2
    1. Advertising

  3. 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
     
    Wilhelm Stockhammer, Jan 10, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lee Fesperman

    CardLayout on JRE 1.4.2

    Lee Fesperman, Jul 4, 2003, in forum: Java
    Replies:
    0
    Views:
    379
    Lee Fesperman
    Jul 4, 2003
  2. BG

    cardlayout problem

    BG, Jul 30, 2003, in forum: Java
    Replies:
    0
    Views:
    411
  3. steve

    problems with a cardlayout.

    steve, Nov 21, 2004, in forum: Java
    Replies:
    1
    Views:
    377
    steve
    Nov 21, 2004
  4. roadkill
    Replies:
    7
    Views:
    658
    roadkill
    Jan 9, 2005
  5. IanH

    Cardlayout GUI

    IanH, Mar 12, 2006, in forum: Java
    Replies:
    11
    Views:
    1,006
    IchBin
    Mar 14, 2006
Loading...

Share This Page