Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22

Thread: MouseEvent

  1. #21
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    Quote Originally Posted by PhQ View Post
    How come that this
    Java Code:
    add(mousePositionLabel, BorderLayout.SOUTH);
            addMouseMotionListener(new MouseAdapter() {
    
                public void mouseMoved(MouseEvent e) {
                    String labelTxt = MOUSE_POS + String.format("[%d, %d]", e.getPoint().x, e.getPoint().y);
                    mousePositionLabel.setText(labelTxt);
                }
            });
    doesn't work in JTabbedPane?
    This has nothing to do with JTabbedPane and all to do with your adding a MouseMotionListener to a component (here the JApplet) and then adding components into it that will block the original component from receiving mouse events.

  2. #22
    PhQ's Avatar
    PhQ
    PhQ is offline Senior Member
    Join Date
    Mar 2010
    Location
    Lithuania
    Posts
    358
    Rep Power
    5

    Default

    How can I make a GUI or a Panel to show the command thing (when you do System.out.println("Hello"); it says hello on that command thing), for example make a JTextArea?
    Last edited by PhQ; 03-26-2010 at 08:50 PM.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •