JPanel panel_navigation = new JPanel(new BorderLayout()); label_navigation = new JLabel("Navigation-Pane"); panel_navigation.add(label_navigation,BorderLayout.NORTH); JScrollPane scrollpane_navigation = new JScrollPane(panel_navigation);
label_status = new JLabel("Status"); JPanel panel_contentpane = new JPanel(); label_contentpane = new JLabel("Content-Pane"); label_contentpane.addMouseMotionListener(new MouseMotionAdapter() { public void mouseEntered(MouseEvent e) { System.out.println("hello"); label_status.setText("Content-Pane"); } public void mouseExited(MouseEvent e) { label_status.setText(" "); } public void mouseClicked(MouseEvent e) { System.out.println("hello"); label_status.setText("Content-Pane"); } }); label_contentpane.setAlignmentX(JLabel.CENTER_ALIGNMENT); panel_contentpane.add(label_contentpane);
JScrollPane scrollpane_contentpane = new JScrollPane(panel_contentpane); //JSplitPane separates the two scrollpanes with divider between them splitpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true, scrollpane_navigation,scrollpane_contentpane);
chandra, What is the matter ? Or more exactly, where is the matter ? I got you code on the laptop & there is no bug ... So Over what label do you want to see twhat ? A ToolTip over the menu items or ... Thomas, p.s. : Could you also use the following page http://www.artima.com/forums/howtopost.html formatting always life easier !
Hello Thomas my problem is when mouse enters the JLabel, i.e label_contentpane in my code it is not firing the event and set another JLabel , i.e label_status ,must execute label_status.setText("Content-Pane"); hope u understood my point.